问题
I am currently trying to run 2 webcams on a Wandboard board, which have to share a USB hub. Problem is , the current driver implementation (YUV only) saturates the USB hub and in the end I can only connect one camera.
However the UVC driver implementation has a quirk for this kind of situation, and others.
Problem is, I did not find any documentation on how to load these quirks. Could you please assist me with that?
回答1:
you can change the behaviour of many kernel-modules by passing some parameters.
you can get a list of all available module parameters with the modinfo
command:
# modinfo uvcvideo
shows that there is a "quirks" parameters, which can be used.
looking at the faq you posted, it seems that the quirks
are really a bitfield, so if you want to enable multiple quirks, you have to add the numbers.
first unload the driver (obviously you must not use it when doing so):
# rmmod uvcvideo
then re-load it with the quirks
parameter.
assuming you want to enable both UVC_QUIRK_FIX_BANDWIDTH
(which has the hex-value 0x80
, which is 128
in decimal) and UVC_QUIRK_RESTRICT_FRAME_RATE
(which is 0x200
thus 512
) you would use a quirks value of 640
(which is 128+512
resp. 0x200|0x80
):
# modprobe uvcvideo quirks=640
回答2:
To make umläute's answer survive reboots, I created file /etc/modprobe.d/uvcvideo.conf
with content
options uvcvideo quirks=0x80
To get the module to reload uvcvideo.conf
, unload and load the module:
rmmod uvcvideo
modprobe uvcvideo
Interestingly, using echo
to set quirks
(i.e., while uvcvideo
is loaded) did not work, even though the UVC driver FAQ uses echo
to modify the trace
parameter of uvcvideo
.
Note: UVC_QUIRK_FIX_BANDWIDTH enabled many Microsoft LifeCam Cinema webcams per USB host controller in my case (on Ubuntu 14.04) for a machine vision application. The LifeCam Cinema reserves about 48% of USB 2.0 bandwidth (according to Device Manager on Windows), so without the quirk one can operate at most two LifeCams per host controller. (For several host controller chips, I was even limited to one LifeCam without the quirk.)
来源:https://stackoverflow.com/questions/25619309/how-do-i-enable-the-uvc-quirk-fix-bandwidth-quirk-in-linux-uvc-driver