Discussion:
[linux-uvc-devel] Simultaneous access to 2 identical webcams
Chris Bare
2014-01-09 15:26:26 UTC
Permalink
I have 2 Logitech C910 USB wecams and a logitech orb attached to my
computer.
I can display 640x480 images from 1 C910 and the orb at the same time, but
cannot access both 910's at the same time.
Even if I drop the resolution to 320x240, the second 910 gives me an error.

Is this a driver limitation, or do i need to set up special rules for udev?
/dev/video1 and /dev/video2 are both created and work if I access them one
at a time.

I am using the following vlc command:
vlc -I dummy v4l2:///dev/video1:width=320:height=240:fps=30
:v4l2-chroma=MJPG :v4l2-fps=30

when I run:
vlc -I dummy v4l2:///dev/video2:width=320:height=240:fps=30
:v4l2-chroma=MJPG :v4l2-fps=30

while /dev/video1 is running, I get the following error:

[0x7f7bd40010e8] v4l2 demux error: VIDIOC_STREAMON failed
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
[0x7f7bd4007e18] v4l2 access error: cannot set input 0: Device or resource
busy
[0x7f7bd4007e18] v4l2 access error: cannot set input 0: Device or resource
busy
[0x7f7bd0000b28] main input error: open of
`v4l2:///dev/video2:width=320:height=240:fps=30' failed
[0x7f7bd0000b28] main input error: Your input can't be opened
[0x7f7bd0000b28] main input error: VLC is unable to open the MRL
'v4l2:///dev/video2:width=320:height=240:fps=30'. Check the log for details.
[0x7f7bd4005348] v4l2 demux error: cannot set input 0: Device or resource
busy
[0x7f7bd4005348] v4l2 demux error: cannot set input 0: Device or resource
busy
[0x7f7bd4007c08] v4l2 access error: cannot set input 0: Device or resource
busy
[0x7f7bd4007c08] v4l2 access error: cannot set input 0: Device or resource
busy
[0x7f7bd0006038] main input error: open of
`v4l2:///dev/video2:width=320:height=240:fps=30' failed
[0x7f7bd0006038] main input error: Your input can't be opened
Adrian Pardini
2014-01-09 15:42:42 UTC
Permalink
Post by Chris Bare
I have 2 Logitech C910 USB wecams and a logitech orb attached to my
computer.
I can display 640x480 images from 1 C910 and the orb at the same time, but
cannot access both 910's at the same time.
Even if I drop the resolution to 320x240, the second 910 gives me an error.
Is this a driver limitation, or do i need to set up special rules for udev?
/dev/video1 and /dev/video2 are both created and work if I access them one
at a time.
Hi Chris,

do the C910 work at the same time if you unplug the orb? I'm guessing
that the three devices need more than either the available bandwidth
or the amount of isochronous transfers.

You could look at /sys/kernel/debug/usb/devices when opening one
camera and the orb. If your system has more than one usb host
controller, plugging one of the cameras on another should work.

On the same controller the best I was able to capture were two C920
***@30fps with audio using MJPG before hitting a limit on the
bus.

If you have pci-e slots available the usb3 cards based on NEC or TI
controllers work fine with linux and these cameras (C920 and C910).

Best regards.
Chris Bare
2014-01-09 16:07:44 UTC
Permalink
with 1 C910 running /sys/kernel/debug/usb/devices shows:
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 2
B: Alloc=485/800 us (61%), #Int= 6, #Iso= 21

with the orb running, it shows:
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 2
B: Alloc=317/800 us (40%), #Int= 6, #Iso= 21

so I guess that explains why I can't run both C910s. The odd thing is that
the allocation stays the same even if I drop the frame size to 160x120.
Or is that normal and the camera always uses the same bandwidth regardless
of what is requested from it?
Post by Chris Bare
Post by Chris Bare
I have 2 Logitech C910 USB wecams and a logitech orb attached to my
computer.
I can display 640x480 images from 1 C910 and the orb at the same time,
but
Post by Chris Bare
cannot access both 910's at the same time.
Even if I drop the resolution to 320x240, the second 910 gives me an
error.
Post by Chris Bare
Is this a driver limitation, or do i need to set up special rules for
udev?
Post by Chris Bare
/dev/video1 and /dev/video2 are both created and work if I access them
one
Post by Chris Bare
at a time.
Hi Chris,
do the C910 work at the same time if you unplug the orb? I'm guessing
that the three devices need more than either the available bandwidth
or the amount of isochronous transfers.
You could look at /sys/kernel/debug/usb/devices when opening one
camera and the orb. If your system has more than one usb host
controller, plugging one of the cameras on another should work.
On the same controller the best I was able to capture were two C920
bus.
If you have pci-e slots available the usb3 cards based on NEC or TI
controllers work fine with linux and these cameras (C920 and C910).
Best regards.
Adrian Pardini
2014-01-09 16:17:22 UTC
Permalink
Post by Chris Bare
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 2
B: Alloc=485/800 us (61%), #Int= 6, #Iso= 21
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 2
B: Alloc=317/800 us (40%), #Int= 6, #Iso= 21
so I guess that explains why I can't run both C910s. The odd thing is that
the allocation stays the same even if I drop the frame size to 160x120.
Or is that normal and the camera always uses the same bandwidth regardless
of what is requested from it?
It depends a bit on the firmware of the camera and the driver. For
uncompressed formats uvcvideo has some quirks documented on
http://www.ideasonboard.org/uvc/faq/ . Of particular interest is 0x80
(UVC_QUIRK_FIX_BANDWIDTH).

I don't have with me the results of the tests I did earlier last year
but from what I remember with the C920 the amout allocated was not
always proportional to frame size (say, 1024x576 would request 40% and
640x480 61%. I made up those numbers)

Loading...