gkaindl / ambi-tv

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

STK1160 scaled picture #29

Closed fuchst closed 10 years ago

fuchst commented 10 years ago

MPlayer stream to test video-grabbing is showing a black bar at the left side and missing parts of the picture at the top, bottom and right side. Picture seems to be scaled up and aligned left. The used driver is easycap as I did not find STK1160 drivers for kernel 3.6.

If I use MPlayer at different resolution(720x576 instead of standard values) the picture is shown correctly. Is there a way to change grabbing settings for ambi-tv?

I also tried newer kernels with STK1160 included which showed the correct picture but unfortunately SPI did not work with those. (No spidev in /dev with modules loaded)

Hopefully a new official release of raspbian will include a kernel >3.6 as those have STK1160 drivers and working spi-modules.

fuchst commented 10 years ago

I was able to help myself out. Here is what I did: In v4l2-grab-source.c I had to edit function "ambitv_v4l2_grab_init_device".

Just copy the code and corresponding error handling block starting with ret = xioctl(grabber->fd, VIDIOC_G_FMT, &vid_fmt); and paste it right beneath it.

Between those two blocks I just changed the pixel width and height values like this: vid_fmt.fmt.pix.width = 720; vid_fmt.fmt.pix.height = 576;

Now the second VIDIOC_G_FMT has to be changed to VIDIOC_S_FMT.

That's it. Maybe someone will find it useful. The cropped picture was really bugging me.

jcf6288 commented 10 years ago

Not sure if you will get this but I am having this exact same issue with the Hyperion install (www.bite-in.com). I believe it uses some similar aspects and am wondering if you know where or how I can fix this as you did with ambi-tv? Thanks

duenorh commented 10 years ago

Any chance that I could get or see that file? I have the same problem but don't really understand what to copy and paste. I've tried several things and nothing seems to work.

fuchst commented 10 years ago

@jcf6288 Sorry for the late answer. I looked into it a bit and it seems Hyperion works more like a plugin to XBMC. Unfortunetly I didn't find a way to change the resolution there but I am not very familiar with XBMC. Maybe someone in a XBMC forum could help more with this.

@duenorh Sure. No problem. Here is the link to the file: https://github.com/fuchst/ambi-tv/blob/master/src/components/v4l2-grab-source.c You can just replace your exisiting v4l2-grab-source.c with this, rebuild ambi-tv and it should work.

duenorh commented 10 years ago

@fuchst thanks worked at the first try.