Thread: [Linux-uvc-devel] Test of the driver on GNU/Debian amd64
Linux UVC driver and tools
Brought to you by:
pinchartl
From: <Oli...@id...> - 2006-01-04 14:32:24
Attachments:
signature.asc
uvc_v4l2_read.patch
|
Hello, first, I'm happy to see the support of the new Logitech webcams under Linux... Even if this is not coming from Logitech itself. (I think it's an error from Logitech to not making some opensource drivers for their products, like for example Intel started with their ipw2100/2200 wifi cards). My quick first tests are done on a GNU/Debian amd64 system (testing). At this time, the kernel is linux-image-2.6.13-1-amd64-k8 version 2.6.13-1. linux-uvc is revision 3 from svn trunk. One remark: the info on the berlios page http://developer.berlios.de/svn/?group_id=5681 is not correct for downloading the project. Instead of doing: svn checkout svn://svn.berlios.de/linux-uvc/trunk as described, I have done: svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk Maybe a small re-organisation of the svn tree will be great ? (to have directly trunk instead of linux-uvc/trunk). This will help users to download the tree with the berlios instructions. Build was ok, with just one warning: /home/speech/bornet/devel/work/misc/uvc/trunk/uvcvideo.c:2190: warning: initialization from incompatible pointer type Attached patch uvc_v4l2_read.patch correct this warning. Installing don't put the module in the right directory, but I think this is more related to GNU/Debian. (install in /lib/modules/2.6.13/ instead of /lib/modules/2.6.13-1-amd64-k8/). Loading the driver seems OK: <6>usbcore: registered new driver usbvideo <6>USB Video Class driver (v0.1.0) plugging the cam (a QuickCam fusion): <7>usbvideo: Probing device 5 <7>Format MJPEG found <7>Format Uncompressed found <7>usbvideo: Found a Status endpoint (addr 87). <7>usbvideo: Found UVC device (1.00) <7>usbvideo: Scanning UVC chain: OT 5 <- Unit 4 <- Unit 3 <- Unit 2 <- IT 1 <7>usbvideo: Found a valid video chain (1 -> 5). <3>40:3:1: cannot set freq 0 to ep 0x86 <4>40:3:3: cannot get freq at ep 0x86 Then, I have try to access the camera with camstream, without success: CVideoDevice::CVideoDevice() could not query capabilities; is this really a video device? Accessing the camera with OpenCV (http://sourceforge.net/projects/opencvlibrary/) also cause problems... I'm now debugging these problems, because I want to use these camera with OpenCV. I will keep you informed on the progress. But to be sure that the webcam and driver is starting to work, could you please give me a pointer to a user program working with it ? Thanks in advance, and thanks a lot for starting this driver. Olivier -- . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: Laurent P. <lau...@sk...> - 2006-01-04 15:03:22
|
Hi Olivier, first of all, thanks for your interest in the project, and thanks for your patch. It has been applied to SVN. > first, I'm happy to see the support of the new Logitech webcams under > Linux... Even if this is not coming from Logitech itself. (I think it's > an error from Logitech to not making some opensource drivers for their > products, like for example Intel started with their ipw2100/2200 wifi > cards). I've contacted Logitech a few months ago, and they were very interested in the project. Linux is clearly a market they can't ignore anymore, but they currently don't have development resources to assign to Linux drivers development. They offered their help and are very supportive. > linux-uvc is revision 3 from svn trunk. One remark: the info on the > berlios page http://developer.berlios.de/svn/?group_id=5681 is not > correct for downloading the project. Instead of doing: > > svn checkout svn://svn.berlios.de/linux-uvc/trunk > > as described, I have done: > > svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk > > Maybe a small re-organisation of the svn tree will be great ? (to have > directly trunk instead of linux-uvc/trunk). This will help users to > download the tree with the berlios instructions. I created a linux-uvc directory on purpose, as the project is very likely to release more software soon (sample SDL V4L2 viewer for instance, or patches for software like usbutils, GnomeMeeting or Kopete). I planned to organise SVN in way similar to this : linux-uvc linux-uvc (Kernel driver) branches tags trunk uvcview-sdl (SDL-based UVC viewer) branches tags trunk uvcview-qt (Qt-based UVC viewer) branches tags trunk patches (Patches for GnomeMeeting, Kopete, ...) If that's not a good idea, feel free to kick me :-) > Build was ok, with just one warning: > > /home/speech/bornet/devel/work/misc/uvc/trunk/uvcvideo.c:2190: > warning: initialization from incompatible pointer type > > Attached patch uvc_v4l2_read.patch correct this warning. Applied. > Installing don't put the module in the right directory, but I think this > is more related to GNU/Debian. (install in /lib/modules/2.6.13/ instead > of /lib/modules/2.6.13-1-amd64-k8/). I'm developping on a Gentoo box, and the module is installed in the correct location. If there's an easy way to fix the Debian problem without breaking other distributions, feel free to send a patch. > Loading the driver seems OK: [...] > Then, I have try to access the camera with camstream, without success: > > CVideoDevice::CVideoDevice() could not query capabilities; is this > really a video device? camstream uses the deprecated V4L1 API, and the UVC driver only support V4L2. > Accessing the camera with OpenCV > (http://sourceforge.net/projects/opencvlibrary/) also cause problems... Same problem. > I'm now debugging these problems, because I want to use these camera > with OpenCV. I will keep you informed on the progress. You will have to implement V4L2 support in OpenCV. > But to be sure that the webcam and driver is starting to work, could you > please give me a pointer to a user program working with it ? Here is a (very) basic test program which saves 100 frames to disk. You can change the resolution and format by modifying video_set_format (the camera supports V4L2_PIX_FMT_YUYV and V4L2_PIX_FMT_MJPEG). An SDL-based front-end will probably be added to the SVN repository in a few weeks time. > Thanks in advance, and thanks a lot for starting this driver. You're welcome. Laurent Pinchart |
From: <Oli...@id...> - 2006-01-04 15:37:18
Attachments:
signature.asc
|
Hi Laurent, > I've contacted Logitech a few months ago, and they were very > interested in the project. Linux is clearly a market they can't ignore > anymore, but they currently don't have development resources to assign > to Linux drivers development. They offered their help and are very > supportive. Cool. It's a good start. Hope they have given some webcams to you. :-) > I created a linux-uvc directory on purpose, as the project is very likely to > release more software soon (sample SDL V4L2 viewer for instance, or patches > for software like usbutils, GnomeMeeting or Kopete). I planned to organise > SVN in way similar to this : > > linux-uvc > linux-uvc (Kernel driver) > branches > tags > trunk > uvcview-sdl (SDL-based UVC viewer) > branches > tags > trunk > uvcview-qt (Qt-based UVC viewer) > branches > tags > trunk > patches (Patches for GnomeMeeting, Kopete, ...) > > If that's not a good idea, feel free to kick me :-) No, it's a good idea... Maybe just add linux-uvc/trunk directly, which will include all the "sub-projects". So, you will have something like this: linux-uvc trunk linux-uvc (a link to linux-uvc/linux-uvc/trunk) uvcview-sdl (a link to linux-uvc/uvcview-sdl/trunk) uvcview-qt (a link to linux-uvc/uvcview-qt/trunk) patches (a link to linux-uvc/patches) linux-uvc branches tags trunk uvcview-sdl branches tags trunk uvcview-qt branches tags trunk patches After that, you can retrieve the full tree using the berlios instructions. > > Attached patch uvc_v4l2_read.patch correct this warning. > > Applied. Great. :-) > I'm developping on a Gentoo box, and the module is installed in the correct > location. If there's an easy way to fix the Debian problem without breaking > other distributions, feel free to send a patch. It's not a big problem for me at this time... Maybe I will look at it in the future... > > Then, I have try to access the camera with camstream, without success: > > > > CVideoDevice::CVideoDevice() could not query capabilities; is this > > really a video device? > > camstream uses the deprecated V4L1 API, and the UVC driver only support V4L2. OK. So, no camstream. > > Accessing the camera with OpenCV > > (http://sourceforge.net/projects/opencvlibrary/) also cause problems... > > Same problem. > [...] > You will have to implement V4L2 support in OpenCV. OpenCV has support for both V4L1 and V4L2 since mid September 2005... But it has maybe some problems with the implementation. (I have just found one now...). The main problem with OpenCV is the support for V4L2_PIX_FMT_YUYV and V4L2_PIX_FMT_MJPEG. These formats are not supported at this time. The supported formats are V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_YVU420, V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_YUV411P, V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SN9C10X. I will see if I can add V4L2_PIX_FMT_YUYV and/or V4L2_PIX_FMT_MJPEG to OpenCV now. > Here is a (very) basic test program which saves 100 frames to disk. Works OK. Thanks. Thanks for your help. Olivier -- . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: Olivier B. <Oli...@id...> - 2006-01-04 15:40:17
Attachments:
signature.asc
|
Hoops... On Wed, Jan 04, 2006 at 03:37:40PM +0100, Olivier Bornet wrote: > The main problem with OpenCV is the support for V4L2_PIX_FMT_YUYV and > V4L2_PIX_FMT_MJPEG. These formats are not supported at this time. The > supported formats are V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_YVU420, > V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_YUV411P, V4L2_PIX_FMT_SBGGR8, > V4L2_PIX_FMT_SN9C10X. wrong... V4L2_PIX_FMT_YUYV is _not_ supported. Supported are V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_YVU420, V4L2_PIX_FMT_YUV411P, V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SN9C10X. (copy-paste error...). Olivier -- . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: Olivier B. <Oli...@id...> - 2006-01-04 17:34:44
Attachments:
signature.asc
|
Hello again, > > > Accessing the camera with OpenCV > > > (http://sourceforge.net/projects/opencvlibrary/) also cause problems... > > > > Same problem. > > [...] > > You will have to implement V4L2 support in OpenCV. > > OpenCV has support for both V4L1 and V4L2 since mid September 2005... > But it has maybe some problems with the implementation. (I have just > found one now...). OpenCV is now working with the uvc driver. I have implemented support of V4L2_PIX_FMT_YUYV in OpenCV. Feel free to checkout the CVS of OpenCV if you want to try it. I don't know why, but it seems changing the size of the capture don't works. I always have a capture of 1024x576 pixels. Even if I try to set to another size, like for example 640x480. This must be a problem with OpenCV, as it seems your test program is changing the resolution correctly (altough I don't have look at the output files, because I don't know how to display yuyv raw data images...). Any way, thanks a lot for the driver. It's starting on the right way. Have a nice evening. Olivier -- . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: Laurent P. <lau...@sk...> - 2006-01-04 18:55:03
|
> OpenCV is now working with the uvc driver. I have implemented support of > V4L2_PIX_FMT_YUYV in OpenCV. Feel free to checkout the CVS of OpenCV if > you want to try it. Good work. While you're at it, you can also implement MJPEG support ;-) I recently posted a patch to the video4linux and qt-interest mailing lists to add MJPEG support to Qt, it can be used as a starting point. > I don't know why, but it seems changing the size of the capture don't > works. I always have a capture of 1024x576 pixels. Even if I try to set > to another size, like for example 640x480. This must be a problem with > OpenCV, as it seems your test program is changing the resolution > correctly (altough I don't have look at the output files, because I > don't know how to display yuyv raw data images...). That's normal. The minimum size for YUYV capture is 1024x576. Lower resolutions are only available in MJPEG. I'll ask Logitech if they can enable YUYV in lower resolutions in their firmware updates. > Any way, thanks a lot for the driver. It's starting on the right way. You're welcome. I'm glad people are interested in UVC. Thanks for getting involved. Laurent Pinchart |
From: <Oli...@id...> - 2006-01-05 15:39:01
Attachments:
signature.asc
|
Hello, On Wed, Jan 04, 2006 at 06:56:15PM +0100, Laurent Pinchart wrote: > > OpenCV is now working with the uvc driver. I have implemented support of > > V4L2_PIX_FMT_YUYV in OpenCV. Feel free to checkout the CVS of OpenCV if > > you want to try it. > > Good work. While you're at it, you can also implement MJPEG support ;-) I > recently posted a patch to the video4linux and qt-interest mailing lists to > add MJPEG support to Qt, it can be used as a starting point. Thanks for the tip. OpenCV is now supporting MJPEG. :-) So, now with OpenCV (and the UVC driver), you can: - load a image file of format MJPEG, - use V4L2_PIX_FMT_MJPEG format for video acquisition. The patch you have posted to the video4linux mailing list was helpful. > > I don't know why, but it seems changing the size of the capture don't > > works. I always have a capture of 1024x576 pixels. Even if I try to set > > to another size, like for example 640x480. This must be a problem with > > OpenCV, as it seems your test program is changing the resolution > > correctly (altough I don't have look at the output files, because I > > don't know how to display yuyv raw data images...). > > That's normal. The minimum size for YUYV capture is 1024x576. Lower > resolutions are only available in MJPEG. I'll ask Logitech if they can enable > YUYV in lower resolutions in their firmware updates. With V4L2_PIX_FMT_MJPEG, resolution switching works. Cool. :-) Thanks for your suggestions. Olivier -- . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: Laurent P. <lau...@sk...> - 2006-01-05 16:01:40
|
> Thanks for the tip. OpenCV is now supporting MJPEG. :-) > So, now with OpenCV (and the UVC driver), you can: > - load a image file of format MJPEG, > - use V4L2_PIX_FMT_MJPEG format for video acquisition. > > The patch you have posted to the video4linux mailing list was helpful. Great ! That will be very helpful (I plan to use OpenCV for a robotic project in the near future). Are the changes commited to OpenCV CVS ? > With V4L2_PIX_FMT_MJPEG, resolution switching works. Cool. :-) Resolution switching works with YUYV too, but only two resolutions are available (1024x576 and 1280x960). That's a device limitation, not a driver issue. > Thanks for your suggestions. You're welcome. Laurent Pinchart |
From: <Oli...@id...> - 2006-01-05 16:09:56
Attachments:
signature.asc
|
Hi Laurent, > Great ! That will be very helpful (I plan to use OpenCV for a robotic project > in the near future). Are the changes commited to OpenCV CVS ? Great. :-) Yes, the changes are commited... But maybe the anonymous CVS of SF is not in-sync now. Don't remember if the sync is done each hour or each 4 hours. Olivier -- . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |