On Monday 09 November 2009 00:04:36 Paulo Assis wrote: > Hi, > I tested this in my system and was able to grab two simultaneous YUYV > 1600x1...@5fps video streams. > The cameras are two different uvc logitech models connected to two > separate usb controllers, my board has plenty of them :) > Connecting both cameras to the same controler (e.g. the two front > ports) will cause the second stream to fail. > > I don't know about windows since I don't use it, but are you sure you > aren't getting a zoomed (1600x1200) image from a lower resolution? > maybe the windows driver is playing a trick on you.
That's one possibility. If I remember correctly Windows might be violating the USB spec by allowing devices to use more than 80% of the available bandwidth for periodic (isochronous and interrupt) transfers. Or it might calculate the bandwith slightly differently than Linux. In any case, the problem under Linux comes from the fact that the USB core rejects the uvcvideo driver's request to allocate bandwidth for the second camera because not enough bandwidth is available. The uvcvideo driver can't do much about it. Now, the camera might lie about the bandwidth it really requires, and it might be possible to hack the driver to request less bandwidth and still get away with it. I have some doubts that this would work though, but it might be worth a try. As you've written your own userspace software I assume you're familiar with C programming so I'll just give you a few pointers to hack on the driver :-) USB bandwidth allocation is done in the uvc_init_video() function (uvc_video.c) by a call to usb_set_interface(). You can check which alternate setting the driver requests by printing the value of variable 'i'. A look at the camera's USB descriptors (lsusb -v) will show you a list of alternate settings for the video streaming interface. Each alternate setting has different packet sizes for the isochronous endpoint. Locate the alternate setting with the biggest packet size below the one requested by the driver, and modify uvc_init_video() to hardcode that alternate setting. If that's still too much bandwidth, repeat the procedure until you can start streaming on both cameras. The driver will then probably get corrupted data (lost packets), but it could be worth a try. > BTW with some new camera models that support MJPG in high resolution > you should able to squeeze two MJPG 1600x1...@10fps video streams from > the same usb controller. -- Regards, Laurent Pinchart _______________________________________________ Linux-uvc-devel mailing list Linux-uvc-devel@lists.berlios.de https://lists.berlios.de/mailman/listinfo/linux-uvc-devel