I recently purchased an unbranded (cheap) USB video capture card on Ebay.
I started with the intended goal of recording & streaming using OBS Studio via my gaming/dev-desktop (running Manjaro Linux).
This is the tale of my troubleshooting journey, how it's looking now, and also my new Twitch stream.
My troubleshooting journey
At first it was only working intermittently. After several attempts, I did get it to work; here's a screencap of the Twitch stream as proof:
The error(s)
The most persistent error codes I encountered were displayed repeatedly in the dmesg logs. First I noticed a "missing device" error that appeared immediately after plugging in the capture card via USBC:
device descriptor read/64, error -71
This one appeared not to cause any functional issues, but I'm noting it just in case it's relevant for someone else's journey. It likely indicates that the USB controller was delayed in handing off to the UVC driver; I have no evidence for this, but it seems likely, especially after having spent some hours debugging errors from the uvcvideo kernel module.
The other error only appeared after I launched obs-studio; repeatedly displayed in dmesg was this mysterious fellow:
Non-zero status (-71) in video completion handler.
This is the most problematic of the errors. I didn't find any existing solutions that worked for me, though there is quite a history of relevant posts, other information; I'll provide some relevant links at the end.
The solution(s)
# rmmod --force uvcvideo; sleep 1s; modprobe uvcvideo trace=1
A few key troubleshooting steps that I found worked when nothing else did.
- Ensure you have unplugged as many USB devices as possible before doing anything else. If you have too much plugged in, your USB controller is likely underpowered, an extremely common & easily overlooked problem with USB-related failures in general, so keep it in mind for future reference 😉.
- Pay attention to the uvcvideo kernel module options. The fix that saved me in the end was utilizing the option trace=1.This prints extra trace output in the dmesg logs, and likely causes some key delays during the driver hand-off from USB controller to the UVC module that allow the capture software (OBS Studio, e.g.) to avoid timeouts when querying new frames... just a working hypothesis. Keep in mind that to persist this change after a reboot, you need to include the options in /etc/modprobe.d/uvcvideo.conf.
- Check this page for the "official" troubleshooting guide. It was helpful just to see a few examples for configuring the system BUS and for understanding what the driver expects from a developer/debugging standpoint.
References
- Strange UVC webcam and capture card issues : r/archlinux
- udev - ArchWiki
- Webcam setup - ArchWiki
- Webcam setup (uvcvideo.conf) - ArchWiki
- Arch Linux - obs-studio 32.0.4-1 (x86_64)
- Linux UVC driver & tools
- USB performance: Isochronous (audio or video) - Raspberry Pi Forums
- Linux UVC driver & tools – FAQ

No comments:
Post a Comment
Discuss.