ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

usb_cam vidioc_streamon error 28

asked 2012-01-10 06:34:53 -0500

baseballmvp27 gravatar image

When I try to open up two video streams, I am getting an error stating that there is no space left on the device.

I know this is due to the bandwidth limitations of two cameras on one USB hub. I tried to lower the resolution of each camera, but this didn't help.

Did anybody use stereovision and successfully get two cameras to stream simultaneoulsy within ROS?

I am using usb_cam, but publishing two different topics.


edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-03-07 18:37:49 -0500

brice rebsamen gravatar image

I had the same problem and solved it as follow:

sudo rmmod uvcvideo
sudo modprobe uvcvideo quirks=128

After doing that, I can acquire images from 2 cameras at the same time. Credits: Checkout this link to see how to add this to your module conf so that changes become permanent.

However, using OpenCV to acquire images from the webcam still does not work. But using the usb_cam pkg, everything is fine.

edit flag offensive delete link more

answered 2012-01-11 18:54:21 -0500

fergs gravatar image

Unfortunately, your particular camera model may not work for this. USB devices must specify interface descriptors, and camera manufacturers often pick a terrible set of descriptor parameters that don't actually reflect the bandwidth saved by downsizing the image. If you run 'lsusb -v', you can search for the camera, and often find a number of things like:

Interface Descriptor:
  bLength                 9
  bDescriptorType         4
  bInterfaceNumber        1
  bAlternateSetting       4
  bNumEndpoints           1
  bInterfaceClass        14 Video
  bInterfaceSubClass      2 Video Streaming
  bInterfaceProtocol      0 
  iInterface              0 
  Endpoint Descriptor:
    bLength                 7
    bDescriptorType         5
    bEndpointAddress     0x82  EP 2 IN
    bmAttributes            5
      Transfer Type            Isochronous
      Synch Type               Asynchronous
      Usage Type               Data
    wMaxPacketSize     0x1400  3x 1024 bytes
    bInterval               1

If there isn't an appropriately-sized descriptor (one which is both large enough to handle your video stream, but small enough that 2 of them will not overload the bus), then the call to open fails. There are basically 3 things you can do about this:

  1. Get each camera on a separate USB bus (this may be as simple as moving which ports they are plugged into, but it may also be impossible on your current computer).
  2. Buy a different set of cameras, which have better choices for frame size.
  3. Hack the usb driver (very advanced and not recommended). The reality is that the USB bus bandwidth calculation is based on the overly-sized estimate from the device, and is already leaving some extra bandwidth, and so you could probably hack the driver to always go ahead with the opening the endpoint even though the check fails. Before I started using the Kinect, I did do a bit of looking around at this (there is a usb video driver forum which has a lot of information), but decided that replacing the cameras with different ones was the easier approach.
edit flag offensive delete link more


same problem here. I would go for suggestion 2, but what to look for exactly when buying the cameras? (there is typically not that much info on the box ...)

brice rebsamen gravatar image brice rebsamen  ( 2012-03-05 19:39:45 -0500 )edit

A workaround is to open camera 1, grab, close, open camera 2, grab, close, and so on. There are 2 problems though: frame rate is about 1-2 fps, and the white balance mechanism does not work, resulting in a yellow image...

brice rebsamen gravatar image brice rebsamen  ( 2012-03-06 20:37:51 -0500 )edit

answered 2012-01-12 04:16:37 -0500

baseballmvp27 gravatar image

This didn't work.

<lsusb> shows two buses- 001 and 002.

When I plug in both cameras, they both go on 002.

I manually went into /dev/bus/usb/ and moved the second camera from usb bus 002 to usb bus 001, but it still didn't work. same error.

edit flag offensive delete link more


You can't just "move" the cameras from one bus to the other my moving the files around. The bus is determined by which physical port they are plugged into - /dev/* is just reporting where things are plugged in - moving the /dev/* files around doesn't changed where the camera is plugged into.
Eric Perko gravatar image Eric Perko  ( 2012-01-12 04:55:06 -0500 )edit
yea... i figured that out the hard way! i need to figure this out though. any suggestions?
baseballmvp27 gravatar image baseballmvp27  ( 2012-01-12 08:38:59 -0500 )edit

Question Tools


Asked: 2012-01-10 06:34:53 -0500

Seen: 6,404 times

Last updated: Mar 07 '12