Web lists-archives.com

[Spca50x-devs] gspcav2-2.0.4 testing




Hi!

I've been testing my webcam (a sn9c103 with ov7630) with the latest version of the driver, I don't have it working yet. But now the grab.c program output something in  toto.jpg (972 bytes).

Something that happens now that didn't happen with the previous versión is that the green light of the camera, flashes (it's on just a moment). As far as I can see from the logs, the initialization is good, because the camera sends some frames (3 frames: 972, 990 and 14 bytes each).

I'm attaching all the patches I've made to the last version. Some are fixes, and some are costumization I've made to attach me to my sniff logs.

I also attach the toto.jpg file generated by the grab.c program and the usbmon log of that execution.


Attachment: 001_add-bridge-header-len.patch
Description: Binary data

Attachment: 002_patch-fix-initialization.patch
Description: Binary data

diff -urN gspcav2-2.0.4.new.2/sonixb.c gspcav2-2.0.4/sonixb.c
--- gspcav2-2.0.4.new.2/sonixb.c	2008-06-28 10:53:05.000000000 -0300
+++ gspcav2-2.0.4/sonixb.c	2008-06-28 10:56:45.000000000 -0300
@@ -866,6 +874,8 @@
 	int bitpos;
 	unsigned char code;
 
+	PDEBUG(D_ERR, "decoding frame %d (%dx%d)", sd->buflen,
+	       width, height);
 	bitpos = 0;
 	for (row = 0; row < height; row++) {
 		col = 0;
diff -urN gspcav2-2.0.4.new.3/sonixb.c gspcav2-2.0.4.new.4/sonixb.c
--- gspcav2-2.0.4.new.3/sonixb.c	2008-06-28 11:00:01.000000000 -0300
+++ gspcav2-2.0.4.new.4/sonixb.c	2008-06-28 11:05:17.000000000 -0300
@@ -573,7 +573,8 @@
 	sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
 	sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
 #if 0
-	if (sd->sensor == SENSOR_OV7630)	/* jfm: from win trace */
+	if (sd->sensor == SENSOR_OV7630 	/* jfm: from win trace */
+		|| sd->sensor == SENSOR_OV7630_3)
 		reg_w(gspca_dev->dev, 0x01, probe_ov7630, sizeof probe_ov7630);
 #endif
 	return 0;
diff -urN gspcav2-2.0.4/sonixb.c gspcav2-2.0.4.new.5/sonixb.c
--- gspcav2-2.0.4/sonixb.c	2008-06-28 11:07:05.000000000 -0300
+++ gspcav2-2.0.4.new.5/sonixb.c	2008-06-28 11:16:55.000000000 -0300
@@ -390,7 +390,7 @@
 		reg_w(dev, 0x08, *buffer, 8);
 		buffer++;
 		len -= 8;
-		if (len < 0)
+		if (len <= 0)
 			break;
 	}
 }
diff -urN gspcav2-2.0.4.new.4/sonixb.c gspcav2-2.0.4/sonixb.c
--- gspcav2-2.0.4.new.4/sonixb.c	2008-06-28 11:05:17.000000000 -0300
+++ gspcav2-2.0.4/sonixb.c	2008-06-28 11:07:05.000000000 -0300
@@ -193,13 +193,16 @@
 	0x68, COMP1, MCK_INIT1,				/* r17 .. r19 */
 	0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c		/* r1a .. r1f */
 };
