Re: [Linux-uvc-devel] Add new sync quirk to uvcvideo and use with Syntek 174f:5212

2008-01-16 Thread Herton Ronaldo Krzesinski
Em Tuesday 15 January 2008 20:32:14 Claudio Matsuoka escreveu:
> On Jan 15, 2008 8:27 PM, Herton Ronaldo Krzesinski
> <[EMAIL PROTECTED]> wrote:
> 
> > And use luvcview with patched uvcvideo, the behaviour between the two
> > patches is different. With your patch, the stream of video doesn't work
> > well, it captures only the first 1/2 frames and stop. But in stock 
luvcview
> > without the sleep your patch works fine. The difference here is that with
> > the patch I posted earlier it works in both cases, it doesn't fail with 
the
> > luvcview patched with sleep.
> 
> And, if I recall correctly, kopete behaves like luvcvideo with sleep
> during normal operation, so Laurent's patch would possibly fail there.
> Have you tested it with kopete or ekiga?

Yes, tested kopete today and same issue. Over a LAN the connection is fast 
enough and you don't see the problem, but over slow internet the same problem 
of luvcview with sleep occurs.

> 
> Best regards,
> Claudio
> 

--
[]'s
Herton
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Sid Boyce
Sid Boyce wrote:
> Laurent Pinchart wrote:
>> Hi Sid,
>>
>> On Tuesday 15 January 2008, Sid Boyce wrote:
>>> Sid Boyce wrote:
 # luvcview -l
 luvcview version 0.2.1
 Video driver: x11
 A window manager is available
 video /dev/video0
 Unable to set format: 16.
 Init v4L2 failed !! exit fatal

 # luvcview -L
 luvcview version 0.2.1
 Video driver: x11
 A window manager is available
 video /dev/video0
 /dev/video0 does not support read i/o
 { pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
 { discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
 { discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
 { discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
 { discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
 { discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,


 # lsmod|grep uvc
 uvcvideo 68740 1
 compat_ioctl32 25728 1 uvcvideo
 videodev 44160 2 uvcvideo
 v4l1_compat 28932 2 uvcvideo,videodev
 v4l2_common 36608 3 uvcvideo,compat_ioctl32,videodev
 usbcore 164256 5 uvcvideo,usbhid,ohci_hcd,ehci_hcd

 openSUSE 11.0Alpha0 x86_64 with kernel 2.6.24-rc7-git5-smp.
 Help appreciated.
 Regards
 Sid.
>>> Checked out my Logitech QuickCam Pro 9000 on my other x86_64 box - skype
>>> and luvcview - and it's fine, so there must be a problem with the driver
>>> with respect to the CrystalEye.
>>
>> -16 means -EBUSY. The camera is probably already in use by another
>> application.
>>
>> Best regards,
>>
>> Laurent Pinchart
>>
>>
> 
> Nothing else that would use the camera is running, "lsof /dev/video0" 
> also confirms that. I've tried 2 other USB webcams, gspca and ov51x, 
> both work fine.
> It's either broken hardware or something strange in code. I've run both 
> strace and gdb against luvcview, no more information. xawtv also gives 
> EBUSY. I'm restoring XP to another HD to see if I get problems there also.
> Regards
> Sid.
> 

Whilst restoring XP I remembered the webcam did work. XP restored and 
the webcam definitely is OK under XP. In with the Linux drive again.
I always do "svn up" to make sure I have the latest uvcvideo.
Regards
Sid.
-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support 
Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

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


Re: [Linux-uvc-devel] Debugging UVC + Sanyo Xacti cameras

2008-01-16 Thread Thomas Netter
Laurent Pinchard wrote:
> Please get the kernel log messages using dmesg instead. The networkmanager 
> and 
> hal messages just cripple the output.

Load modules:
modprobe v4l2-common
modprobe videodev
modprobe v4l1-compat
modprobe compat_ioctl32
modprobe video-buf
insmod uvcvideo.ko

/etc/syslog/messages:
Jan 16 16:43:43 zadig kernel: [ 7844.608000] Linux video capture interface: 
v2.00
Jan 16 16:44:17 zadig kernel: [ 7877.848000] usbcore: registered new interface 
driver uvcvideo
Jan 16 16:44:17 zadig kernel: [ 7877.852000] USB Video Class driver (v0.1.0)

dmesg:
[ 7844.608000] Linux video capture interface: v2.00
[ 7877.848000] usbcore: registered new interface driver uvcvideo
[ 7877.852000] USB Video Class driver (v0.1.0)


Start camera into PC CAMERA mode:
[ 8037.988000] usb 2-1: new high speed USB device using ehci_hcd and address 3
[ 8038.12] usb 2-1: configuration #1 chosen from 1 choice
[ 8038.132000] uvcvideo: Found UVC 1.00 device SANYO Digital Camera (0474:0241)

Start luvcview. Image is good. No dmesg output.
Stop luvcview. No dmesg output
Start luvcview. Error:

luvcview version 0.2.1 
Video driver: x11
A window manager is available
video /dev/video0 
Unable to set format: 5.
 Init v4L2 failed !! exit fatal

dmesg:
[ 8191.364000] uvcvideo: Failed to query (1) UVC control 1 (unit 0) : -110 
(exp. 26).

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


Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Sid Boyce
Laurent Pinchart wrote:
> Hi Sid,
> 
> On Tuesday 15 January 2008, Sid Boyce wrote:
>> Sid Boyce wrote:
>>> # luvcview -l
>>> luvcview version 0.2.1
>>> Video driver: x11
>>> A window manager is available
>>> video /dev/video0
>>> Unable to set format: 16.
>>> Init v4L2 failed !! exit fatal
>>>
>>> # luvcview -L
>>> luvcview version 0.2.1
>>> Video driver: x11
>>> A window manager is available
>>> video /dev/video0
>>> /dev/video0 does not support read i/o
>>> { pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
>>> { discrete: width = 640, height = 480 }
>>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
>>> { discrete: width = 352, height = 288 }
>>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
>>> { discrete: width = 320, height = 240 }
>>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
>>> { discrete: width = 176, height = 144 }
>>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
>>> { discrete: width = 160, height = 120 }
>>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
>>>
>>>
>>> # lsmod|grep uvc
>>> uvcvideo 68740 1
>>> compat_ioctl32 25728 1 uvcvideo
>>> videodev 44160 2 uvcvideo
>>> v4l1_compat 28932 2 uvcvideo,videodev
>>> v4l2_common 36608 3 uvcvideo,compat_ioctl32,videodev
>>> usbcore 164256 5 uvcvideo,usbhid,ohci_hcd,ehci_hcd
>>>
>>> openSUSE 11.0Alpha0 x86_64 with kernel 2.6.24-rc7-git5-smp.
>>> Help appreciated.
>>> Regards
>>> Sid.
>> Checked out my Logitech QuickCam Pro 9000 on my other x86_64 box - skype
>> and luvcview - and it's fine, so there must be a problem with the driver
>> with respect to the CrystalEye.
> 
> -16 means -EBUSY. The camera is probably already in use by another
> application.
> 
> Best regards,
> 
> Laurent Pinchart
> 
> 

Nothing else that would use the camera is running, "lsof /dev/video0" 
also confirms that. I've tried 2 other USB webcams, gspca and ov51x, 
both work fine.
It's either broken hardware or something strange in code. I've run both 
strace and gdb against luvcview, no more information. xawtv also gives 
EBUSY. I'm restoring XP to another HD to see if I get problems there also.
Regards
Sid.

-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support 
Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

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


Re: [Linux-uvc-devel] Add new sync quirk to uvcvideo and use with Syntek 174f:5212

2008-01-16 Thread Laurent Pinchart
On Tuesday 15 January 2008, Herton Ronaldo Krzesinski wrote:
> Em Tuesday 15 January 2008 20:12:16 Laurent Pinchart escreveu:
> > On Tuesday 15 January 2008, Herton Ronaldo Krzesinski wrote:
> > > Em Tuesday 15 January 2008 18:56:35 Laurent Pinchart escreveu:
> > > > Hi Herton,
> > > >
> > > > On Tuesday 15 January 2008, Herton Ronaldo Krzesinski wrote:
> > > > > Hi Laurent, thanks for the commit and advice. We played with the
> > > > > webcam again (sorry for delay) and we found out that it isn't
> > > > > really reporting the FID bit, but only end of frame marker (EOF).
> > > > > This is strange indeed, as from what I understand from UVC spec FID
> > > > > is required while EOF is optional.
> > > >
> > > > The bmFramingInfo field in the probe&commit control can be used by
> > > > the device to report if it supports FID and/or EOF. However, for
> > > > known frame-based formats, the field must be ignored. Just out of
> > > > curiosity, could you print the field's value when reading the probe
> > > > and commit controls ?
> > >
> > > It's always 0x00, falls at else in size check inside
> > > uvc_get_video_ctrl: uvc_get_video_ctrl: size != 34, bmFramingInfo =
> > > 0x00
> > >
> > > > > I reworked the quirk that Claudio made against revision 166 from
> > > > > svn, but now using the EOF to sync the stream (the previous quirk
> > > > > was ok, but on laggy communication, like using to transmit a video
> > > > > stream over internet etc., the frames would overlap etc. resulting
> > > > > in many display issues):
> > > >
> > > > Your patch could drop the last payload of each frame. Could you
> > > > please try the attached patch ?
> > >
> > > It works, but gives a different behaviour: for example, I simulate lag
> > > in luvcview placing a sleep(1) at the start of uvcGrab function, with
> > > this patch it captures only some frames at start and stops, with the
> > > patch I posted I receive continous snapshots.
> >
> > I'm not sure to understand. Could you please elaborate ?
>
> If I patch luvcview like this:
>
> --- v4l2uvc.c.orig  2008-01-15 20:19:57.0 -0200
> +++ v4l2uvc.c   2008-01-15 20:19:40.0 -0200
> @@ -462,6 +462,8 @@ int uvcGrab(struct vdIn *vd)
>  #define HEADERFRAME1 0xaf
>  int ret;
>
> +sleep(1);
> +
>  if (!vd->isstreaming)
> if (video_enable(vd))
> goto err;
>
> And use luvcview with patched uvcvideo, the behaviour between the two
> patches is different. With your patch, the stream of video doesn't work
> well, it captures only the first 1/2 frames and stop. But in stock luvcview
> without the sleep your patch works fine. The difference here is that with
> the patch I posted earlier it works in both cases, it doesn't fail with the
> luvcview patched with sleep.

I see where the problem comes from. Could you please test the attached patch ? 
It should fix the freeze and still prevent the last payload of each frame to 
be discarded.

Best regards,

Laurent Pinchart
Index: uvc_video.c
===
--- uvc_video.c	(revision 163)
+++ uvc_video.c	(working copy)
@@ -298,11 +298,17 @@
 	 * toggled when the the buffer state is not UVC_BUF_STATE_ACTIVE.
 	 * queue->last_fid is initialized to -1, so the first isochronous
 	 * frame will always be in sync.
+	 *
+	 * If the device doesn't toggle the FID bit, invert video->last_fid
+	 * when the EOF bit is set to force synchronisation on the next packet.
 	 */
 	if (buf->state != UVC_BUF_STATE_ACTIVE) {
 		if (fid == video->last_fid) {
 			uvc_trace(UVC_TRACE_FRAME, "Dropping payload (out of "
 "sync).\n");
+			if ((video->dev->quirks & UVC_QUIRK_STREAM_NO_FID) &&
+			(data[1] & UVC_STREAM_EOF))
+video->last_fid ^= UVC_STREAM_FID;
 			return -ENODATA;
 		}
 
@@ -370,6 +376,8 @@
 		if (data[0] == len)
 			uvc_trace(UVC_TRACE_FRAME, "EOF in empty payload.\n");
 		buf->state = UVC_BUF_STATE_DONE;
+		if (video->dev->quirks & UVC_QUIRK_STREAM_NO_FID)
+			video->last_fid ^= UVC_STREAM_FID;
 	}
 }
 
Index: uvc_driver.c
===
--- uvc_driver.c	(revision 165)
+++ uvc_driver.c	(working copy)
@@ -1752,6 +1752,16 @@
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_PROBE_MINMAX
 	},
+	/* Syntek (HP Spartan) */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x174f,
+	  .idProduct		= 0x5212,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_STREAM_NO_FID
+	},
 	/* Ecamm Pico iMage */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 | USB_DEVICE_ID_MATCH_INT_INFO,
Index: uvcvideo.h
===
--- uvcvideo.h	(revision 162)
+++ uvcvideo.h	(working copy)
@@ -313,6 +313,7 @@
 #define UVC_QUIRK_PROBE_MINMAX		0x0002
 #define UVC_QUIRK_PROBE_EXTRAFIELDS	0x0004
 #define UVC_QUIRK_BUILTIN_ISIGHT	0x000

Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Laurent Pinchart
Hi Sid,

On Wednesday 16 January 2008, Sid Boyce wrote:
> Laurent Pinchart wrote:
> > On Tuesday 15 January 2008, Sid Boyce wrote:
> >> Sid Boyce wrote:
> >>> # luvcview -l
> >>> luvcview version 0.2.1
> >>> Video driver: x11
> >>> A window manager is available
> >>> video /dev/video0
> >>> Unable to set format: 16.
> >>> Init v4L2 failed !! exit fatal
> >>>
> >>> # luvcview -L
> >>> luvcview version 0.2.1
> >>> Video driver: x11
> >>> A window manager is available
> >>> video /dev/video0
> >>> /dev/video0 does not support read i/o
> >>> { pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
> >>> { discrete: width = 640, height = 480 }
> >>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> >>> { discrete: width = 352, height = 288 }
> >>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> >>> { discrete: width = 320, height = 240 }
> >>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> >>> { discrete: width = 176, height = 144 }
> >>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> >>> { discrete: width = 160, height = 120 }
> >>> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> >>>
> >>>
> >>> # lsmod|grep uvc
> >>> uvcvideo 68740 1
> >>> compat_ioctl32 25728 1 uvcvideo
> >>> videodev 44160 2 uvcvideo
> >>> v4l1_compat 28932 2 uvcvideo,videodev
> >>> v4l2_common 36608 3 uvcvideo,compat_ioctl32,videodev
> >>> usbcore 164256 5 uvcvideo,usbhid,ohci_hcd,ehci_hcd
> >>>
> >>> openSUSE 11.0Alpha0 x86_64 with kernel 2.6.24-rc7-git5-smp.
> >>> Help appreciated.
> >>> Regards
> >>> Sid.
> >>
> >> Checked out my Logitech QuickCam Pro 9000 on my other x86_64 box - skype
> >> and luvcview - and it's fine, so there must be a problem with the driver
> >> with respect to the CrystalEye.
> >
> > -16 means -EBUSY. The camera is probably already in use by another
> > application.
> >
> > Best regards,
> >
> > Laurent Pinchart
>
> Nothing else that would use the camera is running, "lsof /dev/video0"
> also confirms that. I've tried 2 other USB webcams, gspca and ov51x,
> both work fine.
> It's either broken hardware or something strange in code. I've run both
> strace and gdb against luvcview, no more information. xawtv also gives
> EBUSY. I'm restoring XP to another HD to see if I get problems there also.

VIDIOC_S_FMT can return EBUSY either when the device is already streaming or 
when another process has acquired a "streaming privilege". Basically, this 
means another process has already called one of the following ioctls:

VIDIOC_S_INPUT
VIDIOC_S_PARM
VIDIOC_S_FMT
VIDIOC_TRY_FMT
VIDIOC_REQBUFS

Please apply the attached patch and check the kernel log. The driver should 
report every process that acquire or release streaming privileges, as well as 
attemps to call VIDIOC_S_FMT while streaming.

Best regards,

Laurent Pinchart
Index: uvc_v4l2.c
===
--- uvc_v4l2.c	(revision 166)
+++ uvc_v4l2.c	(working copy)
@@ -249,8 +249,10 @@
 	if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
 		return -EINVAL;
 
-	if (video->queue.streaming)
+	if (video->queue.streaming) {
+		uvc_printk(KERN_INFO, "can't set format while streaming.\n");
 		return -EBUSY;
+	}
 
 	ret = uvc_v4l2_try_format(video, fmt, &probe, &format, &frame);
 	if (ret < 0)
@@ -374,10 +376,16 @@
 	mutex_lock(&uvc_driver.open_mutex);
 	if (atomic_inc_return(&handle->device->active) != 1) {
 		atomic_dec(&handle->device->active);
+		uvc_printk(KERN_INFO, "unable to acquire streaming privileges "
+			"for process %s (%u): active count is %u\n",
+			current->comm, current->pid,
+			atomic_read(&handle->device->active));
 		ret = -EBUSY;
 		goto done;
 	}
 
+	uvc_printk(KERN_INFO, "process %s (%u) acquired streaming privileges\n",
+		current->comm, current->pid);
 	handle->state = UVC_HANDLE_ACTIVE;
 
 done:
@@ -387,8 +395,11 @@
 
 static void uvc_dismiss_privileges(struct uvc_fh *handle)
 {
-	if (handle->state == UVC_HANDLE_ACTIVE)
+	if (handle->state == UVC_HANDLE_ACTIVE) {
+		uvc_printk(KERN_INFO, "process %s (%u) released streaming "
+			"privileges\n", current->comm, current->pid);
 		atomic_dec(&handle->device->active);
+	}
 
 	handle->state = UVC_HANDLE_PASSIVE;
 }
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Logitech QC 9000 lockup on dwFrameInterval change during Skype call

2008-01-16 Thread Laurent Pinchart
On Wednesday 16 January 2008, Andrew Fenn wrote:
> I am building from svn, but maybe I am doing something wrong?

Just make sure you remove all occurrences of uvcvideo.ko 
in /lib/modules/ before you install the new, in case the 
makefile would install it in a different location.

> Please could you give me a step by step of what you'd like me to provide?

You reported a camera crash. I suppose your conclusion is based on a specific 
behaviour you noticed or on messages printed to a log. Please describe with 
specificity the wrong behaviour, and please provide any kernel log message 
printed by the driver (using dmesg) and any application log message (I've 
never used the application but I assume Skype prints messages to a log) 
related to the problem.

Best regards,

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


Re: [Linux-uvc-devel] Debugging UVC + Sanyo Xacti cameras

2008-01-16 Thread Laurent Pinchart
Hi Thomas,

On Wednesday 16 January 2008, Thomas Netter wrote:
> Laurent Pinchard wrote:
> > Please get the kernel log messages using dmesg instead. The
> > networkmanager and hal messages just cripple the output.
>
> Load modules:
> modprobe v4l2-common
> modprobe videodev
> modprobe v4l1-compat
> modprobe compat_ioctl32
> modprobe video-buf
> insmod uvcvideo.ko
>
> /etc/syslog/messages:
> Jan 16 16:43:43 zadig kernel: [ 7844.608000] Linux video capture interface:
> v2.00 Jan 16 16:44:17 zadig kernel: [ 7877.848000] usbcore: registered new
> interface driver uvcvideo Jan 16 16:44:17 zadig kernel: [ 7877.852000] USB
> Video Class driver (v0.1.0)
>
> dmesg:
> [ 7844.608000] Linux video capture interface: v2.00
> [ 7877.848000] usbcore: registered new interface driver uvcvideo
> [ 7877.852000] USB Video Class driver (v0.1.0)
>
>
> Start camera into PC CAMERA mode:
> [ 8037.988000] usb 2-1: new high speed USB device using ehci_hcd and
> address 3 [ 8038.12] usb 2-1: configuration #1 chosen from 1 choice
> [ 8038.132000] uvcvideo: Found UVC 1.00 device SANYO Digital Camera
> (0474:0241)
>
> Start luvcview. Image is good. No dmesg output.
> Stop luvcview. No dmesg output
> Start luvcview. Error:
>
> luvcview version 0.2.1
> Video driver: x11
> A window manager is available
> video /dev/video0
> Unable to set format: 5.
>  Init v4L2 failed !! exit fatal
>
> dmesg:
> [ 8191.364000] uvcvideo: Failed to query (1) UVC control 1 (unit 0) : -110
> (exp. 26).

This is quite weird. The camera starts streaming without any problem, but 
after streaming for a while it fails to answer all USB requests. The requests 
sent before stream start probably confuse the camera somehow.

I'll have another wild guess, could you please try the attached patch ? It 
removes a few differences in requests sent to the device compared to what the 
Windows driver does.

Best regards,

Laurent Pinchart
Index: uvc_video.c
===
--- uvc_video.c	(revision 163)
+++ uvc_video.c	(working copy)
@@ -858,11 +858,8 @@
 			break;
 	}
 
-	/* Commit the default settings. */
 	probe->bFormatIndex = format->index;
 	probe->bFrameIndex = frame->bFrameIndex;
-	if ((ret = uvc_set_video_ctrl(video, probe, 0)) < 0)
-		return ret;
 
 	video->streaming->cur_format = format;
 	video->streaming->cur_frame = frame;
@@ -897,6 +894,10 @@
 	if ((ret = uvc_queue_enable(&video->queue, 1)) < 0)
 		return ret;
 
+	/* Commit the streaming parameters. */
+	if ((ret = uvc_set_video_ctrl(video, &video->streaming->ctrl, 0)) < 0)
+		return ret;
+
 	return uvc_init_video(video);
 }
 
Index: uvc_v4l2.c
===
--- uvc_v4l2.c	(revision 167)
+++ uvc_v4l2.c	(working copy)
@@ -256,9 +256,6 @@
 	if (ret < 0)
 		return ret;
 
-	if ((ret = uvc_set_video_ctrl(video, &probe, 0)) < 0)
-		return ret;
-
 	memcpy(&video->streaming->ctrl, &probe, sizeof probe);
 	video->streaming->cur_format = format;
 	video->streaming->cur_frame = frame;
@@ -319,10 +316,6 @@
 	if ((ret = uvc_probe_video(video, &probe)) < 0)
 		return ret;
 
-	/* Commit the new settings. */
-	if ((ret = uvc_set_video_ctrl(video, &probe, 0)) < 0)
-		return ret;
-
 	memcpy(&video->streaming->ctrl, &probe, sizeof probe);
 
 	/* Return the actual frame period. */
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Logitech QC 9000 lockup on dwFrameInterval change during Skype call

2008-01-16 Thread Philipp Kolmann
On Wed, Jan 16, 2008 at 09:35:12PM +0100, Laurent Pinchart wrote:
> ... and any application log message (I've 
> never used the application but I assume Skype prints messages to a log) 
> related to the problem.

Sadly, Skype logs some stuff, but the log is encrypted and only skype can
decrypt stuff. :(

Philipp

-- 
The more I learn about people, the more I like my dog!
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Sid Boyce
Sid Boyce wrote:
> Sid Boyce wrote:
>> Laurent Pinchart wrote:
>>> Hi Sid,
>>>
>>> On Tuesday 15 January 2008, Sid Boyce wrote:
 Sid Boyce wrote:
> # luvcview -l
> luvcview version 0.2.1
> Video driver: x11
> A window manager is available
> video /dev/video0
> Unable to set format: 16.
> Init v4L2 failed !! exit fatal
>
> # luvcview -L
> luvcview version 0.2.1
> Video driver: x11
> A window manager is available
> video /dev/video0
> /dev/video0 does not support read i/o
> { pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
> { discrete: width = 640, height = 480 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 352, height = 288 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 320, height = 240 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 176, height = 144 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 160, height = 120 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
>
>
> # lsmod|grep uvc
> uvcvideo 68740 1
> compat_ioctl32 25728 1 uvcvideo
> videodev 44160 2 uvcvideo
> v4l1_compat 28932 2 uvcvideo,videodev
> v4l2_common 36608 3 uvcvideo,compat_ioctl32,videodev
> usbcore 164256 5 uvcvideo,usbhid,ohci_hcd,ehci_hcd
>
> openSUSE 11.0Alpha0 x86_64 with kernel 2.6.24-rc7-git5-smp.
> Help appreciated.
> Regards
> Sid.
 Checked out my Logitech QuickCam Pro 9000 on my other x86_64 box - 
 skype
 and luvcview - and it's fine, so there must be a problem with the 
 driver
 with respect to the CrystalEye.
>>>
>>> -16 means -EBUSY. The camera is probably already in use by another
>>> application.
>>>
>>> Best regards,
>>>
>>> Laurent Pinchart
>>>
>>>
>>
>> Nothing else that would use the camera is running, "lsof /dev/video0" 
>> also confirms that. I've tried 2 other USB webcams, gspca and ov51x, 
>> both work fine.
>> It's either broken hardware or something strange in code. I've run 
>> both strace and gdb against luvcview, no more information. xawtv also 
>> gives EBUSY. I'm restoring XP to another HD to see if I get problems 
>> there also.
>> Regards
>> Sid.
>>
> 
> Whilst restoring XP I remembered the webcam did work. XP restored and 
> the webcam definitely is OK under XP. In with the Linux drive again.
> I always do "svn up" to make sure I have the latest uvcvideo.
> Regards
> Sid.

After upgrading to 2.6.24-rc8, getting different results.
  # luvcview
luvcview version 0.2.1
Video driver: x11
A window manager is available
video /dev/video0
Unable to set format: 22.
  Init v4L2 failed !! exit fatal

# xawtv -c /dev/video0
This is xawtv-3.95, running on Linux/x86_64 (2.6.24-rc8-smp)
xinerama 0: 1440x900+0+0
WARNING: No DGA support available for this display.
/dev/video0 [v4l2]: no overlay support
v4l-conf had some trouble, trying to continue anyway
ioctl: VIDIOC_G_STD(std=0x74508444 
[PAL_G,PAL_D1,PAL_Nc,?,SECAM_K,SECAM_L,(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)]):
 
Invalid argument
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

Regards
Sid.
-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support 
Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

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


Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Laurent Pinchart
Hi Sid,

On Wednesday 16 January 2008, Sid Boyce wrote:
> Sid Boyce wrote:
>
> After upgrading to 2.6.24-rc8, getting different results.
>   # luvcview
> luvcview version 0.2.1
> Video driver: x11
> A window manager is available
> video /dev/video0
> Unable to set format: 22.
>   Init v4L2 failed !! exit fatal
>
> # xawtv -c /dev/video0
> This is xawtv-3.95, running on Linux/x86_64 (2.6.24-rc8-smp)
> xinerama 0: 1440x900+0+0
> WARNING: No DGA support available for this display.
> /dev/video0 [v4l2]: no overlay support
> v4l-conf had some trouble, trying to continue anyway
> ioctl: VIDIOC_G_STD(std=0x74508444
> [PAL_G,PAL_D1,PAL_Nc,?,SECAM_K,SECAM_L,(null),(null),(null),(null),(null),(
>null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),
>(null),(null),(null),(null)]): Invalid argument
> 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.s
>econds=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.s
>econds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0
>;memory=unknown): Invalid argument

xawtv 3.95 has a known bug. Please try luvcview instead.

Best regards,

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


Re: [Linux-uvc-devel] Logitech QC 9000 lockup on dwFrameInterval change during Skype call

2008-01-16 Thread Laurent Pinchart
On Wednesday 16 January 2008, Philipp Kolmann wrote:
> On Wed, Jan 16, 2008 at 09:35:12PM +0100, Laurent Pinchart wrote:
> > ... and any application log message (I've
> > never used the application but I assume Skype prints messages to a log)
> > related to the problem.
>
> Sadly, Skype logs some stuff, but the log is encrypted and only skype can
> decrypt stuff. :(

To quote your signature, the more I learn about Skype, the more I like Free 
Software...

You can always check the kernel log, that's not encrypted.

Best regards,

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


Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Sid Boyce
Laurent Pinchart wrote:
> Hi Sid,
> 
> On Wednesday 16 January 2008, Sid Boyce wrote:
>> Sid Boyce wrote:
>>
>> After upgrading to 2.6.24-rc8, getting different results.
 Guessed you missed this.
>>   # luvcview
>> luvcview version 0.2.1
>> Video driver: x11
>> A window manager is available
>> video /dev/video0
>> Unable to set format: 22.
>>   Init v4L2 failed !! exit fatal
>>
# luvcview -l
luvcview version 0.2.1
Video driver: x11
A window manager is available
video /dev/video0
Unable to set format: 22.
  Init v4L2 failed !! exit fatal
sepulot:~ # luvcview -L
luvcview version 0.2.1
Video driver: x11
A window manager is available
video /dev/video0
/dev/video0 does not support read i/o
{ pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,


> xawtv 3.95 has a known bug. Please try luvcview instead.
> 
> Best regards,
> 
> Laurent Pinchart
> 
> 

Regards
Sid.

-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support 
Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

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


Re: [Linux-uvc-devel] Acer Notebook Suyin CrystalEye 064e:a101 problem with luvcview

2008-01-16 Thread Sid Boyce
Sid Boyce wrote:
> Laurent Pinchart wrote:
>> Hi Sid,
>>
>> On Wednesday 16 January 2008, Sid Boyce wrote:
>>> Sid Boyce wrote:
>>>
>>> After upgrading to 2.6.24-rc8, getting different results.
>  Guessed you missed this.
>>> # luvcview
>>> luvcview version 0.2.1
>>> Video driver: x11
>>> A window manager is available
>>> video /dev/video0
>>> Unable to set format: 22.
>>> Init v4L2 failed !! exit fatal
>>>
> # luvcview -l
> luvcview version 0.2.1
> Video driver: x11
> A window manager is available
> video /dev/video0
> Unable to set format: 22.
> Init v4L2 failed !! exit fatal
> sepulot:~ # luvcview -L
> luvcview version 0.2.1
> Video driver: x11
> A window manager is available
> video /dev/video0
> /dev/video0 does not support read i/o
> { pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
> { discrete: width = 640, height = 480 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 352, height = 288 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 320, height = 240 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 176, height = 144 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> { discrete: width = 160, height = 120 }
> Time interval between frame: 1/30, 1/20, 1/15, 1/10, 1/5, 1/1,
> 
> 
>> xawtv 3.95 has a known bug. Please try luvcview instead.
>>
>> Best regards,
>>
>> Laurent Pinchart
>>
>>
> 
> Regards
> Sid.
> 

Seen in  "strace -s 256 -f luvcview -d /dev/video1".
open("/dev/video1", O_RDWR) = 7
ioctl(7, VIDIOC_QUERYCAP or VT_OPENQRY, 0x64a520) = 0
ioctl(7, VIDIOC_S_FMT or VT_RELDISP, 0x64a588) = -1 EINVAL (Invalid 
argument)
close(7)= 0
write(1, "luvcview version 0.2.1 \nVideo driver: x11\nA window manager 
is available\nvideo /dev/video1 \nUnable to set format: 22.\n Init v4L2 
failed !! exit fatal \n", 150luvcview version 0.2.1
Video driver: x11
A window manager is available
video /dev/video1
Unable to set format: 22.
  Init v4L2 failed !! exit fatal
) = 150
exit_group(1)

Problem with format.
Worked finally using "luvcview -f yuv -d /dev/video1".
Regards
Sid.

-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support 
Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

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