|
|
|
Re: [PATCH 0 of 4] ov534 patches | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
Antonio Ospite wrote:
> Tested the latest version, I am getting "payload error"s setting
> frame_rate=50, loosing about 50% of frames. I tried raising bulk_size
> but then I get "frame overflow" errors from gspca, I'll investigate
> further.
If bulk_size is bigger, the headers appear every 2048 bytes, not at
the beginning of each bulk packet. Try the attached patch?
(The layout of sd_pkt_scan gets a bit strange, but the differences are
more clear this way; I can rewrite it a little more clearly)
-jim
--
ov534: improve payload handling
Frame data in bulk transfers is separated into 2048-byte payloads.
Each payload has its own header.
Signed-off-by: Jim Paris <jim@xxxxxxxx>
diff -r ffeb9d2be572 linux/drivers/media/video/gspca/ov534.c
--- a/linux/drivers/media/video/gspca/ov534.c Mon Dec 08 10:41:04 2008 +0100
+++ b/linux/drivers/media/video/gspca/ov534.c Tue Dec 09 16:06:07 2008 -0500
@@ -1,6 +1,7 @@
/*
* ov534/ov772x gspca driver
* Copyright (C) 2008 Antonio Ospite <ospite@xxxxxxxxxxxxxxxxx>
+ * Copyright (C) 2008 Jim Paris <jim@xxxxxxxx>
*
* Based on a prototype written by Mark Ferrell <majortrips@xxxxxxxxx>
* USB protocol reverse engineered by Jim Paris <jim@xxxxxxxx>
@@ -193,8 +194,8 @@
{ 0x1c, 0x00 },
{ 0x1d, 0x40 },
- { 0x1d, 0x02 },
- { 0x1d, 0x00 },
+ { 0x1d, 0x02 }, /* payload size 0x0200 * 4 = 2048 bytes */
+ { 0x1d, 0x00 }, /* payload size */
{ 0x1d, 0x02 }, /* frame size 0x025800 * 4 = 614400 */
{ 0x1d, 0x58 }, /* frame size */
{ 0x1d, 0x00 }, /* frame size */
@@ -325,7 +326,7 @@
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
- cam->bulk_size = 2048;
+ cam->bulk_size = 16384;
cam->bulk_nurbs = 2;
return 0;
@@ -402,6 +403,17 @@
struct sd *sd = (struct sd *) gspca_dev;
__u32 this_pts;
int this_fid;
+ int remaining_len = len;
+ __u8 *next_data = data;
+
+scan_next:
+ if (remaining_len <= 0)
+ return;
+
+ data = next_data;
+ len = min(remaining_len, 2048);
+ remaining_len -= len;
+ next_data += len;
/* Payloads are prefixed with a the UVC-style header. We
consider a frame to start when the FID toggles, or the PTS
@@ -452,12 +464,13 @@
gspca_frame_add(gspca_dev, LAST_PACKET, frame, NULL, 0);
}
- /* Done */
- return;
+ /* Done this payload */
+ goto scan_next;
discard:
/* Discard data until a new frame starts. */
gspca_frame_add(gspca_dev, DISCARD_PACKET, frame, NULL, 0);
+ goto scan_next;
}
/* sub-driver description */
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
[Linux Media] [Older V4L] [Linux DVB] [Video Disk Recorder] [Linux Kernel] [Asterisk] [Photo] [DCCP] [Netdev] [Xorg] [Util Linux NG] [Xfree86] [Free Photo Albums] [Fedora Users] [Fedora Women] [ALSA Users] [ALSA Devel] [SSH] [DVB Maintainers] [Linux USB] [Yosemite Information]
![]() |
![]() |