+
 static const __u8 initOv7630_3[] = {
 	0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80,	/* r01 .. r08 */
 	0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,	/* r09 .. r10 */
-	0x00, 0x02, 0x01, 0x0a,				/* r11 .. r14 */
+	0x00, 0x01, 0x01, 0x0a,				/* r11 .. r14 */
 	0x28, 0x1e,			/* H & V sizes     r15 .. r16 */
 	0x68, COMP1, MCK_INIT1,				/* r17 .. r19 */
-	0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c		/* r1a .. r1f */
+	0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00,	/* r1a .. r20 */
+	0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80,
+	0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0xff
 };
 static const __u8 ov7630_sensor_init_com[][8] = {
 	{0xa0, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10},
@@ -210,8 +213,8 @@
 	{0xa0, 0x21, 0x20, 0x44, 0x00, 0x80, 0x34, 0x10},
 	{0xa0, 0x21, 0x23, 0xee, 0x00, 0x80, 0x34, 0x10},
 	{0xd0, 0x21, 0x26, 0xa0, 0x9a, 0xa0, 0x30, 0x10},
-	{0xb0, 0x21, 0x2a, 0x80, 0x00, 0xa0, 0x30, 0x10},
 	{0xb0, 0x21, 0x2f, 0x3d, 0x24, 0xa0, 0x30, 0x10},
+	{0xb0, 0x21, 0x2a, 0x80, 0x00, 0xa0, 0x30, 0x10}, 
 	{0xa0, 0x21, 0x32, 0x86, 0x24, 0xa0, 0x30, 0x10},
 /*	{0xb0, 0x21, 0x60, 0xa9, 0x4a, 0xa0, 0x30, 0x10},	   jfm */
 	{0xb0, 0x21, 0x60, 0xa9, 0x42, 0xa0, 0x30, 0x10},	/* jfm */
@@ -229,6 +232,7 @@
 	{0xa0, 0x21, 0x76, 0x02, 0xbd, 0x06, 0xf6, 0x16},
 	{0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},	/* gain */
 };
+
 static const __u8 ov7630_sensor_init_3[][8] = {
 	{0xa0, 0x21, 0x10, 0x36, 0xbd, 0x06, 0xf6, 0x16},	/* exposure */
 	{0xa0, 0x21, 0x76, 0x03, 0xbd, 0x06, 0xf6, 0x16},
@@ -723,8 +727,6 @@
 		i2c_w_vector(dev, ov7630_sensor_init_com,
 				sizeof ov7630_sensor_init_com);
 		msleep(200);
-		i2c_w_vector(dev, ov7630_sensor_init_3,
-				sizeof ov7630_sensor_init_3);
 		break;
 	case SENSOR_PAS106:
 		pas106_i2cinit(dev);
@@ -743,27 +745,32 @@
 				sizeof tas5130_sensor_init);
 		break;
 	}
+	/* AE_STRX AE_STRY AE_ENDX AE_ENDY */
+	reg_w(dev, 0x1c, &sn9c10x[0x1c - 1], 4);
 	/* H_size V_size  0x28, 0x1e maybe 640x480 */
 	reg_w(dev, 0x15, &sn9c10x[0x15 - 1], 2);
-	/* compression register */
+		/* compression register */
 	reg_w(dev, 0x18, &reg17_19[1], 1);
-	/* H_start */		/*fixme: not ov7630*/
-	reg_w(dev, 0x12, &sn9c10x[0x12 - 1], 1);
-	/* V_START */		/*fixme: not ov7630*/
-	reg_w(dev, 0x13, &sn9c10x[0x13 - 1], 1);
+	/* Enable video transfert */
+	reg_w(dev, 0x01, &sn9c10x[0], 1);
 	/* reset 0x17 SensorClk enable inv Clk 0x60 */
 				/*fixme: ov7630 [17]=68 8f (+20 if 102)*/
-	reg_w(dev, 0x17, &reg17_19[0], 1);
+	reg_w(dev, 0x17, &reg17_19[0], 2);
+	/* H_start */		/*fixme: not ov7630*/
+	//reg_w(dev, 0x12, &sn9c10x[0x12 - 1], 1);
+	/* V_START */		/*fixme: not ov7630*/
+	//reg_w(dev, 0x13, &sn9c10x[0x13 - 1], 1);
 	/*MCKSIZE ->3 */	/*fixme: not ov7630*/
-	reg_w(dev, 0x19, &reg17_19[2], 1);
-	/* AE_STRX AE_STRY AE_ENDX AE_ENDY */
-	reg_w(dev, 0x1c, &sn9c10x[0x1c - 1], 4);
-	/* Enable video transfert */
-	reg_w(dev, 0x01, &sn9c10x[0], 1);
+	//reg_w(dev, 0x19, &reg17_19[2], 1);
 	/* Compression */
 	reg_w(dev, 0x18, &reg17_19[1], 2);
 	msleep(20);
 
