gkaindl / ambi-tv

a flexible ambilight clone for embedded linux
296 stars 85 forks source link

LED output offset #33

Open samick99 opened 10 years ago

samick99 commented 10 years ago

Have finished the ambi-tv setup and all hardware seems to be working great. I'm now fine-tuning the LED output. The best way for me to describe this is if I were able to apply a negative value to the "Crop" values I would be able to make the output perfect.

This is what I am seeing: If I use my laptop for input to the ambi-tv setup and drag an image with a solid color to the top, bottom, left, right, sides of the display, the best I can do by adjusting the crop values to 0 is get the LED strip on the L side of my TV to change to the color of the image exactly when it hits that edge. On the R side and bottom, the LED strips change color at least a couple inches before the image hits that edge of the screen. I'm not sure about the top because I can't drag the image past the border of the display but it's pretty obvious that my "grab" is too small and shifted to the Left.

I am using PAL and have also tried the NTSC setting after commenting out the Pal hack and re-compiling the usbtv driver. It does then start the program with 720x480 instead of 720x576 with absolutely no change in the symptoms I describe above.

Changing the LED inset values does change the dimensions of the LED output to screen size like it's supposed to but has absolutely no effect on what I describe above.

Any insight to this challenge is welcome!

fuchst commented 10 years ago

That sounds like a problem I had with my STK1160 grabber. When I checked the signal with mplayer it was somewhat scaled with the left side having a black border and the rest being cut. I did solve the problem by changing the grabbing resolution in the ambi-tv code. You can look at the following commit I did: https://github.com/fuchst/ambi-tv/commit/d484c48cc4e84c1c75fb3d74a0409fb42c3763da

Maybe it helps and good luck with finding a solution.

samick99 commented 10 years ago

I did read your post and didn’t understand exactly what you did. The link to the code is helpful… I’ll let you know the outcome. Thanks for the response to my post!

Sam

From: fuchst [mailto:notifications@github.com] Sent: Friday, October 11, 2013 2:16 PM To: gkaindl/ambi-tv Cc: samick99 Subject: Re: [ambi-tv] LED output offset (#33)

That sounds like a problem I had with my STK1160 grabber. When I checked the signal with mplayer it was somewhat scaled with the left side having a black border and the rest being cut. I did solve the problem by changing the grabbing resolution in the ambi-tv code. You can look at the following commit I did: fuchst@ https://github.com/fuchst/ambi-tv/commit/d484c48cc4e84c1c75fb3d74a0409fb42c3763da d484c48

Maybe it helps and good luck with finding a solution.

— Reply to this email directly or view it on GitHub https://github.com/gkaindl/ambi-tv/issues/33#issuecomment-26168808 . https://github.com/notifications/beacon/K-pd2HR_SLRAmg4dlg8wHqXloMBWhWm1QvCpsfKca45ZIOzNz_tQdrGYbKDZCmU4.gif

fuchst commented 10 years ago

If you didn't change anything in v4l2-grab-source.c you could just copy the whole file to your src/components folder and rebuild ambi-tv. https://github.com/fuchst/ambi-tv/blob/d484c48cc4e84c1c75fb3d74a0409fb42c3763da/src/components/v4l2-grab-source.c This is the complete file.

What I did is set new resolution parameters after the program requested grabbing informations from the driver. Unfortunalely it only gets back 640x480 as resolution and not the maximum possible.

samick99 commented 10 years ago

Thanks for the link. If this doesn't work, can I toy around with the resolution values e.g. set it to 770x616 or will this cause a compilation error or an error when executing the program?

fuchst commented 10 years ago

To be honest I don't know what happens with resolutions that are not supported by the device as I never did try it. I used mplayer and tested the maximum resolution that was written in the manual and since that did lead to a picture I was pleased with I stopped the testing and rewrote the code. What I could imagine is that it just falls back to a supported resolution and overwrites the values you specified.

samick99 commented 10 years ago

Thanks. I haven't figured out how to use mplayer. I get an error when I try. What are the exact hookups to/from the Pi/tv, etc.

fuchst commented 10 years ago

I have ambi-tv hooked up the same way as in the tutorial. And then just HDMI cable to the TV. Everything should be set to PAL. To test: 640x480: sudo mplayer tv:// -tv device=/dev/video0 -hardframedrop 720x576: sudo mplayer tv:// -tv device=/dev/video0:width=720:height=576 -hardframedrop

What is the error message you get?

samick99 commented 10 years ago

Using either of the command lines you gave me, the hardframedrop compared to what I see on the TV looks identical: L side of both images is good but right, top, and bottom sides all have a little cut off on the hardframedrop.

samick99 commented 10 years ago

Tried a different Easycap video grabber and same symptoms. Is there a way to apply a negative crop or make the grabbed image bigger so I can crop it down properly?