How do I enable the UVC_QUIRK_FIX_BANDWIDTH quirk in Linux UVC Driver?

戏子无情 提交于 2019-11-30 09:25:30

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

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.)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!