+	if (sd->sensor == SENSOR_OV7630_3) {
+		i2c_w_vector(dev, ov7630_sensor_init_3,
+				sizeof ov7630_sensor_init_3);
+	}
+
 	setcontrast(gspca_dev);
 	setbrightness(gspca_dev);
 }

Attachment: toto.jpg
Description: JPEG image

db0fc0c0 0.756137 S Ci:2:002:0 s c1 00 0000 0000 0001 1 <
db0fc0c0 0.758017 C Ci:2:002:0 0 1 = 10
a1c55ee0 0.759893 S Co:2:002:0 s 01 0b 0008 0000 0000 0
a1c55ee0 0.761015 C Co:2:002:0 0 0
a1c55ee0 0.761350 S Co:2:002:0 s 41 08 0001 0000 0001 1 = 44
a1c55ee0 0.764018 C Co:2:002:0 0 1 >
a1c55ee0 0.764112 S Co:2:002:0 s 41 08 0017 0000 0001 1 = 68
a1c55ee0 0.767018 C Co:2:002:0 0 1 >
a1c55ee0 0.767500 S Co:2:002:0 s 41 08 0001 0000 0002 2 = 4444
a1c55ee0 0.770015 C Co:2:002:0 0 2 >
a1c55ee0 0.770082 S Co:2:002:0 s 41 08 0001 0000 0030 48 = 4444001a 20202080 21000000 00000004 0001010a 281e68c9 201d1002 030f0c00
a1c55ee0 0.773017 C Co:2:002:0 0 48 >
a1c55ee0 0.773079 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0211280 00000010
a1c55ee0 0.776015 C Co:2:002:0 0 8 >
a1c55ee0 0.776127 S Co:2:002:0 s 41 08 0008 0000 0008 8 = b0210177 3a000010
a1c55ee0 0.779015 C Co:2:002:0 0 8 >
a1c55ee0 0.779345 S Co:2:002:0 s 41 08 0008 0000 0008 8 = d0211278 00803410
a1c55ee0 0.782016 C Co:2:002:0 0 8 >
a1c55ee0 0.782321 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0211b04 00803410
a1c55ee0 0.785012 C Co:2:002:0 0 8 >
a1c55ee0 0.785027 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0212044 00803410
a1c55ee0 0.788010 C Co:2:002:0 0 8 >
a1c55ee0 0.788020 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a02123ee 00803410
a1c55ee0 0.791016 C Co:2:002:0 0 8 >
a1c55ee0 0.791035 S Co:2:002:0 s 41 08 0008 0000 0008 8 = d02126a0 9aa03010
a1c55ee0 0.794010 C Co:2:002:0 0 8 >
a1c55ee0 0.794023 S Co:2:002:0 s 41 08 0008 0000 0008 8 = b0212f3d 24a03010
a1c55ee0 0.797007 C Co:2:002:0 0 8 >
a1c55ee0 0.797134 S Co:2:002:0 s 41 08 0008 0000 0008 8 = b0212a80 00a03010
a1c55ee0 0.800009 C Co:2:002:0 0 8 >
a1c55ee0 0.800019 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0213286 24a03010
a1c55ee0 0.803004 C Co:2:002:0 0 8 >
a1c55ee0 0.803011 S Co:2:002:0 s 41 08 0008 0000 0008 8 = b02160a9 42a03010
a1c55ee0 0.806004 C Co:2:002:0 0 8 >
a1c55ee0 0.806011 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0216500 42a03010
a1c55ee0 0.809004 C Co:2:002:0 0 8 >
a1c55ee0 0.809012 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0216938 42a03010
a1c55ee0 0.812005 C Co:2:002:0 0 8 >
a1c55ee0 0.812078 S Co:2:002:0 s 41 08 0008 0000 0008 8 = c0216f88 0b003010
a1c55ee0 0.815007 C Co:2:002:0 0 8 >
a1c55ee0 0.815020 S Co:2:002:0 s 41 08 0008 0000 0008 8 = c0217421 8e003010
a1c55ee0 0.818003 C Co:2:002:0 0 8 >
a1c55ee0 0.818011 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0217df7 8e003010
a1c55ee0 0.821003 C Co:2:002:0 0 8 >
a1c55ee0 0.821011 S Co:2:002:0 s 41 08 0008 0000 0008 8 = d021171c bd06f610
a1c55ee0 0.824003 C Co:2:002:0 0 8 >
a1c55ee0 1.024962 S Co:2:002:0 s 41 08 001c 0000 0004 4 = 02030f0c
a1c55ee0 1.026976 C Co:2:002:0 0 4 >
a1c55ee0 1.026992 S Co:2:002:0 s 41 08 0015 0000 0002 2 = 281e
a1c55ee0 1.029966 C Co:2:002:0 0 2 >
a1c55ee0 1.029975 S Co:2:002:0 s 41 08 0018 0000 0001 1 = 8f
a1c55ee0 1.032967 C Co:2:002:0 0 1 >
a1c55ee0 1.032975 S Co:2:002:0 s 41 08 0001 0000 0001 1 = 44
a1c55ee0 1.035966 C Co:2:002:0 0 1 >
a1c55ee0 1.035973 S Co:2:002:0 s 41 08 0017 0000 0002 2 = 688f
a1c55ee0 1.038966 C Co:2:002:0 0 2 >
a1c55ee0 1.038973 S Co:2:002:0 s 41 08 0018 0000 0002 2 = 8f20
a1c55ee0 1.041964 C Co:2:002:0 0 2 >
a1c55ee0 1.063160 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0211036 bd06f616
a1c55ee0 1.064966 C Co:2:002:0 0 8 >
a1c55ee0 1.064977 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0217603 bd06f616
a1c55ee0 1.067961 C Co:2:002:0 0 8 >
a1c55ee0 1.067968 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0211101 bd06f616
a1c55ee0 1.070967 C Co:2:002:0 0 8 >
a1c55ee0 1.071035 S Co:2:002:0 s 41 08 0008 0000 0008 8 = a0210010 bd06f615
a1c55ee0 1.073959 C Co:2:002:0 0 8 >
a1c55ee0 1.073967 S Co:2:002:0 s 41 08 0008 0000 0008 8 = b0212aa0 1c06f61d
a1c55ee0 1.076959 C Co:2:002:0 0 8 >
a1c55ee0 1.076966 S Co:2:002:0 s 41 08 0010 0000 0001 1 = 77
a1c55ee0 1.079959 C Co:2:002:0 0 1 >
a1c55ee0 1.079966 S Co:2:002:0 s 41 08 0011 0000 0001 1 = 07
a1c55ee0 1.082958 C Co:2:002:0 0 1 >
8e873c00 1.082966 S Zi:2:002:1 -:-606348325:-606348325 0 32096 <
b1f5c400 1.082977 S Zi:2:002:1 -:-606348325:-606348325 0 32096 <
8e873c00 1.122957 C Zi:2:002:1 0:-606348325:-606348325:0 0 -1006567680:2139068100:65 -65536:2529477632:8486783 0:3288399871:2139068100 768:4294901760:2529477632 50331648:0:3288399871 65:768:4294901760 8486783:50331648:0 2139068100:193:768 0:134537:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0? 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 0:0:0 2066 =
8e873c00 1.139031 S Zi:2:002:1 -:-606348325:-606348325 0 32096 <
b4a4fce0 1.139807 S Co:2:002:0 s 41 08 0001 0000 0001 1 = 09
b4a4fce0 1.140953 C Co:2:002:0 0 1 >
8e873c00 1.147955 C Zi:2:002:1 -2:-606348325:-606348325:0 0 0
b1f5c400 1.148949 C Zi:2:002:1 -2:-606348325:-606348325:0 0 0:0:0 18 =
b4a4fce0 1.148960 S Co:2:002:0 s 01 0b 0000 0000 0000 0
b4a4fce0 1.150949 C Co:2:002:0 0 0
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Spca50x-devs mailing list
Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/spca50x-devs