Re: stk1160 linux driver
Gianluca, On Mon, Jun 25, 2012 at 4:09 AM, Gianluca Bergamo wrote: > In my environment this command line gives only one format supported (UYVY) > and then yavta freezes. > I suspect it freezes on an ioctl to the driver. I must check it. > This freezing is actually a dead lock, and I think it's not related to ARM but to a (now fixed) bug. The bug was related to differences in locking scheme between v3.2 and v3.4 kernel, i.e. to make stk1160 work on v3.2 some fixes are needed, beside your "module_usb_driver" patch. If you (or anyone) wants to use stk1160 on current kernels (3.2 and such) you can checkout this github tree I've prepared to help user adoption of stk1160. This is current (beta tested) branch: https://github.com/ezequielgarcia/stk1160-standalone And this is with "keep_buffers" parameter: https://github.com/ezequielgarcia/stk1160-standalone/tree/0.9.4_v3.2 I don't know if you're still interested in using stk1160, but I wanted you to be aware of this issue. As far as I know, there shouldn't be any issues with ARM; if you can confirm this we'd appreciate it. Regards, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
Hey Gianluca, On Mon, Jun 25, 2012 at 11:47 AM, Devin Heitmueller wrote: > On Mon, Jun 25, 2012 at 10:36 AM, Ezequiel Garcia > wrote: > Others issue related to memory allocation on platforms like ARM with > limited coherent memory (if the device is unplugged/replugged often, > the device won't be able to allocate the URB buffers), as well as As Devin says there maybe some issues with memory allocation I've added a module parameter for stk1160 named "keep_buffers" that could be used to reduce memory fragmentation. You may want to test the latest patch: http://patchwork.linuxtv.org/patch/13148/ If you have any problems/questions feel free to ask. Thanks, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
On Mon, Jun 25, 2012 at 10:36 AM, Ezequiel Garcia wrote: > I've added Devin in Cc: > Devin: You said you ran into some issues on em28xx on ARM, what kind > of issues? There are a handful of issues, but the big one which everybody runs into is a typo in a left shift operation that causes capture to be completely broken on ARM. I just never got around to sending a patch upstream for it. I don't know if this is the original report, but the issue is summarized well here: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28407.html Others issue related to memory allocation on platforms like ARM with limited coherent memory (if the device is unplugged/replugged often, the device won't be able to allocate the URB buffers), as well as performance problems related to the type of memory used (dependent on which ARM chip is used). Most of this stuff is relatively straightforward to fix but I've just been too busy with other projects. Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
On Mon, Jun 25, 2012 at 11:26 AM, Gianluca Bergamo wrote: > Thank you. > I'm going to test it as soon as I can. > > PS : Are you testing on ARM architecture? I'm starting to think my problems > could be related to it...as most of the video capture drivers are working > well on x86...is it possible for you to do a little test on ARM? > No :-( However, if you have a small ARM device you'd like to donate I'll give it good use :-) Anyway, this thread suggests there are some issues with analog capture on ARM devices (using em28xx driver, but it's similar to stk1160): http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/48009 I've added Devin in Cc: Devin: You said you ran into some issues on em28xx on ARM, what kind of issues? Thanks, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
On Mon, Jun 25, 2012 at 11:09 AM, Gianluca Bergamo wrote: > Hi Ezequiel, > > Have you tested with the latest version of your driver? Where can I download > it? http://patchwork.linuxtv.org/patch/13043/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
Hi Gianluca, On Mon, Jun 25, 2012 at 4:09 AM, Gianluca Bergamo wrote: > Hi Ezequiel, > > No problem in patching each new release you made. Please note I've just send a v3 of stk1160 driver. It adds support for controlling ac97 and for selecting video inputs. > > In my environment this command line gives only one format supported (UYVY) > and then yavta freezes. > I suspect it freezes on an ioctl to the driver. I must check it. > Weird. I've just tested with yavta and it works perfectly. You should note that this command is wrong: ./yavta -f YUYV -s 720x576 -n 4 --capture=4 -F /dev/video1 and it should be: ./yavta -f UYVY -s 720x576 -n 4 --capture=4 -F /dev/video1 Since, as you noted the only supported format is UYVY. Some applications take advantage of libv4l2 wrapper library to increase the output format set. For instance, if I do ENUM_FMT using v4l2-ctl I get just one supported format: $ v4l2-ctl --list-formats ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Capture Pixel Format: 'UYVY' Name: 16 bpp YUY2, 4:2:2, packed But if I use wrapper library: $ v4l2-ctl -w --list-formats ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Capture Pixel Format: 'UYVY' Name: 16 bpp YUY2, 4:2:2, packed Index : 1 Type: Video Capture Pixel Format: 'RGB3' (emulated) Name: RGB3 Index : 2 Type: Video Capture Pixel Format: 'BGR3' (emulated) Name: BGR3 Index : 3 Type: Video Capture Pixel Format: 'YU12' (emulated) Name: YU12 Index : 4 Type: Video Capture Pixel Format: 'YV12' (emulated) Name: YV12 In case you need it, here's my yavta output: $ ./yavta --enum-formats /dev/video0 Device /dev/video0 opened. Device `stk1160' on `usb-:00:13.2-2' is a video capture device. - Available formats: Format 0: UYVY (59565955) Type: Video capture (1) Name: 16 bpp YUY2, 4:2:2, packed $ ./yavta -f YUYV -s 720x576 -n 4 --capture=4 -F /dev/video0 Device /dev/video0 opened. Device `stk1160' on `usb-:00:13.2-2' is a video capture device. Unable to set format: Invalid argument (22). localhost yavta # ./yavta -f UYVY -s 720x576 -n 4 --capture=4 -F /dev/video0 Device /dev/video0 opened. Device `stk1160' on `usb-:00:13.2-2' is a video capture device. Video format set: UYVY (59565955) 720x480 (stride 1440) buffer size 691200 Video format: UYVY (59565955) 720x480 (stride 1440) buffer size 691200 8 buffers requested. length: 691200 offset: 0 Buffer 0 mapped at address 0xb7584000. length: 691200 offset: 692224 Buffer 1 mapped at address 0xb74db000. length: 691200 offset: 1384448 Buffer 2 mapped at address 0xb7432000. length: 691200 offset: 2076672 Buffer 3 mapped at address 0xb7389000. length: 691200 offset: 2768896 Buffer 4 mapped at address 0xb72e. length: 691200 offset: 3461120 Buffer 5 mapped at address 0xb7237000. length: 691200 offset: 4153344 Buffer 6 mapped at address 0xb718e000. length: 691200 offset: 4845568 Buffer 7 mapped at address 0xb70e5000. 0 (0) [-] 0 691200 bytes 1340632305.824287 1826.669365 -0.002 fps 1 (1) [-] 1 691200 bytes 1340632305.856350 1826.709943 31.189 fps 2 (2) [-] 1 691200 bytes 1340632305.896222 1826.741385 25.080 fps 3 (3) [-] 2 691200 bytes 1340632305.928226 1826.773354 31.246 fps Captured 4 frames in 0.199372 seconds (20.062936 fps, 13867501.311552 B/s). 8 buffers released. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
Hi Gianluca, On Sat, Jun 23, 2012 at 10:51 AM, Gianluca Bergamo wrote: > You are using : > > module_usb_driver(stk1160_usb_driver); > > That has been introduced in kernel 3.3 and so in my kernel 3.0.8 it does not > give compiler error (I don't know why) but the probe method is never called. > I've added the init and exit methods by myself and the probe now works. > I think you might want to take a look to media_build: http://git.linuxtv.org/media_build.git http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers This allows latest drivers to be built against old kernels. A "backward-compatible" solution for stk1160 wouldn't be accepted mainline, but feel free to use (in a personal fashion) your patched driver and/or ask me to review your patch. Unfortunately, you'll have to patch yourself each time I release a new driver version, so you may wan to try media_build as I previously suggested. Hope this helps, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
On Sat, Jun 23, 2012 at 11:11 AM, Gianluca Bergamo wrote: > I think you can simply make a patch to make it work also with kernels < 3.3. > Let's talk about this on monday...now I don't have my development pc with me > so I can't see the code and the dbg messages. Okey, let's talk on monday. Regards, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
On Sat, Jun 23, 2012 at 10:51 AM, Gianluca Bergamo wrote: > > I've found the problem. Your module is lacking the init and exit module > functions. > You are using : > > module_usb_driver(stk1160_usb_driver); Indeed. > > That has been introduced in kernel 3.3 and so in my kernel 3.0.8 it does not > give compiler error (I don't know why) but the probe method is never called. That's weird, I got a bunch of warnings. Compilers are sometimes crazy :-) > I've added the init and exit methods by myself and the probe now works. > Great! Keep in mind I wrote this driver on newer kernels so I don't know what other kinds of trouble you may bump into. > My problem now is that I got out of memory errors when testing it with > yavta. > BTW, I'm using this driver on an Android 4 ARM device. What kind of "out of memory errors"? dmesg? How many memory do you have on your device? Currently stk1160 dallocate memory for usb transfer buffers on every stop and has to reallocate on every start. This approach is not very smart, as fragments memory without reason. You can take a look at a similar problem on em28xx driver and a patch proposed: http://patchwork.linuxtv.org/patch/9875/ I'm not telling you this is your problem, but could be. Anyway, feel free to: * provide more info * ask me questions * ask for patches > Now I don't have the patch I've made in my hand...but on monday I will send > it to you. > Okey. I guess I could start a github repo to host a 3.0.8 tree with the stk1160 driver if that helps you. Regards, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: stk1160 linux driver
Hi Gianluca, On Fri, Jun 22, 2012 at 9:00 AM, Gianluca Bergamo wrote: > > I've patched my kernel 3.0.8 and it compiles without problems. > I've compiled it NOT as a module but directly built in in the kernel. > I just patched a vanilla 3.0.8 (taken from stable repository) with stk1160 driver patch and I believe this kernel is too old. Are you using stock kernel 3.0.8? Are you sure it compiled without any warnings and/or errors? I got some missing symbol warnings here when compiling the driver. This symbols are needed so the driver won't work. Is it possible for you to try with a 3.3 (or above) kernel? Thanks, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html