Skip to contentSkip to conversation

gspca stv06xx performance regression - request for testing

PATCH James Blanford 2 participants 2 messages Sep 9, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Howdy folks,

Now that I have my old quickcam express working, I can confirm that the frame rate is half what it was with the old out-of-tree driver. The gspca driver is throwing out every other frame. When a frame is completed, a new frame is started with a new frame buffer that passes the test for being properly queued. But after the first packet is analysed by the subdriver, the exact same test fails and the entire frame is marked for discard.

I'm not having any luck tracking the problem down. I would like to find out if it's just my sensor, my subdriver or the entire gspca family. I have some printks that can be added to gspca.c that easily and quickly illustrate the problem.

gspca.c renamed from gspca.c.orig +4 -0
@@ -268,9 +268,11 @@
 	/* when start of a new frame, if the current frame buffer
 	 * is not queued, discard the whole frame */
 	if (packet_type == FIRST_PACKET) {
+			printk(KERN_DEBUG "New frame - first packet\n");
 		if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS)
 						!= V4L2_BUF_FLAG_QUEUED) {
 			gspca_dev->last_packet_type = DISCARD_PACKET;
+			printk(KERN_DEBUG "Frame marked for discard\n");
 			return frame;
 		}
 		frame->data_end = frame->data;
@@ -306,6 +308,7 @@
 		wake_up_interruptible(&gspca_dev->wq);	/* event = new frame */
 		i = (gspca_dev->fr_i + 1) % gspca_dev->nframes;
 		gspca_dev->fr_i = i;
+		printk(KERN_DEBUG "Frame completed\n");
 		PDEBUG(D_FRAM, "frame complete len:%d q:%d i:%d o:%d",
 			frame->v4l2_buf.bytesused,
 			gspca_dev->fr_q,
@@ -396,6 +399,7 @@
 	}
 	gspca_dev->fr_i = gspca_dev->fr_o = gspca_dev->fr_q = 0;
 	gspca_dev->last_packet_type = DISCARD_PACKET;
+	printk(KERN_DEBUG "Frame alloc\n");
 	gspca_dev->sequence = 0;
 	return 0;
 }

When I test, I get:

Sep  8 10:27:48 blackbart kernel: Frame alloc
Sep  8 10:27:48 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame completed
Sep  8 10:27:49 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame marked for discard
Sep  8 10:27:49 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame completed
Sep  8 10:27:49 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame marked for discard
Sep  8 10:27:49 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame completed
Sep  8 10:27:49 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame marked for discard
Sep  8 10:27:49 blackbart kernel: New frame - first packet
Sep  8 10:27:49 blackbart kernel: Frame completed

Of course, I shouldn't be getting every other frame marked for discard. Note that this marking takes place when the first packet comes across, _before_ any image data is passed.

I'm hoping someone has a few minutes to make a little patch, run the cam for a couple seconds and look at the debug log. Any comments are welcome as well.

Thanks,

- Jim

Signature · 1 line
There are two kinds of people.  The innocent and the living.
#1 lore raw
Quoted 10 lines · On Wed, 9 Sep 2009 18:11:39 -0400 James Blanford <[email protected]> wrote:

Howdy folks,

Now that I have my old quickcam express working, I can confirm that the frame rate is half what it was with the old out-of-tree driver. The gspca driver is throwing out every other frame. When a frame is completed, a new frame is started with a new frame buffer that passes the test for being properly queued. But after the first packet is analysed by the subdriver, the exact same test fails and the entire frame is marked for discard.

I also have a QuickCam Express, the one with pb0100 sensor. It is slow indeed, but I can't really make a comparison with the old driver.

Quoted 4 lines

I'm hoping someone has a few minutes to make a little patch, run the cam for a couple seconds and look at the debug log. Any comments are welcome as well.

I get some discarded frames with stv06xx , but not as regularly as you. Also, no discarded frames with ov534 subdriver.

Here's the log:

[55231.009253] gspca: main v2.7.0 registered
[55231.011569] STV06xx: Probing for a stv06xx device
[55231.011575] gspca: probing 046d:0840
[55231.011582] STV06xx: Configuring camera
[55231.024510] STV06xx: Photobit pb0100 sensor detected
[55231.024517] STV06xx: Initializing camera
[55231.310369] gspca: probe ok
[55231.310408] usbcore: registered new interface driver STV06xx
[55231.310413] STV06xx: registered
[55445.692828] Frame alloc
[55446.298735] New frame - first packet
[55446.426667] Frame completed
[55446.426674] New frame - first packet
[55446.426677] Frame marked for discard
[55446.554582] New frame - first packet
[55446.714487] Frame completed
[55446.714495] New frame - first packet
[55446.874375] Frame completed
[55446.874383] New frame - first packet
[55447.034246] Frame completed
[55447.034253] New frame - first packet
[55447.194141] Frame completed
[55447.194150] New frame - first packet
[55447.354020] Frame completed
[55447.354027] New frame - first packet
[55447.354029] Frame marked for discard
[55447.481948] New frame - first packet
[55447.641846] Frame completed
[55447.641853] New frame - first packet
[55447.801725] Frame completed
[55447.801732] New frame - first packet
[55447.961596] Frame completed
[55447.961603] New frame - first packet
[55448.121467] Frame completed
[55448.121474] New frame - first packet
[55448.281355] Frame completed
[55448.281363] New frame - first packet
[55448.409305] Frame completed
[55448.409313] New frame - first packet
[55448.569191] Frame completed
[55448.569199] New frame - first packet
[55448.729067] Frame completed
[55448.729075] New frame - first packet
[55448.888939] Frame completed
[55448.888946] New frame - first packet
[55449.048822] Frame completed
[55449.048830] New frame - first packet
[55449.208710] Frame completed
[55449.208717] New frame - first packet
[55449.336668] Frame completed
[55449.336675] New frame - first packet
[55449.496532] Frame completed
[55449.496540] New frame - first packet
[55449.656421] Frame completed
[55449.656429] New frame - first packet
[55449.816286] Frame completed
[55449.816294] New frame - first packet
[55449.976166] Frame completed
[55449.976173] New frame - first packet
[55449.976175] Frame marked for discard
[55450.136047] New frame - first packet
Signature · 10 lines
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?