Not enough bandwidth Error when capturing from two USB 2.0 cameras


#1

Hi. I set up two USB cameras on the dragonboard 820C like as 1920/1080, H264 pixelformat. I can stream either of the two camera sucessfully. I used the v4l2-ctl to stream:
sudo v4l2-ctl -d /dev/video3 --stream-mmap=4
sudo v4l2-ctl -d /dev/video2 --stream-mmap=4

If I try to stream both cameras at the same time, then I get these error messages in the dmesg log:

[ 3061.336547] usb 3-1.2.2: Not enough bandwidth for new device state.
[ 3061.336583] usb 3-1.2.2: Not enough bandwidth for altsetting 11

These are the settings for each of the usb cameras:

root@linaro-alip:~# sudo v4l2-ctl --get-fmt-video -d /dev/video2
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : ‘H264’ (H.264)
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
root@linaro-alip:~# sudo v4l2-ctl --get-fmt-video -d /dev/video3
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : ‘H264’ (H.264)
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
root@linaro-alip:~#

Using a pixelformat of ‘MJPG’ causes the same errors as above. Can someone tell me what these error messages mean? Is it really a bandwidth issue with the compressed formats MJPG and H264?

Thanks,
Kim


#2

So… three things:

  1. The SoC has only one USB3 controller and that the external sockets are connected via an internal USB3 hub. In other words both camera are connected to a single USB controller.
  2. USB3 hubs only use the extra bandwidth available for transfers from USB3 peripherals. For USB2 devices the hub will act just like a USB2 hub (with all the bandwidth limits normal for USB2).
  3. Webcams are very often buggy and make excessive bandwidth requests (basically they reserve the bandwidth needed for uncompressed pictures even when the actually send compressed pictures).

You’ll probably see exactly the same behaviour if you connect both cameras via a hub to any GNU/Linux workstation! See https://www.96boards.org/documentation/consumer/guides/multi-usb-camera.md.html for links to potential work arounds.


#3

I thought that the SD820 had 2 HS ports, and that one was routed to the hub and the other to the uUSB device port. If I’m remembering correctly, then it should be possible to put one of the camera on the uUSB.


#4

SD820 has a USB2 host controller and a USB3 host controller. However on DB820C the USB2 host controller is connected to a microB port (J4) without any OTG wiring (no ID pin, no capacity to provide power) making it device only.

With device tree changes and some home brew cabling (same sort of thing used to bring USB host mode to devices such as Nexus 4) I believe it is possible to run J4 in host-only mode instead… but assuming the problem is a buggy web cam then alternative workarounds are much simpler.


#5

Hi Danielt,

Changing the framerate did make a difference, so I am probably running into your #3.
Thanks for the response,
Kim