2

When I try to capture video from two usb (uvc) cameras connected on a single usb port, there is an error:

libv4l2: error turning on stream: No space left on device
Unable to start capture: No space left on device

I know this is a known issue; sometimes this is because there is no bandwidth left on the usb port, and sometimes we can solve this by sudo rmmod uvcvideo; sudo modprobe uvcvideo quirks=128 commands.

However I found that on almost the same condition (USB 2, two same camera devices), we can get video stream on some machines, and we cannot do on some machines. The below is my investigation. I want to know why they happen, and more interestingly, how to stream from two or more cameras in general.

Experiments:

Cameras I used: ELP-USBFHD01M-L180
Output of v4l2-ctl --list-formats-ext (we use only 320x240; other resolutions are omitted):

ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : Motion-JPEG
            Size: Discrete 320x240
                    Interval: Discrete 0.008s (120.101 fps)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUYV 4:2:2
            Size: Discrete 320x240
                    Interval: Discrete 0.033s (30.000 fps)

Machines:

  • Thinkpad T440p, Ubuntu 14.04.5, USB 2
  • Odroid XU4, Ubuntu 16.04.2, USB 3
  • Raspberry Pi 3B, Ubuntu 16.04, USB 2

Method: On each machine, executing mjpg-streamer in YUYV mode or MJPG mode for one or two cameras.

Result:

  • Thinkpad T440p, Ubuntu 14.04.5, USB 2
    • two cameras 320x240 YUYV worked at at 30 fps.
    • one camera 320x240 MJPG worked at at 67 fps.
    • two cameras 320x240 MJPG did not work.
  • Odroid XU4, Ubuntu 16.04.2, USB 3
    • two cameras 320x240 YUYV worked at at 30 fps.
    • one camera 320x240 MJPG worked at at 69 fps.
    • two cameras 320x240 MJPG did not work.
  • Raspberry Pi 3B, Ubuntu 16.04, USB 2
    • two cameras 320x240 YUYV worked at at 30 fps.
    • two cameras 320x240 MJPG worked at at 65 fps.

So, on Raspberry Pi 3B, we could stream video from two cameras in MJPG mode at 60+ FPS, while we could not do that on the other machines due to the "No space left on device" error.

I want to know why, and how to make this available on the other machines (Thinkpad, Odroid).

According to this question, I checked:

cat /sys/kernel/debug/usb/devices | grep "B: "

when streaming from the cameras.

Result:

Thinkpad T440p, Ubuntu 14.04.5, USB 2

no camera

3:B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
56:B:  Alloc=  0/800 us ( 0%), #Int=  3, #Iso=  0

two cameras 320x240 YUYV worked at at 30 fps.

3:B:  Alloc=512/800 us (64%), #Int=  4, #Iso= 10
113:B:  Alloc=  0/800 us ( 0%), #Int=  3, #Iso=  0

one camera 320x240 MJPG worked at at 67 fps.

3:B:  Alloc=488/800 us (61%), #Int=  3, #Iso=  5
113:B:  Alloc=  0/800 us ( 0%), #Int=  3, #Iso=  0

Odroid XU4, Ubuntu 16.04.2, USB 3

no camera

B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc= 39/900 us ( 4%), #Int=  2, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0

two cameras 320x240 YUYV worked at at 30 fps.

B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  9
B:  Alloc= 39/900 us ( 4%), #Int=  2, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0

one camera 320x240 MJPG worked at at 69 fps.

B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  5
B:  Alloc= 39/900 us ( 4%), #Int=  2, #Iso=  0
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0

Raspberry Pi 3B, Ubuntu 16.04, USB 2

no camera

B:  Alloc=-7151580/800 us (-893947%), #Int= -9, #Iso=-119193

two cameras 320x240 YUYV worked at at 30 fps.

B:  Alloc=-5395920/800 us (-674489%), #Int= -8, #Iso=-89932

two cameras 320x240 MJPG worked at at 65 fps.

B:  Alloc=-4363020/800 us (-545377%), #Int= -8, #Iso=-72717

Many thanks!
--Akihiko

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.