Em Thursday 10 January 2008 17:30:32 Laurent Pinchart escreveu: > Hi Claudio, > > On Saturday 29 December 2007, Claudio Matsuoka wrote: > > On Dec 28, 2007 9:26 PM, Laurent Pinchart <[EMAIL PROTECTED]> > > wrote: > > > I have a pending patch that passes the uvc_video_device structure to > > > URB completion callbacks instead of the uvc_video_queue structure. This > > > should take care of the problem you solved by setting > > > dev->udev->quirks. > > > > Could you send me that patch so I can rework the Syntek quirk to use it? > > I've just committed it to SVN. > > Best regards, > > Laurent Pinchart
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. 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):
The Syntek 174f:5212 UVC camera in HP Spartan/Leon laptops don't report
FID bit for each frame, but report EOF. Add quirk to use EOF to synchronize
frames and use it.
Signed-off-by: Herton Ronaldo Krzesinski <[EMAIL PROTECTED]>
Signed-off-by: Claudio Matsuoka <[EMAIL PROTECTED]>
diff -Naurp uvc.orig/uvc_driver.c uvc/uvc_driver.c
--- uvc.orig/uvc_driver.c 2008-01-11 11:14:27.000000000 -0200
+++ uvc/uvc_driver.c 2008-01-14 16:22:15.000000000 -0200
@@ -1658,6 +1658,16 @@ static int uvc_resume(struct usb_interfa
* though they are compliant.
*/
static struct usb_device_id uvc_ids[] = {
+ /* 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_EOF_SYNC
+ },
/* ALi M5606 (Clevo M540SR) */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
diff -Naurp uvc.orig/uvc_video.c uvc/uvc_video.c
--- uvc.orig/uvc_video.c 2008-01-11 11:14:27.000000000 -0200
+++ uvc/uvc_video.c 2008-01-14 16:32:04.000000000 -0200
@@ -286,6 +286,12 @@ static int uvc_video_decode_start(struct
fid = data[1] & UVC_STREAM_FID;
+ /* Some webcams don't report FID as they should. For now use EOF
+ * marker as a workaround
+ */
+ if (video->dev->quirks & UVC_QUIRK_EOF_SYNC)
+ fid = !!(data[1] & UVC_STREAM_EOF);
+
/* Store the payload FID bit and return immediately when the buffer is
* NULL.
*/
diff -Naurp uvc.orig/uvcvideo.h uvc/uvcvideo.h
--- uvc.orig/uvcvideo.h 2008-01-11 11:14:27.000000000 -0200
+++ uvc/uvcvideo.h 2008-01-14 16:33:01.000000000 -0200
@@ -313,6 +313,7 @@ struct uvc_xu_control {
#define UVC_QUIRK_PROBE_MINMAX 0x00000002
#define UVC_QUIRK_PROBE_EXTRAFIELDS 0x00000004
#define UVC_QUIRK_BUILTIN_ISIGHT 0x00000008
+#define UVC_QUIRK_EOF_SYNC 0x00000010
/* Format flags */
#define UVC_FMT_FLAG_COMPRESSED 0x00000001
And attached is the kernel log output without the quirk above enabled as
requested, I placed printks in the start of each decode function (
printing header info in hexa). Note that it starts decoding the first
frame, but as it doesn't sees FID after first frame it just gets stuck at
uvc_video_decode_start (and FID is never reported, but EOF is).
--
[]'s
Herton
uvcvideo.log.gz
Description: GNU Zip compressed data
_______________________________________________ Linux-uvc-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/linux-uvc-devel
