Web lists-archives.com

[Spca50x-devs] Genius Videocam Look




Hi!

I've got a Microdia Webcam, it's usb id is 0x0C45:0x60B0. According to the windows driver it has a SN9C103 bridge and the sensor is OV7630. The module sn9c102 provided with the stock kernel works but it gives me very wrong colors.

I've been playing with gspcav2 to make it work, but with no success. I've got usb sniff logs from Windows and I've patched the sonixb.c file to fit my logs. There are a few differences, maybe they are not that important.

With this patch, the webcam turns on the green light when an application starts the webcam (skype, amsn, camorama, xcam...) but there's only garbage. If I try with grab (from http://moinejf.free.fr/grab.c) the program tells that the select timeouts.

I've got logs from Windows, from USBMon, dmesg available if that helps. I'm attaching the patch I've made, but it's work in progress.

I've been looking for documentation about the SN9C103 bridge and I couldn't find much. I've would like to know if am on the right track (should this webcam be on sonixj.c instead?).

Thanks in advance,

                                        Andoni

PS: Forgive my English, it's not very good.

--- gspcav2-2.0.3.orig/sonixb.c	2008-06-17 08:28:36.000000000 -0300
+++ gspcav2-2.0.3/sonixb.c	2008-06-22 17:18:18.000000000 -0300
@@ -203,13 +203,13 @@
 	{0xa0, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10},
 	{0xb0, 0x21, 0x01, 0x77, 0x3a, 0x00, 0x00, 0x10},
 /*	{0xd0, 0x21, 0x12, 0x7c, 0x01, 0x80, 0x34, 0x10},	   jfm */
-	{0xd0, 0x21, 0x12, 0x78, 0x01, 0x80, 0x34, 0x10},	/* jfm */
+	{0xd0, 0x21, 0x12, 0x78, 0x00, 0x80, 0x34, 0x10},	/* jfm */
 	{0xa0, 0x21, 0x1b, 0x04, 0x00, 0x80, 0x34, 0x10},
 	{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 */
@@ -230,11 +230,20 @@
 	{0xb0, 0x21, 0x2a, 0xa0, 0x1f, 0x06, 0xf6, 0x1d},
 #endif
 };
+/*
 static const __u8 ov7630_sensor_init2[][8] = {
 	{0xa0, 0x21, 0x11, 0x01, 0xbd, 0x06, 0xf6, 0x10},
 	{0xa0, 0x21, 0x10, 0x57, 0xbd, 0x06, 0xf6, 0x16},
 	{0xa0, 0x21, 0x76, 0x02, 0xbd, 0x06, 0xf6, 0x16},
-	{0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},	/* gain */
+	{0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},
+};
+*/
+static const __u8 ov7630_sensor_init2[][8] = {
+	{0xa0, 0x21, 0x10, 0x36, 0xbd, 0x06, 0xf6, 0x16},
+	{0xa0, 0x21, 0x76, 0x03, 0xbd, 0x06, 0xf6, 0x16},
+	{0xa0, 0x21, 0x11, 0x01, 0xbd, 0x06, 0xf6, 0x16},
+	{0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},
+	{0xb0, 0x21, 0x2a, 0xa0, 0x1c, 0x06, 0xf6, 0x1d},
 };
 static __u8 tas5110_sensor_init[][8] = {
 	{0x30, 0x11, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x10},
@@ -509,6 +518,9 @@
 		case 0x60af:			/* SN9C103 */
 			sd->sensor = SENSOR_PAS202;
 			break;
+		case 0x60b0:                    /* SN9C102 */
+			sd->sensor = SENSOR_OV7630;
+			break;
 		}
 /*		break; */
 /*	} */
@@ -564,45 +576,50 @@
    	return 0;
 }
 
-static void ov7630_start(struct gspca_dev *gspca_dev)
+static int ov7630_start(struct gspca_dev *gspca_dev)
 {
 	int mode;
 	__u8 tmp[2];
 	static const __u8 reg1[] = {
-		0x04, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
-		0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80,
+		0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+		0x00, 0x01, 0x01, 0x0a, 0x16, 0x12, 0x68, 0x8f,
+		0x20, 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00,
+		0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80,
+                0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0xff
 	};
-	static __u8 reg17[] = {0x68, 0x8f, MCK_INIT1};	/* reg17[0] = comp */
+	static __u8 reg17[] = {0x68, 0x8f};	/* reg17[0] = comp */
 	static const __u8 reg1c[] = {0x02, 0x03, 0x0f, 0x0c};
 
 	mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
-	reg17[1] = mode << 4 | COMP2;
-	tmp[0] = 0x06;
+	//reg17[1] = mode << 4 | COMP2;
+	tmp[0] = 0x44;
 	reg_w(gspca_dev->dev, 0x01, tmp, 1);
-	tmp[0] = 0x29;
+	tmp[0] = 0x68;
 	reg_w(gspca_dev->dev, 0x17, tmp, 1);
-	tmp[0] = 0x06;
+	tmp[0] = 0x44;
 	tmp[1] = 0x44;
 	reg_w(gspca_dev->dev, 0x01, tmp, 2);
 	reg_w(gspca_dev->dev, 0x01, reg1, sizeof reg1);
-	msleep(200);
 	i2c_w_vector(gspca_dev->dev, ov7630_sensor_init1[0],
 			sizeof ov7630_sensor_init1);
-	tmp[0] = 0x04;
-	reg_w(gspca_dev->dev, 0x01, tmp, 1);
-	reg_w(gspca_dev->dev, 0x17, reg17, sizeof reg17);
 	msleep(200);
 	reg_w(gspca_dev->dev, 0x1c, reg1c, sizeof reg1c);
 	tmp[0] = 0x28;
 	tmp[1] = 0x1e;
 	reg_w(gspca_dev->dev, 0x15, tmp, 2);
 	reg_w(gspca_dev->dev, 0x18, &reg17[1], 1);
-	tmp[0] = 0x04;
+	tmp[0] = 0x44;
 	reg_w(gspca_dev->dev, 0x01, tmp, 1);
+	reg_w(gspca_dev->dev, 0x17, reg17, sizeof reg17);
+//	tmp[0] = 0x04;
+//	reg_w(gspca_dev->dev, 0x01, tmp, 1);
+	msleep(200);
 	i2c_w_vector(gspca_dev->dev, ov7630_sensor_init2[0],
 			sizeof ov7630_sensor_init2);
-	reg_w(gspca_dev->dev, 0x01, tmp, 1);
-	reg_w(gspca_dev->dev, 0x17, reg17, sizeof reg17);
+	//reg_w(gspca_dev->dev, 0x01, tmp, 1);
+	//reg_w(gspca_dev->dev, 0x17, reg17, sizeof reg17);
+	return 0;
 }
 
 static int pas106_I2cinit(struct gspca_dev *gspca_dev)
@@ -1062,6 +1085,7 @@
 	{USB_DEVICE(0x0c45, 0x602d), DVNM("LIC-200 LG")},
 	{USB_DEVICE(0x0c45, 0x602e), DVNM("Genius VideoCam Messenger")},
 	{USB_DEVICE(0x0c45, 0x60af), DVNM("Trust WB3100P")},
+	{USB_DEVICE(0x0c45, 0x60b0), DVNM("Genius VideoCam Look")},
 	{}
 };
 MODULE_DEVICE_TABLE(usb, device_table);
-------------------------------------------------------------------------
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