linux-uvc-devel Mailing List for linux-uvc (Page 355)
Linux UVC driver and tools
Brought to you by:
pinchartl
You can subscribe to this list here.
2006 |
Jan
(183) |
Feb
(152) |
Mar
(69) |
Apr
(65) |
May
(57) |
Jun
(38) |
Jul
(109) |
Aug
(77) |
Sep
(85) |
Oct
(72) |
Nov
(149) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(183) |
Feb
(143) |
Mar
(84) |
Apr
(120) |
May
(109) |
Jun
(68) |
Jul
(88) |
Aug
(150) |
Sep
(124) |
Oct
(182) |
Nov
(131) |
Dec
(175) |
2008 |
Jan
(195) |
Feb
(260) |
Mar
(167) |
Apr
(150) |
May
(101) |
Jun
(129) |
Jul
(245) |
Aug
(64) |
Sep
(72) |
Oct
(75) |
Nov
(152) |
Dec
(135) |
2009 |
Jan
(72) |
Feb
(93) |
Mar
(107) |
Apr
(35) |
May
(59) |
Jun
(127) |
Jul
(91) |
Aug
(73) |
Sep
(79) |
Oct
(82) |
Nov
(84) |
Dec
(104) |
2010 |
Jan
(61) |
Feb
(44) |
Mar
(81) |
Apr
(74) |
May
(50) |
Jun
(58) |
Jul
(31) |
Aug
(66) |
Sep
(83) |
Oct
(68) |
Nov
(61) |
Dec
(23) |
2011 |
Jan
(88) |
Feb
(81) |
Mar
(101) |
Apr
(95) |
May
(21) |
Jun
(147) |
Jul
(56) |
Aug
(121) |
Sep
(66) |
Oct
(54) |
Nov
(119) |
Dec
(50) |
2012 |
Jan
(54) |
Feb
(67) |
Mar
(24) |
Apr
(72) |
May
(134) |
Jun
(64) |
Jul
(105) |
Aug
(50) |
Sep
(38) |
Oct
(38) |
Nov
(53) |
Dec
(43) |
2013 |
Jan
(69) |
Feb
(15) |
Mar
(25) |
Apr
(14) |
May
(10) |
Jun
(13) |
Jul
(31) |
Aug
(30) |
Sep
(44) |
Oct
(12) |
Nov
(29) |
Dec
(19) |
2014 |
Jan
(18) |
Feb
(42) |
Mar
(25) |
Apr
(11) |
May
(20) |
Jun
(15) |
Jul
(2) |
Aug
(3) |
Sep
(10) |
Oct
(22) |
Nov
(27) |
Dec
(18) |
2015 |
Jan
(19) |
Feb
(17) |
Mar
(12) |
Apr
(10) |
May
(12) |
Jun
(22) |
Jul
(7) |
Aug
(12) |
Sep
(2) |
Oct
(16) |
Nov
(3) |
Dec
(30) |
2016 |
Jan
(19) |
Feb
(10) |
Mar
(20) |
Apr
(2) |
May
(3) |
Jun
(3) |
Jul
(4) |
Aug
(5) |
Sep
(14) |
Oct
(1) |
Nov
(7) |
Dec
(19) |
2017 |
Jan
(4) |
Feb
(4) |
Mar
(5) |
Apr
(3) |
May
(1) |
Jun
(8) |
Jul
(4) |
Aug
(7) |
Sep
|
Oct
(4) |
Nov
(7) |
Dec
(2) |
2018 |
Jan
(11) |
Feb
(5) |
Mar
(4) |
Apr
(6) |
May
(6) |
Jun
(4) |
Jul
(6) |
Aug
(2) |
Sep
(3) |
Oct
(6) |
Nov
|
Dec
(2) |
2019 |
Jan
(2) |
Feb
(10) |
Mar
(6) |
Apr
|
May
(6) |
Jun
(6) |
Jul
(2) |
Aug
(4) |
Sep
(2) |
Oct
(11) |
Nov
(1) |
Dec
(1) |
2020 |
Jan
(4) |
Feb
(1) |
Mar
(5) |
Apr
(19) |
May
(18) |
Jun
(5) |
Jul
(13) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
|
Dec
(1) |
2021 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(3) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(12) |
Dec
(1) |
2022 |
Jan
(2) |
Feb
(2) |
Mar
(6) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: James W. S. <js...@co...> - 2006-01-06 01:21:18
|
Laurent Pinchart wrote: >Hi James, > > > >>I have attempted to view images from the device without success. I have >>tried xawtv, tvtime and both do not receive images. Upon statup the LED >>momentarly lights, but that is about all. >> >> > >I tried xawtv in the past, but it hang due to a unrelated problem. I'll try >with tvtime. > > > >>In doing some additional analsyis I downloaded compiled then ran the test.c >>program you posted. It does access the camera but it tnen completly locks >>up the system. It appears to me that the Fedora 4 kernel has some >>differences than a stock kernel that is affecting how the driver functions. >> >> > >Can you run the test program in a virtual console (not under X) and see if you >get a kernel oops ? If so, please post the report. > >Laurent Pinchart >_______________________________________________ >Linux-uvc-devel mailing list >Lin...@li... >http://lists.berlios.de/mailman/listinfo/linux-uvc-devel > > > Laurent, I configured my system into runlevel 3. I successfully ran and stoppe your test program. |
From: Fondriest F. <la...@gm...> - 2006-01-05 21:46:45
|
just download the svn , compil and install on my gentoo box gcc-3.3.6 and linux-2.6.10 Trying to get some images with mplayer or amsn for now... from my logitech webcam :-) ---- kern.log Jan 5 21:42:03 pc kernel: USB Video Class driver (v0.1.0) Jan 5 21:42:22 pc kernel: usb 2-1: new full speed USB device using uhci_hcd and address 2 Jan 5 21:42:22 pc kernel: usbvideo: Probing device 1 Jan 5 21:42:22 pc kernel: Format MJPEG found Jan 5 21:42:22 pc kernel: usbvideo: Found a Status endpoint (addr 87). Jan 5 21:42:22 pc kernel: usbvideo: Found UVC device (1.00) Jan 5 21:42:22 pc kernel: usbvideo: Scanning UVC chain: OT 5 <- Unit 4 <- Unit 3 <- Unit 2 <- IT 1 Jan 5 21:42:22 pc kernel: usbvideo: Found a valid video chain (1 -> 5). Jan 5 21:42:22 pc kernel: usbvideo: UVC device initialized. Jan 5 21:42:33 pc kernel: usbvideo: Button event (1). Jan 5 21:42:33 pc kernel: usbvideo: Button event (0). Jan 5 21:42:35 pc kernel: usbvideo: Button event (1). Jan 5 21:42:35 pc kernel: usbvideo: Button event (0). Jan 5 21:45:24 pc kernel: usbvideo: uvc_v4l2_open ---- so now... need to read the usb doc and the source code :) -- ciberfred |
From: michel X. <m.x...@CR...> - 2006-01-05 16:19:18
|
hi here is the message from the patch from last night . First part are MJPG palette (working) second part YUYV palette (unworking) Jan 5 15:59:42 linux kernel: usbvideo: VIDIOC_S_FMT Jan 5 15:59:42 linux kernel: usbvideo: Trying format 0x47504a4d (MJPG): 960x720. Jan 5 15:59:43 linux kernel: usbvideo: VIDIOC_REQBUFS Jan 5 15:59:43 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:43 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:43 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:43 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:43 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:43 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:43 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:43 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:43 linux kernel: usbvideo: VIDIOC_STREAMON Jan 5 15:59:50 linux kernel: usbvideo: VIDIOC_STREAMOFF Jan 5 15:59:50 linux kernel: usbvideo: > uvc_v4l2_release Jan 5 15:59:50 linux kernel: usbvideo: < uvc_v4l2_release Jan 5 15:59:54 linux kernel: usbvideo: uvc_v4l2_open Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_QUERYCAP Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_S_FMT Jan 5 15:59:54 linux kernel: usbvideo: Trying format 0x56595559 (YUYV): 1024x576. Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_REQBUFS Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:54 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:54 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:54 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_QUERYBUF Jan 5 15:59:54 linux kernel: usbvideo: uvc_v4l2_mmap Jan 5 15:59:54 linux kernel: usbvideo: VIDIOC_STREAMON Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. Jan 5 15:59:55 linux kernel: Warning: FID bit has changed before end of frame. -- Michel Xhaard http://mxhaard.free.fr |
From: <Oli...@id...> - 2006-01-05 16:09:56
|
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 |
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: Laurent P. <lau...@sk...> - 2006-01-05 15:58:38
|
Hi Olivier, > what is the frame rate you have with the UVC driver ? I have only about > 7 fps with either the test program or OpenCV and UVC driver. Can I > change this ? For example, with pwc, we can switch the fps when loading > the kernel module. The frame rate should be selectable using VIDIOC_S_PARM, but that's currently not implemented. The V4L2 and UVC stream parameters negociation (pixel format, frame size, frame rate and compression quality) are not entirely compatible, I'm thus trying to find a way to solve the problem. Basically, UVC negociates streaming parameters by setting the pixel format and frame size first, then negociates frame rate and compression quality. V4L2 uses VIDIOC_S_PARM to set the frame rate and compression quality, and VIDIOC_S_FMT to negociate the format. My problem is that if the user selects a frame rate/compression quality before negociating the format (which is what V4L2 currently does), I will have no way to report a failure before format negociation, at which time compression quality/frame rate values might be changed by the driver without any notification to the user. The other issue is that V4L2 reports the maximum buffer size to the user when VIDIOC_S_FMT/VIDIOC_TRY_FMT are called, and I need the compression quality to compute the buffer size, so I can't report it there if the compression quality is changed after pixel format and frame size negociation. The easiest fix would be to modify V4L2 to negociate compression quality and frame rate after format negociation, but that would break backward compatibility, so it's probably not a valid solution. Laurent Pinchart |
From: Luc S. <lu...@sa...> - 2006-01-05 15:50:41
|
On Thu, Jan 05, 2006 at 03:42:06PM +0100, Olivier Bornet wrote: > Hello, > > what is the frame rate you have with the UVC driver ? I have only about > 7 fps with either the test program or OpenCV and UVC driver. Can I > change this ? For example, with pwc, we can switch the fps when loading > the kernel module. Or using the private field when setting the format ... struct v4l2_format *f = arg; compression = (f->fmt.pix.priv & PWC_QLT_MASK) >> PWC_QLT_SHIFT; snapshot = f->fmt.pix.priv & PWC_FPS_SNAPSHOT; fps = (f->fmt.pix.priv & PWC_FPS_FRMASK) >> PWC_FPS_SHIFT; Perhaps we can do the same ? I've haven't look how other webcam can do this. v4l2 can return the frame rate but we need to use one of the default standart (secam, pal, ...) Luc |
From: Laurent P. <lau...@sk...> - 2006-01-05 15:49:29
|
Hi James, > I have attempted to view images from the device without success. I have > tried xawtv, tvtime and both do not receive images. Upon statup the LED > momentarly lights, but that is about all. I tried xawtv in the past, but it hang due to a unrelated problem. I'll try with tvtime. > In doing some additional analsyis I downloaded compiled then ran the test.c > program you posted. It does access the camera but it tnen completly locks > up the system. It appears to me that the Fedora 4 kernel has some > differences than a stock kernel that is affecting how the driver functions. Can you run the test program in a virtual console (not under X) and see if you get a kernel oops ? If so, please post the report. Laurent Pinchart |
From: <Oli...@id...> - 2006-01-05 15:41:43
|
Hello, what is the frame rate you have with the UVC driver ? I have only about 7 fps with either the test program or OpenCV and UVC driver. Can I change this ? For example, with pwc, we can switch the fps when loading the kernel module. Have a nice day. 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: <Oli...@id...> - 2006-01-05 15:39:01
|
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: <jws...@co...> - 2006-01-05 15:27:12
|
I have attempted to view images from the device without success. I have tried xawtv, tvtime and both do not receive images. Upon statup the LED momentarly lights, but that is about all. In doing some additional analsyis I downloaded compiled then ran the test.c program you posted. It does access the camera but it tnen completly locks up the system. It appears to me that the Fedora 4 kernel has some differences than a stock kernel that is affecting how the driver functions. |
From: Laurent P. <lau...@sk...> - 2006-01-05 12:14:09
|
Hi James, > Here is`what I receive upon initial use of the UVC driver. > I have attached two files both are "dmesg' outputs. First upon plugging > in the camera > Second after trying xawtv And what is your problem exactly ? Laurent Pinchart |
From: James W. S. <jws...@co...> - 2006-01-05 05:07:25
|
Here is`what I receive upon initial use of the UVC driver. I have attached two files both are "dmesg' outputs. First upon plugging in the camera Second after trying xawtv Kernel 2.6.14-1.1653_FC4 #1 Tue Dec 13 21:32:09 EST 2005 i686 i686 i386 GNU/Linux Logitech 046d:08c3 /var/log/messages Jan 4 19:58:50 manycats kernel: usb 1-3: new high speed USB device using ehci_hcd and address 13 Jan 4 19:58:51 manycats kernel: 13:3:1: cannot set freq 0 to ep 0x86 Jan 4 19:58:52 manycats kernel: 13:3:2: cannot set freq 0 to ep 0x86 Jan 4 19:58:53 manycats kernel: 13:3:3: cannot get freq at ep 0x86 Ouput of x xawtv This is xawtv-3.95, running on Linux/i686 (2.6.14-1.1653_FC4) /dev/video0 [v4l2]: no overlay support v4l-conf had some trouble, trying to continue anyway ioctl: VIDIOC_G_STD(std=0xbfc37ad4 [PAL_G,PAL_I,PAL_D1,PAL_K,PAL_N,PAL_60,NTSC_M,NTSC_M_JP,?,SECAM_B,SECAM_D,SECAM_L,?ATSC_8_VSB,ATSC_16_VSB,(null),(null),(null),(null),(null),(null)]): Invalid argument ioctl: VIDIOC_S_CTRL(id=9963778;value=39): Input/output error ioctl: VIDIOC_S_STD(std=0x0 []): Invalid argument ioctl: VIDIOC_DQBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0 [];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=unknown): Invalid argument ioctl: VIDIOC_DQBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0 [];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=unknown): Invalid argument awtv on startup |
From: Laurent P. <lau...@sk...> - 2006-01-04 23:01:04
|
Hi Michel, > Just test the rev 4 with my HP zd8000 P4 64 bits 3Go with a smp kernel, > graphic card ATI Mobility X600 and the uvcview SDL grabber > the good news > the driver work fine with all jpeg/size > SDL yuv overlay never crash :) > the bad news : > driver return EIO on VIDIOC_DQBUF with all yuyv palette in my grabbing > routine. SDL open a black screen but did not crash the box :) > to be sure > tested with my Athlon 2200+ Nvidia card, all size/palette are working like > a charm . -EIO means that the buffer has been marked as erroneous. Either because the URB completion handler received more data than expected or because it received a non-zero status. Could you check dmesg to see if it prints a debug message ? If not, please have a look at uvc_video_complete and add printks to see where it fails. Laurent Pinchart |
From: michel X. <mx...@ma...> - 2006-01-04 22:47:13
|
Hi all, Just test the rev 4 with my HP zd8000 P4 64 bits 3Go with a smp kernel, graphic card ATI Mobility X600 and the uvcview SDL grabber the good news the driver work fine with all jpeg/size SDL yuv overlay never crash :) the bad news : driver return EIO on VIDIOC_DQBUF with all yuyv palette in my grabbing routine. SDL open a black screen but did not crash the box :) to be sure tested with my Athlon 2200+ Nvidia card, all size/palette are working like a charm . -- Michel Xhaard http://mxhaard.free.fr |
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: Olivier B. <Oli...@id...> - 2006-01-04 17:34:44
|
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: Olivier B. <Oli...@id...> - 2006-01-04 15:40:17
|
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: <Oli...@id...> - 2006-01-04 15:37:18
|
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: 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 14:32:24
|
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 13:12:03
|
Hi Luc, Thanks for your comments. I fixed the locking issue, added the missing static keywords and will add a counter to open() to temporarly fix the multiple open issue (I should implement multiple open support though). As for your other comments, I answered inline. > > /* > > * usbvideo.c -- USB Video Class driver > > * > > * Copyright (C) 2005 > > Now you can update the year :-) Done. Happy New Year :-) > union without name can't be build with gcc2.95 is it ok ? As long as I don't receive complains about it, yes :-) > > static int uvc_alloc_buffers(struct uvc_video_queue *queue, unsigned int > > nbuffers, unsigned int buflength) > > { > > unsigned int bufsize = PAGE_ALIGN(buflength); > > unsigned int i; > > void *mem = NULL; > > int ret; > > [...] > > for (i = 0; i < nbuffers; ++i) { > > memset(&queue->buffer[i], 0, sizeof queue->buffer[i]); > > queue->buffer[i].size = bufsize; > > queue->buffer[i].buf.index = i; > > queue->buffer[i].buf.m.offset = i * bufsize; > > Is any buffersize aligned on a page boudary ? Not sure to understand what you mean. bufsize is always page aligned as I initialized it to PAGE_ALIGN(buflength). > > static int uvc_dequeue_buffer(struct uvc_video_queue *queue, > > struct v4l2_buffer *v4l2_buf, int nonblocking) > > { > > struct uvc_buffer *buf; > > int ret = 0; > > > > if (v4l2_buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE || > > v4l2_buf->memory != V4L2_MEMORY_MMAP) > > return -EINVAL; > > > > down(&queue->lock); > > if (list_empty(&queue->mainqueue)) { > > ret = -EINVAL; > > goto done; > > } > > > > buf = list_entry(queue->mainqueue.next, struct uvc_buffer, stream); > > if ((ret = uvc_queue_waiton(buf, nonblocking)) < 0) > > goto done; > > > > switch (buf->state) { > > case UVC_BUF_STATE_ERROR: > > ret = -EIO; > > ^^^^ ? need a goto done or is it wanted ? It's wanted. A buffer marked as erroneous by the driver must still be removed from the list, otherwise it will always stay there and no buffer will ever be dequeued anymore. > > static int uvc_set_video_ctrl(struct uvc_video_device *video, > > struct uvc_streaming_control *ctrl, int probe) > > { > > __u8 data[34]; > > is it not posible to create a structure and access it ? > i think it will more readable than data[2] ? Yes, I can do that. I wasn't sure it was worth it, as data is just a block of bytes to be passed to the device. Laurent Pinchart |
From: Luc S. <lu...@sa...> - 2006-01-04 12:30:51
|
Some comments about the current driver. I'll try tonight the driver, and thanks for writing the driver. Luc > > /* > * usbvideo.c -- USB Video Class driver > * > * Copyright (C) 2005 Now you can update the year :-) > * Laurent Pinchart (lau...@sk...) > * > * This program is free software; you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > * the Free Software Foundation; either version 2 of the License, or > * (at your option) any later version. > * > */ > * Don't try to open the driver multiple times ! This will crash and make your > * computer explode (well, maybe not, but still, don't do it). I plan to fix > * that in the very near future. You have been warned. You can just put a counter in the uvc_v4l2_open() and when the counter != 0 don't try to continue. > struct uvc_terminal { > struct list_head list; > > __u8 id; > __u16 type; > char name[64]; > > union { > struct { > __u16 wObjectiveFocalLengthMin; > __u16 wObjectiveFocalLengthMax; > __u16 wOcularFocalLength; > __u8 bControlSize; > __u8 *bmControls; > } camera; > > struct { > __u8 bSourceID; > } output; > }; > }; union without name can't be build with gcc2.95 is it ok ? > > struct uvc_unit { > struct list_head list; > > int id; > int type; > char name[64]; > }; > > struct uvc_control_desc uvc_ctrls[] = { > { put a static here too. > /* > * Allocate the video buffers. > * > * Pages are reserved to make sure they will not be swaped, as they will be > * filled in URB completion handler. > * > * Buffers will be individually mapped, so they must all be page aligned. > */ > static int uvc_alloc_buffers(struct uvc_video_queue *queue, unsigned int nbuffers, > unsigned int buflength) > { > unsigned int bufsize = PAGE_ALIGN(buflength); > unsigned int i; > void *mem = NULL; > int ret; > > if (nbuffers > UVC_MAX_VIDEO_BUFFERS) > nbuffers = UVC_MAX_VIDEO_BUFFERS; > > down(&queue->lock); > > if ((ret = uvc_free_buffers(queue)) < 0) > goto done; > > /* Decrement the number of buffers until allocation succeeds. */ > for (; nbuffers > 0; --nbuffers) { > mem = vmalloc_32(nbuffers * bufsize); > if (mem != NULL) > break; > } > > if (mem == NULL) > return -ENOMEM; ^^^^ return without a up() ret = -ENOMEM; goto done; > > for (i = 0; i < nbuffers; ++i) { > memset(&queue->buffer[i], 0, sizeof queue->buffer[i]); > queue->buffer[i].size = bufsize; > queue->buffer[i].buf.index = i; > queue->buffer[i].buf.m.offset = i * bufsize; Is any buffersize aligned on a page boudary ? > queue->buffer[i].buf.length = buflength; > queue->buffer[i].buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; > queue->buffer[i].buf.sequence = 0; > queue->buffer[i].buf.field = V4L2_FIELD_NONE; > queue->buffer[i].buf.memory = V4L2_MEMORY_MMAP; > queue->buffer[i].buf.flags = 0; > init_waitqueue_head(&queue->buffer[i].wait); > } > > queue->mem = mem; > queue->count = nbuffers; > ret = nbuffers; > > done: > up(&queue->lock); > return ret; > } > > /* > * Dequeue a video buffer. If nonblocking is false, block until a buffer is > * available. > */ > static int uvc_dequeue_buffer(struct uvc_video_queue *queue, > struct v4l2_buffer *v4l2_buf, int nonblocking) > { > struct uvc_buffer *buf; > int ret = 0; > > if (v4l2_buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE || > v4l2_buf->memory != V4L2_MEMORY_MMAP) > return -EINVAL; > > down(&queue->lock); > if (list_empty(&queue->mainqueue)) { > ret = -EINVAL; > goto done; > } > > buf = list_entry(queue->mainqueue.next, struct uvc_buffer, stream); > if ((ret = uvc_queue_waiton(buf, nonblocking)) < 0) > goto done; > > switch (buf->state) { > case UVC_BUF_STATE_ERROR: > ret = -EIO; ^^^^ ? need a goto done or is it wanted ? > case UVC_BUF_STATE_DONE: > buf->state = UVC_BUF_STATE_IDLE; > break; > > case UVC_BUF_STATE_IDLE: > case UVC_BUF_STATE_QUEUED: > case UVC_BUF_STATE_ACTIVE: > default: > ret = -EINVAL; > goto done; > } > > list_del(&buf->stream); > memcpy(v4l2_buf, &buf->buf, sizeof *v4l2_buf); > > done: > up(&queue->lock); > return ret; > } > > /* > * Queue a video buffer. Attempting to queue a buffer that has already been > * queued will return -EINVAL. > */ > static int uvc_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *v4l2_buf) > { > struct uvc_buffer *buf; > unsigned long flags; > int ret = 0; > > if (v4l2_buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE || > v4l2_buf->memory != V4L2_MEMORY_MMAP) > return -EINVAL; > > down(&queue->lock); > if (v4l2_buf->index >= queue->count) { > ret = -EINVAL; > goto done; > } > > buf = &queue->buffer[v4l2_buf->index]; > if (buf->state != UVC_BUF_STATE_IDLE) { > ret = -EINVAL; > goto done; > } > > buf->state = UVC_BUF_STATE_QUEUED; > buf->buf.bytesused = 0; > list_add_tail(&buf->stream, &queue->mainqueue); > spin_lock_irqsave(&queue->irqlock, flags); > list_add_tail(&buf->queue, &queue->irqqueue); > spin_unlock_irqrestore(&queue->irqlock, flags); > > done: > up(&queue->lock); > return ret; > } > } > > static int uvc_set_video_ctrl(struct uvc_video_device *video, > struct uvc_streaming_control *ctrl, int probe) > { > __u8 data[34]; is it not posible to create a structure and access it ? i think it will more readable than data[2] ? > __u8 size; > > size = video->dev->uvc_version > 0x0100 ? 34 : 26; > memset(data, 0, sizeof data); > > *(__le16*)&data[0] = cpu_to_le32(ctrl->bmHint); > data[2] = ctrl->bFormatIndex; > data[3] = ctrl->bFrameIndex; > *(__le32*)&data[4] = cpu_to_le32(ctrl->dwFrameInterval); > *(__le16*)&data[8] = cpu_to_le16(ctrl->wKeyFrameRate); > *(__le16*)&data[10] = cpu_to_le16(ctrl->wPFrameRate); > *(__le16*)&data[12] = cpu_to_le16(ctrl->wCompQuality); > *(__le16*)&data[14] = cpu_to_le16(ctrl->wCompWindowSize); > *(__le16*)&data[16] = cpu_to_le16(ctrl->wDelay); |