Configure UVC Video Driver for multiple ( > 2) web cameras

Hello all,

I am working on a project to get 360 degree vision with the use of 6 USB cameras. I am wanting to stream all 6 at once.

I understand that the main limitation for this is USB hub bandwidth. I have enabled USB3.0 for my TK1 which has allowed me to stream 2 cameras at once, but not more.

Poking around on the web, it appears that there is a quirk that can be configured with the UVC video driver to better manage USB hub bandwidth
http://stackoverflow.com/questions/25619309/how-do-i-enable-the-uvc-quirk-fix-bandwidth-quirk-in-linux-uvc-driver

I have confirmed that my webcam is using the UVC driver:

ubuntu@tegra-ubuntu:~/cam$ ls -ld /sys/class/video4linux/video0/device/driver
lrwxrwxrwx 1 root root 0 Mar  4 11:25 /sys/class/video4linux/video0/device/driver -> ../../../../../../../bus/usb/drivers/uvcvideo

However, I’m a little bit confused as to how (or even if it is possible) to configure the UVC driver as described above. Any ideas on how this can be done on the TK1? Am I completely in the weeds with this train of thought?

It seems strange that the system cannot identify uvcvideo, but also says that it is builtin

ubuntu@tegra-ubuntu:~/cam$ modinfo uvcvideo
modinfo: ERROR: Module uvcvideo not found.
ubuntu@tegra-ubuntu:~/cam$ rmmod uvcvideo
rmmod: ERROR: Module uvcvideo is builtin.

The following line seems to execute, although it does not appear to do anything.

modprobe uvcvideo quirks=640

Hello,
You can check the driver code in kernel: drivers/media/usb/uvc/uvc_driver.c
quirks is a module parameter. You can either change the code in driver, or compile uvc as loadable module. (it’s builtin by default.)

br
Chenjian

I only see kconfig and makefile. Am I missing something here?

I’m not sure of the syntax, but even a non-module might be able to use the extlinux.conf “APPEND” to place an argument equivalent to something like “uvcvideo=quirks,640” without compiling anything (that syntax is completely contrived, I don’t know if that will actually work…it’s representative of how the serial console arguments are formatted).

Generally linuxdev is right.
You can append the following in kernel command line. (Note the format)
“uvcvideo.quirks=640”

br
Chenjian

I was able to try this and it works; I can now stream 4 cheapo webcams using OpenCV at 320x240 resolution with a USB3.0 hub. More cameras can probably be used if compression is utilized.

Also, as a lesson learned the hard way, and for those who have never worked with extlinux.conf before, be sure to append “uvcvideo.quirks=640” to the end of the existing APPEND line, as opposed to adding a new APPEND line. This will brick your system!

extlinux.conf is an interesting small topic all its own…if this were a fantasy game, I’d call it “arcane magic”. The beauty though is that this file is for u-boot, and when using u-boot, you could simply take a root partition clone and edit the loopback mounted non-working extlinux.conf, then put the edited clone back in to be up and running again as if no error ever took place.