Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a pair of cheap USB cameras, bought six years apart but they look similar and probably have the same chipset. The brand is Tecknet, native resolution 1280x720, and lsusb reports them as ID 058f:3832 Alcor Micro Corp.
If I plug them both into my Slack box, two /dev/videoX devices appear. Using qv4l2 I can select either device and watch its stream. If I use two instances of qv4l2, then all is well until I try to use both cameras at once.
When one camera is running the other gives me a black screen with no error message and dmesg reports uvcvideo: Failed to submit URB 0 (-28). I have to turn off the first stream and restart the second to use the second camera.
The same thing happens if I drop the resolution on both cameras to 640x480, but if I replace one of them with a third webcam of a different brand I can view both cameras' streams at the same time and there doesn't seem to be any lag or frame dropping, so it doesn't look like a bandwidth problem.
Googling for the error, it looks like a few people have had the same problem when using multiple cameras of the same type, but can use two the same, so maybe I was unlucky in my choice of camera.
Using a USB hub or separate ports on the box doesn't make a difference.
This started as a project on an Android device, where I get the same behaviour (but the error is UVC device error! -354). Oddly the third camera isn't supported on Android, maybe they don't bother with gspca any more.
Two questions then:
Is there anything else I can try to make these cameras play nicely together on the same device?
If not, is there a fairly cheap webcam that is known to work nicely as a pair under Android? Or even under desktop Linux?
More detail in case anyone's interested:
The project is a set of poor-man's near-infrared goggles. The idea is to remove the IR filters from a pair of cameras and mount them on the front of a Google Cardboard-type headset, plugged into a 'phone via a USB hub and OTG connector, and either add or carry a beefy IR torch. So far every part works except the second camera, so plan B is a Cyclops version. If I do use two cameras they'll need similar lenses and fields of view, so mixing brands is probably out. By "fairly cheap" I mean less than 20 GBP apiece, and I'd rather have a bit more resolution than 640x480, which rules out the only "stereo" camera I've seen in that price range.
I would say part of the software (driver, codec, whatever) cannot handle concurrent execution. Maybe using docker (or some kind of container) helps to solve it. But probably it is kernel driver related, in that case container cannot help (and the driver should be patched somehow).
Have you checked with the both the commands lsusb and lspci? There is a six year difference in the two cameras, a long time in computer hardware: components and and suppliers change.
Last edited by thorkelljarl; 04-19-2020 at 06:35 AM.
Have you tried using them on separate USB buses? Have you tried using a powered USB hub. It could just be that both at the same time draw too much juice to keep them both on. Laptop USB buses are notoriously under powered. Sometimes a USB extension that drops usb 3 to usb 2 can help. Or a hub with similar specs.
Thanks for the replies, everyone. I'm testing on a desktop box, I've tried switching USB ports including ports wired to opposite ends of the motherboard but it made no difference. I have a powered USB2 hub, or rather one with a socket for a power supply, if I can find a suitable supply in my collection I'll give it a go but don't hold out much hope there.
lspci tells me plenty about the USB controllers but nothing about what's plugged into them, and lsusb -v gives identical descriptions for both. The second camera came from Fleabay so I don't know its history, it has a different cable but looks otherwise identical.
I've just discovered that a suspiciously similar camera is available under the brand "Trust", with a slightly higher resolution. I'm guessing that might be different enough to be worth a try.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.