On 27/08/10 15:14, Martin wrote:
> The problem:
> 
> From reading around this list and elsewhere, it appears that you simply
> cannot run more than one webcam video stream per USB root hub.
> 
> When enabled for video streaming, the webcam reserves the full
> isochronous bandwidth needed to stream data at the selected resolution
> and framerate, regardless...

Kindly, a direct reply suggested:

####
...the only way I've managed to get multiple cameras working was by
using the mjpeg format. I've got this way working 3 cameras at 10fps
640x480 resolution on same root usb hub - and it looked like I might be
able to get a fourth one. I would suggest you start by checking the
specs for your cameras - if they are supposed to support mjpeg.

Don't know how you are trying to get them working on mjpeg, but I used
the command:

ffmpeg -vcodec mjpeg -f video4linux2 -r 10 -s 640x480 -i /dev/video0
ouputfile.ext

The '-vcodec mjpeg' has to go in front of the '-i' option in order to
request the stream in mjpeg format from the camera - after the '-i' it
will merely convert the stream to mjpeg.
####

Tried that and a few variations... Although the mjpeg streaming is
accepted, there is no output. I've had the same non-result with other
applications I've tried for getting a mjpeg stream from the WV060 webcam
and the uvcvideo driver.


> *A possible solution* ?
> 
> Instead, could the UVC driver 'simulate' a reduced framerate by instead
> using the "STILL_IMAGE_FRAME" mode of the webcam and grab for itself a
> set number of images per second? Or even only when polled by a read from
> the user application?
> 
> On *nix, "everything is a file"... Could the uvc driver accept reading
> of /dev/videoX by the command "cp" so that still image data is copied,
> formatted for a jpg or png?
> 
> Could the "quirks" setting be abused to set the image grab rate? Or some
> other neater method?

That still looks to be the best solution. The webcam is supposed to
support still image capture, but how do I do that?! Is there a nice
little snippet of C code that I can compile to grab a still image to a
jpg or png?


A gruesome work-around that does work is to use old USB 1.1 hubs to
force the WC060 to a lower data rate. You can then have many webcams
connected to your system! However...

The WC060 reduces the maximum resolution to 640x480 rather than reduce
the framerate. Quite a waste for the 1600x1200 that it supports;

The USB 1.1 hubs must be plugged directly into the USB 2.0 root hub for
a USB 1.1 root hub to be allocated (or for the UVC driver to work?);

Use "lsusb -t" and "lsusb -v" to see what is happening.


The USB 1.1 hubs that I picked up for very cheap correctly announce
themselves as USB 1.1 but have a product name of "USB hub 2.0". Very
Marketing-esq nasty!

eg:

Bus 003 Device 002: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub /
D-Link DUB-H4 USB 2.0 Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0         8
  idVendor           0x05e3 Genesys Logic, Inc.
  idProduct          0x0606 USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
  bcdDevice            7.02
  iManufacturer           1 ALCOR
  iProduct                2 USB Hub 2.0


Note: "Full speed" = USB 1.1 and "High speed" = USB 2.0 ... Hence,
despite the confusing "2.0" in the descriptors, it is actually USB 1.1.



Is the UVC driver still being developed? Are there features support yet
to be added?

Or is all this a problem of the user-side application software?


Regards,
Martin



> Further details:
> 
> I'm trying to use two webcams simultaneously:
> 
>   iManufacturer           1 Sweex
>   iProduct                2 WC060 Series HD Webcam
> 
> 
> On separate hubs, they work fine. On the same hub, the second one to
> start shows the error:
> 
> "Error starting stream VIDIOC_STREAMON: No space left on device".
> 
> I've only got the one root hub on the system I want to use for the two
> webcams!
> 
> 
> Their descriptors show:
> 
>         bFrameIntervalType                  2
>         dwFrameInterval( 0)           2000000
>         dwFrameInterval( 1)           4000000
> 
> 
> Can I tweak the UVC driver to preferentially choose the slower frame
> rate available?
> 
> Aside: The MJPG format doesn't seem to work, nor are any compression
> settings visible...
> 
> 
> Given a few hints or a patch, I can hack the kernel module to test :-)
> 
> This is running on Gentoo, kernel 2.6.34 using the in-kernel uvc module.
> 
> Any comment/ideas welcomed.
> 
> Regards,
> Martin
> 
> 
> 
> 
> From lsusb -v (excerpt):
> 
> VideoStreaming Interface Descriptor:
>         bLength                            34
>         bDescriptorType                    36
>         bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
>         bFrameIndex                         9
>         bmCapabilities                   0x00
>           Still image unsupported
>         wWidth                           1600
>         wHeight                          1200
>         dwMinBitRate                   768000
>         dwMaxBitRate                196608000
>         dwMaxVideoFrameBufferSize     3840000
>         dwDefaultFrameInterval        2000000
>         bFrameIntervalType                  2
>         dwFrameInterval( 0)           2000000
>         dwFrameInterval( 1)           4000000
> VideoStreaming Interface Descriptor:
>         bLength                            42
>         bDescriptorType                    36
>         bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)
>         bEndpointAddress                    0
>         bNumImageSizePatterns               9
>         wWidth( 0)                        640
>         wHeight( 0)                       480
>         wWidth( 1)                        352
>         wHeight( 1)                       288
>         wWidth( 2)                        320
>         wHeight( 2)                       240
>         wWidth( 3)                        176
>         wHeight( 3)                       144
>         wWidth( 4)                        160
>         wHeight( 4)                       120
>         wWidth( 5)                        800
>         wHeight( 5)                       600
>         wWidth( 6)                       1280
>         wHeight( 6)                       960
>         wWidth( 7)                       1280
>         wHeight( 7)                      1024
>         wWidth( 8)                       1600
>         wHeight( 8)                      1200
>         bNumCompressionPatterns             9

_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to