Hi,

I try to get raw bayer mode working with a Quickcam Pro for Notebooks
(046d:0991).
I activate this function with the following command:

uvcdynctrl -d /dev/video1 -s "Disable video processing" 1

then I can get the raw frames (frame???.raw) on disk with
luvcview -d /dev/video1 -f yuv -s 1600x1200 -C

That worked fine until uvcvideo driver svn revision 207, where a test
was introduced to drop frames if their length is different from the
expected size:

>
> --- linux-uvc-206/uvc_v4l2.c    2008-06-22 22:00:57.000000000 +0200
>
> +               video->queue.drop_incomplete =
> +                       video->streaming->cur_format->flags &
> +                               UVC_FMT_FLAG_COMPRESSED ? 0 : 1;
> +
>
>
> --- linux-uvc-206/uvc_queue.c   2008-06-22 22:00:57.000000000 +0200
> +       if (queue->drop_incomplete && buf->buf.length !=
> buf->buf.bytesused) {
> +               buf->state = UVC_BUF_STATE_QUEUED;
> +               buf->buf.bytesused = 0;
> +               return buf;
> +       }
=> if the video format is not "COMPRESSED", and a frame has not the
expected length, drop it!

The problem is that my webcam is switched to raw mode without the driver
being aware of it, and that the 8bpp bayer frames are half the size of
YUV frames, so they all get dropped.
A partial solution is to ask the driver for MJPG frames -> deactivates
drop_incomplete, but the maximum resolution is then limited to 960x720,
and I'd like to get the full frame.

I am rather new to webcam and kernel-module programming, so I am not
sure of what is the correct approach to this problem:
- should this "drop_incomplete" function be deactivable through an ioctl ?
- should logitech bayer mode be treated like "YUV2" or "MJPG" and be
activated by the VIDIOC_S_FMT ioctl with "BYR8"?
- should the driver recognize the "Disable video processing" dynamic
control and deactivate drop_incomplete ?
- something else ?

Any advice is welcome...

    Bruno

PS:
For anyone interested, as a workaround I have added a quirk to disable
this "drop_incomplete" feature,
activate with "modprobe uvcvideo quirks=0x80000000"
------------------------------------
diff -u linux-uvc-217/uvc_v4l2.c linux-uvc-217b/uvc_v4l2.c
--- linux-uvc-217/uvc_v4l2.c    2008-06-24 23:01:57.000000000 +0200
+++ linux-uvc-217b/uvc_v4l2.c   2008-06-23 00:31:24.000000000 +0200
@@ -846,6 +846,7 @@
                if (ret < 0)
                        return ret;

+               if (!(video->dev->quirks &
UVC_QUIRK_DISABLE_DROP_INCOMPLETE))
                if (!(video->streaming->cur_format->flags &
                    UVC_FMT_FLAG_COMPRESSED))
                        video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
diff -u linux-uvc-217/uvcvideo.h linux-uvc-217b/uvcvideo.h
--- linux-uvc-217/uvcvideo.h    2008-06-24 23:01:57.000000000 +0200
+++ linux-uvc-217b/uvcvideo.h   2008-06-24 01:10:56.000000000 +0200
@@ -309,6 +309,7 @@
 #define UVC_CTRL_STREAMING_TIMEOUT     1000

 /* Devices quirks */
+#define UVC_QUIRK_DISABLE_DROP_INCOMPLETE 0x80000000
 #define UVC_QUIRK_STATUS_INTERVAL      0x00000001
 #define UVC_QUIRK_PROBE_MINMAX         0x00000002
 #define UVC_QUIRK_PROBE_EXTRAFIELDS    0x00000004
--------------------------------------------------------------





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

Reply via email to