Skip to content

Instantly share code, notes, and snippets.

@fagianijunior
Created January 31, 2020 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fagianijunior/0b8ae0e7851834d628d79c6cacf372dc to your computer and use it in GitHub Desktop.
Save fagianijunior/0b8ae0e7851834d628d79c6cacf372dc to your computer and use it in GitHub Desktop.
Tested on a quelima sq11.
#################################
# ERRO
################################
$ ffmpeg -f v4l2 -video_size 640x480 -i /dev/video0 -c:v libx264 -preset ultrafast webcam.mp4
/dev/video0: Input/output error
Try setting the quirks parameter to 2 before plugging your webcam (either
with 'modprobe uvcvideo quirks=2' if the driver is not already loaded, or
with 'echo 2 > /sys/modules/uvcvideo/parameters/quirks' if the driver is
already loaded).
######################################
# Changing on a module
######################################
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=2
###################################
# Permanent change on a module
###################################
Add it to /etc/modprobe.d/uvcvideo.conf:
# fix bandwidth issue for quelima SQ11
options uvcvideo quirks=2
refernences:
https://sourceforge.net/p/linux-uvc/mailman/message/29832729/
https://stackoverflow.com/questions/25619309/how-do-i-enable-the-uvc-quirk-fix-bandwidth-quirk-in-linux-uvc-driver
https://wiki.archlinux.org/index.php/Webcam_setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment