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
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel