Hello,
I found that my new camera Trust Megapixel USB2 (WB-5600R) does not work
well in
streaming v4l applications - xawtv, mplayer etc.. In lower resolution It
looked like driver
was not able to grab full frame and there was some garbage at the bottom of
frame (incomplete frame).
In higher resolution (1280x1024) driver did not work at all and xawtv just
hangs.
I spent some time debugging and figured that the cause of that behaviour was
incorrect frame
size calcultion. I figured out that happens due to some ordering in
initiations of format frames
at usb probe stage. So I made small path which sorts correctly format frames
in initialization.
For it solved all the problems, maybe it will be usefull for others ....
So please have a look or test it... or apply to mainstream :)
Best regards,
Pavel Mironchyk
PS. Does anyone know how to make 5.2 Mpix image using that Trust camera
under linux?
Are there any specification on that (to make driver)?
Index: uvc_driver.c
===================================================================
--- uvc_driver.c (revision 255)
+++ uvc_driver.c (working copy)
@@ -517,6 +517,26 @@
return buffer - start;
}
+
+static void uvc_sort_format_frames(struct uvc_format *format)
+/* sort format */
+{
+ int j=0;
+ struct uvc_frame *frame = format->frame;
+ while(j < (format->nframes - 1)) {
+ struct uvc_frame t_frame;
+ if(frame[j].bFrameIndex > frame[j+1].bFrameIndex) {
+ t_frame = frame[j+1];
+ frame[j+1] = frame[j];
+ frame[j] = t_frame;
+ j = 0;
+ continue;
+ }
+ j++;
+ }
+}
+
+
static int uvc_parse_streaming(struct uvc_device *dev,
struct usb_interface *intf)
{
@@ -709,12 +729,19 @@
case VS_FORMAT_MJPEG:
case VS_FORMAT_DV:
case VS_FORMAT_FRAME_BASED:
+
format->frame = frame;
ret = uvc_parse_format(dev, streaming, format,
&interval, buffer, buflen);
if (ret < 0)
goto error;
+ /*
+ * On trust megapixel USB it produces unordered list of frames
+ * next routine will sort them with bFrameIndex index
+ */
+ uvc_sort_format_frames(format);
+
frame += format->nframes;
format++;
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel