LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-17-2020, 07:03 AM   #1
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Rep: Reputation: 243Reputation: 243Reputation: 243
Video from two identical USB cameras


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.
 
Old 04-18-2020, 02:00 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,120

Rep: Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371
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).
 
Old 04-19-2020, 06:33 AM   #3
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,820

Rep: Reputation: 229Reputation: 229Reputation: 229
Same chipset...

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.
 
Old 04-19-2020, 08:47 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
Old 04-27-2020, 05:28 AM   #5
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Original Poster
Rep: Reputation: 243Reputation: 243Reputation: 243
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.
 
Old 04-27-2020, 07:26 AM   #6
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Original Poster
Rep: Reputation: 243Reputation: 243Reputation: 243
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Point And Shoot Digital Cameras vs Smartphone cameras David.V General 12 08-15-2014 09:16 AM
autofs local map files identical but not identical to automount jwaldram Linux - Server 2 10-26-2012 10:35 AM
Why Linux kernel has restrictions on USB port and USB cameras? Dstruct0 Linux - Hardware 5 09-19-2011 04:14 PM
Using two identical USB devices on an Embedded ARM running debian JeffLangille83 Debian 6 08-13-2008 05:25 PM
Identical disks that are not identical staphanes Linux - Hardware 8 03-11-2006 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration