

This is the type of transfer that’s typically used by devices that stream time-sensitive information as the USB protocol provides a guaranteed allocation of bandwidth with bounded latency. Let’s start with figuring out how much bandwidth is available, let’s assume USB2.0 Hi-Speed – even though its maximum bandwidth is 480 Mbps, only 196 Mbps of this is available for isochronous transfers per device. It has good reason to take this viewpoint though in practice there is enough bandwidth for both. The reason the kernel reports failure is because it thinks there isn’t enough bandwidth on the USB bus to support both of these camera streams at once. uvcvideo: USB isochronous frame lost (-63). uvcvideo: Allocated 5 URB buffers of 32x3060 bytes each. uvcvideo: Selecting alternate setting 11 (3060 B/frame bandwidth). uvcvideo: Device requested 3060 B/frame bandwidth. uvcvideo: Setting frame interval to 1/25 (400000). uvcvideo: Using default frame interval 40000.0 us (25.0 fps). This time when we run our second GStreamer pipeline we see the following relevant debug: $ dmesg This command will result in lots more debug in dmesg.

Linux uvc camera control driver#
To get a better understanding of the problem we can turn on trace debug of the UVC driver module, we can do this without rebuilding as follows: $ echo 0xffff > /sys/module/uvcvideo/parameters/trace
Linux uvc camera control iso#
In the case of an XHCI host controller you may see a “ Not enough bandwidth for new device state” error and for EHCI an “ iso sched full” error. The source of the error originates from the USB host controller driver (usually in response to a VIDIOC_STREAMON ioctl) and is usually in the form of an ENOSPC / -28 / “ No space left on device” error.
Linux uvc camera control software#
The precise error you’ll see in userspace depends on the software you use (it’s not a GStreamer issue).

sys/v4l2/gstv4l2src.c(662): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:Īnd it goes bang. uvcvideo: Failed to submit URB 0 (-28).ĮRROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. dwc2 b: DWC OTG HCD URB Enqueue failed adding QTD. dwc2 b: dwc2_do_reserve: Insufficient periodic bandwidth for periodic transfer No problems there, whilst that’s still running let’s now start another GStreamer pipeline for the other camera, at the same resolution: $ Setting pipeline to PAUSED. Pipeline is live and does not need PREROLL. To reproduce the problem, we’ll use GStreamer to stream MJPEG from one of our cameras at its lowest resolution: $ gst-launch-1.0 -e v4l2src device=/dev/video0 ! "image/jpeg, width=320, height=240, framerate=25/1" ! fakesink & For this blog post we’ve reproduced the problem with a Raspberry Pi and a couple of USB web cameras which we found on Amazon. In our quest to provide a solution we learnt a little about USB and so we thought we’d share our new found knowledge here.
