sorry for the delay (it's been a hard week for me), here's the patch I
promised that adds start-/stop-functions for device 6270.
It's based on 5 logs from Boris, Alex and me. I've put lots of comments
into the code that describe open issues and assumptions.
Please test it (play around with it) and send feedback !
Like in the init function, there is an I2C-read-attempt from an unknown
slave (0x50 this time). Please check if you cam succeeds here (=> dmesg).
It seems that decoding of uncompressed stream works ? Congratulations
!!! I will test it as soon as possible and send feedback !
Frank
I'm sending to you my dmesg, 2 files. In the first one I created the
dmesg file, after load the module. The second. a created after use the
mplayer command.
I cant found the overflow buffer error, so i think that I'm doing
something wrong.
Anyway, I think that this can help.
> /**
> * @brief From 5 start-stop-logs (made by Alex Carlos, Boris Borisov and Comer352l)
> *
> * @param dev
> *
> * @returns 0 (ok) or -1 (error)
> *
> * @author Comer352l
> *
> * Windows driver versions: 5.7.23.000
> * Windows versions: 2000 and XP
> * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
> * All logs were made using AMCAP with 640x480, RGB24
> */
> int microdia_6270_start_stream(struct usb_microdia *dev)
> {
> __u8 buf[64];
> __u8 last_11b8[1];
> int k;
> int retI2C;
> __u8 sensor_slave_id = 0x5c;
> __u8 i2c_flags = SN9C20X_I2C_2WIRE;
>
> // <= INTERRUPT COMING BACK (URB 1953)
> // SWITCH TO ALTERNATE SETTINGS 8 (URB 1954) // NOT IN ALEX'S LOG !
> // => INTERRUPT GOING DOWN (URB 1955)
>
> buf[0] = 0x00;
> usb_microdia_control_write(dev, 0x1066, buf, 1); // URB 1956
>
> // <= INTERRUPT COMING BACK (URB 1955)
> // => INTERRUPT GOING DOWN (URB 1957)
>
> buf[0] = 0x78;
> usb_microdia_control_write(dev, 0x1000, buf, 1); // URB 1958
> buf[0] = 0xc7;
> usb_microdia_control_write(dev, 0x1001, buf, 1); // URB 1959
> buf[0] = 0x18;
> usb_microdia_control_write(dev, 0x1002, buf, 1); // URB 1960
> buf[0] = 0x01;
> usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 1961
> buf[0] = 0x80;
> usb_microdia_control_write(dev, 0x1020, buf, 1); // URB 1962
> buf[0] = 0x40; buf[1] = 0x30; buf[2] = 0x20; buf[3] = 0x10; buf[4] = 0x08;
> usb_microdia_control_write(dev, 0x1067, buf, 5); // URB 1963
>
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // STRANGE I2C MESSAGE:
> // - 9 bytes
> // - byte 8 = 0x00 at first start + first cycle
> // - procedure not complete: no wait/check for ack/error, no readout of 0x10c2
> // - dummy writes at first cycle and read at second cycle, but there are many I2C messages in the meantime, so this should not work
> //
> // AT FIRST START + FIRST CYCLE:
> //buf[0] = 0x80; buf[1] = 0x5c; buf[2] = 0x00; buf[3] = 0x00;
> //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x00; buf[8] = 0x03;
> // AT ALL FURTHER STARTS + FIRST CYCLE:
> // I2C MESSAGE => IFP Register 0x33: Auto exposure
> buf[0] = 0x90; buf[1] = 0x5c; buf[2] = 0x33; buf[3] = 0x00;
> buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
> // ALWAYS AT 2nd CYCLE:
> //buf[0] = 0xa2; buf[1] = 0x5c; buf[2] = 0x00; buf[3] = 0x36;
> //buf[4] = 0x00; buf[5] = 0x82; buf[6] = 0x3a; buf[7] = 0x10; buf[8] = 0x03;
> // => buf[3] to buf[6] simply contain bytes read with URB 2215
> usb_microdia_control_write(dev, 0x10c0, buf, 9); // URB 1964
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x45; buf[1] = 0x18; buf[2] = 0x00; buf[3] = 0x30;
> buf[4] = 0x00; buf[5] = 0x09; buf[6] = 0x00; buf[7] = 0xed;
> buf[8] = 0x0f; buf[9] = 0xda; buf[10] = 0x0f; buf[11] = 0x3a;
> buf[12] = 0x00; buf[13] = 0x3a; buf[14] = 0x00; buf[15] = 0xd0;
> buf[16] = 0x0f; buf[17] = 0xf7; buf[18] = 0x0f; buf[19] = 0x00;
> buf[20] = 0x00; buf[21] = 0x00; buf[22] = 0x60; buf[23] = 0x0a;
> usb_microdia_control_write(dev, 0x10e0, buf, 24); // URB 1965
> buf[0] = 0x00; buf[1] = 0x00; buf[2] = 0x00;
> usb_microdia_control_write(dev, 0x10f8, buf, 3); // URB 1966
> buf[0] = 0x00; buf[1] = 0xa0; buf[2] = 0x00; buf[3] = 0xf0; buf[4] = 0x00;
> usb_microdia_control_write(dev, 0x10fb, buf, 5); // URB 1967
> buf[0] = 0x06; buf[1] = 0x0c; buf[2] = 0x08;
> usb_microdia_control_write(dev, 0x1188, buf, 3); // URB 1968
> buf[0] = 0x00; buf[1] = 0x20; buf[2] = 0x20; buf[3] = 0x20;
> buf[4] = 0x20; buf[5] = 0x00; buf[6] = 0x24; buf[7] = 0x3b;
> buf[8] = 0x4f; buf[9] = 0x61; buf[10] = 0x71; buf[11] = 0x80;
> buf[12] = 0x8f; buf[13] = 0x9d; buf[14] = 0xab; buf[15] = 0xb8;
> buf[16] = 0xc4; buf[17] = 0xd1; buf[18] = 0xdd; buf[19] = 0xe9;
> buf[20] = 0xf4; buf[21] = 0xff;
> usb_microdia_control_write(dev, 0x118b, buf, 22); // URB 1969
> buf[0] = 0x00; buf[1] = 0x00;
> usb_microdia_control_write(dev, 0x11a1, buf, 2); // URB 1970
> buf[0] = 0x60; buf[1] = 0x28; buf[2] = 0x00; buf[3] = 0x08;
> buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x00;
> buf[8] = 0x00;
> usb_microdia_control_write(dev, 0x11b7, buf, 9); // URB 1971
> buf[0] = 0x38;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 1972
> buf[0] = 0x78;
> usb_microdia_control_write(dev, 0x1000, buf, 1); // URB 1973
>
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGES
> retI2C = 0;
> // Write to IFP register 0x0d: Color Correction Register 8
> buf[0] = 0x00; buf[1] = 0x01;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x0d, i2c_flags, buf); // URBs 1974-1976
> // Write to IFP register 0x0d: Color Correction Register 8
> buf[0] = 0x00; buf[1] = 0x00; // ???
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x0d, i2c_flags, buf); // URBs 1977-1979
> // Writes to IFP registers 0x01: Register Address Space Selection
> // 0x02: Color Correction Register 1
> buf[0] = 0x00; buf[1] = 0x01; // select IFP address space
> buf[2] = 0x00; buf[3] = 0x16; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x01, i2c_flags, buf); // URBs 1980-1982
> // Writes to IFP registers 0x03: Color Correction Register 3
> // 0x04: Color Correction Register 4
> buf[0] = 0x01; buf[1] = 0xe1; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
> buf[2] = 0x02; buf[3] = 0x81; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x03, i2c_flags, buf); // URBs 1983-1985
> // Writes to IFP registers 0x05: Aperture Correction (Sharpening)
> // 0x06: Operating Mode Control
> buf[0] = 0x00; buf[1] = 0x04; // 100% sharpening, no automatic sharpness reduction at low light // AT FIRST START + FIRST CYCLE: 0x00 0x00: no sharpening
> buf[2] = 0x00; buf[3] = 0x00; // stop AWB at the current values, no on-the-fly defect correction, no auto exposure, + RESREVED option
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x05, i2c_flags, buf); // URBs 1986-1988
> // Writes to IFP registers 0x07: Image Flow Processor Soft Reset
> // 0x08: Output Format Control
> buf[0] = 0x30; buf[1] = 0x02; // reset // AT FIRST START + FIRST CYCLE: 0x00 0x00
> buf[2] = 0x04; buf[3] = 0x80; // bypass entire image processing, raw 8+2 Bayer data output directly
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x07, i2c_flags, buf); // URBs 1989-1991
> // "Dummy" write to IFP Register 0x11: Color Correction Register 12
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 0, 0x11, i2c_flags, NULL); // URBs 1992-1993
> // Write to register 0x01: Register address space selection
> // Write to sensor register 0x02: Column Start
> buf[0] = 0x00; buf[1] = 0x04; // select sensor address space
> buf[2] = 0x00; buf[3] = 0x16; // start with column 22
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x01, i2c_flags, buf); // URBs 1994-1996
> // Writes to sensor registers 0x03: Window Height
> // 0x04: Window Width
> buf[0] = 0x01; buf[1] = 0xe6; // 486
> buf[2] = 0x02; buf[3] = 0x86; // 646
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x03, i2c_flags, buf); // URBs 1997-1999
> // Writes to sensor registers 0x05: Horizontal Blanking
> // 0x06: Vertical Blanking
> buf[0] = 0x00; buf[1] = 0x04; // 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00
> buf[2] = 0x00; buf[3] = 0x00; // 0 rows
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x05, i2c_flags, buf); // URBs 2000-2002
> // Writes to sensor registers 0x07: Output Control
> // 0x08: Row Start
> buf[0] = 0x30; buf[1] = 0x02; // normal operation + chip enable + RESERVED options
> buf[2] = 0x00; buf[3] = 0x08; // row 8
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x07, i2c_flags, buf); // URBs 2003-2005
> // "Dummy" write to sensor Register 0x11: UNDOCUMENTED
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 0, 0x11, i2c_flags, NULL); // URBs 2006-2007
> // Writes to sensor registers 0x0c: Shutter Delay
> // 0x0d: Reset (Soft) (from MT9V011 datasheet)
> buf[0] = 0x00; buf[1] = 0x00; // 0 master clocks
> buf[2] = 0x00; buf[3] = 0x00; // return to normal operation
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x0c, i2c_flags, buf); // URBs 2008-2010
> // Writes to sensor registers 0x0e: UNDOCUMENTED
> // 0x0f: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x0e, i2c_flags, buf); // URBs 2011-2013
> // Writes to sensor registers 0x10: UNDOCUMENTED
> // 0x11: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x10, i2c_flags, buf); // URBs 2014-2016
> // Writes to sensor registers 0x12: 2X Zoom Col Start => 0x1e bit 0 must be set to activate zoom
> // 0x13: 2X Zoom Row Start => 0x1e bit 0 must be set to activate zoom
> buf[0] = 0x00; buf[1] = 0xb0; // column 176
> buf[2] = 0x00; buf[3] = 0x7c; // row 124
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x12, i2c_flags, buf); // URBs 2017-2018
> // Writes to sensor registers 0x14: UNDOCUMENTED
> // 0x15: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x14, i2c_flags, buf); // URBs 2019-2021
> // Writes to sensor registers 0x16: UNDOCUMENTED
> // 0x17: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x16, i2c_flags, buf); // URBs 2022-2024
> // Writes to sensor registers 0x18: UNDOCUMENTED
> // 0x19: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x18, i2c_flags, buf); // URBs 2025-2027
> // Writes to sensor registers 0x1a: UNDOCUMENTED
> // 0x1b: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x1a, i2c_flags, buf); // URBs 2028-2030
> // Writes to sensor registers 0x1c: UNDOCUMENTED
> // 0x1d: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x00;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x1c, i2c_flags, buf); // URBs 2031-2033
> // Write to sensor register 0x30: RESERVED
> buf[0] = 0x00; buf[1] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x30, i2c_flags, buf); // URBs 2034-2036
> // Write to sensor register 0x20: Read Mode
> buf[0] = 0x00; buf[1] = 0x00; // normal readout
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x20, i2c_flags, buf); // URBs 2037-2039
> // Writes to sensor registers 0x30: RESERVED
> // 0x31: RESERVED
> buf[0] = 0x00; buf[1] = 0x05;
> buf[2] = 0x00; buf[3] = 0x00;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x30, i2c_flags, buf); // URBs 2040-2042
> // "Dummy" write to sensor Register 0x34: RESERVED
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 0, 0x34, i2c_flags, NULL); // URBs 2043-2044
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 1 !\n", -retI2C);
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
> // *** TEMPORARY SWITCH TO SLAVE ADDRESS 0x50, I2C READ ATTEMPT:
> // - WE CURRENTLY KNOW NO 6270 CAM THAT IS SUCCESSFULLY READ HERE
> // - IF READ FAILS, THIS IS NEVER DONE AGAIN (IN NEXT CYCLE OR FURTHER STARTS)
> usb_microdia_control_read(dev, 0x10c1, buf, 1); // returns 0x5c
> buf[0] = 0x50;
> usb_microdia_control_write(dev, 0x10c1, buf, 1);
> retI2C = sn9c20x_read_i2c_data(dev, 0x50, 1, 0x00, i2c_flags, buf);
> if (retI2C >= 0)
> UDIA_INFO("Read of address 0x00 from slave 0x50 successful:\n=> Please report this to micr...@googlegroups.com (http://groups.google.com/group/microdia) !\n");
> buf[0] = 0x5c;
> usb_microdia_control_write(dev, 0x10c1, buf, 1);
>
>
> buf[0] = 0x47; // ALEX: 0x44
> usb_microdia_control_write(dev, 0x10e0, buf, 1); // URB 2045
> buf[0] = 0x47; // ALEX: 0x04
> usb_microdia_control_write(dev, 0x10e0, buf, 1); // URB 2046
> buf[0] = 0xc6;
> usb_microdia_control_write(dev, 0x1001, buf, 1); // URB 2047
> buf[0] = 0xc4;
> usb_microdia_control_write(dev, 0x1001, buf, 1); // URB 2048
> buf[0] = 0x84; // ALEX: 0xc0
> usb_microdia_control_write(dev, 0x1001, buf, 1); // URB 2049
> /* ALEX:
> buf[0] = 0x40;
> usb_microdia_control_write(dev, 0x1001, buf, 1);
> */
>
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGES
> retI2C = 0;
> // Writes to sensor registers 0x02: Column Start
> // 0x03: Window Height
> buf[0] = 0x00; buf[1] = 0x16; // coulmn 22
> buf[2] = 0x01; buf[3] = 0xe1; // 481
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x02, i2c_flags, buf); // URBs 2050-2052
> // Writes to sensor registers 0x04: Window Width
> // 0x05: Horizontal Blanking
> buf[0] = 0x02; buf[1] = 0x81; // 641
> buf[2] = 0x00; buf[3] = 0x04; // 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x04, i2c_flags, buf); // URBs 2053-2055
> // Writes to sensor registers 0x06: Vertical Blanking
> // 0x07: Output Control
> buf[0] = 0x00; buf[1] = 0x00; // 0 rows
> buf[2] = 0x30; buf[3] = 0x02; // normal operation + chip enable + RESERVED options
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x06, i2c_flags, buf); // URBs 2056-2058
> // Write to sensor register 0x0e: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x08;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x0e, i2c_flags, buf); // URBs 2059-2061
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 2 !\n", -retI2C);
> return -1;
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x02; buf[1] = 0x00; buf[2] = 0x02; buf[3] = 0x00;
> buf[4] = 0x28; buf[5] = 0x3c;
> usb_microdia_control_write(dev, 0x1180, buf, 6); // URB 2062
> buf[0] = 0x00; buf[1] = 0xa0; buf[2] = 0x00; buf[3] = 0xf0; buf[4] = 0x00;
> usb_microdia_control_write(dev, 0x10fb, buf, 5); // URB 2063
> buf[0] = 0x0c;
> usb_microdia_control_write(dev, 0x1189, buf, 1); // URB 2064
> buf[0] = 0x00; buf[1] = 0x00; buf[2] = 0x6a; buf[3] = 0x50;
> usb_microdia_control_write(dev, 0x11a1, buf, 4); // URB 2065
> buf[0] = 0x00; buf[1] = 0x00; buf[2] = 0x50; buf[3] = 0x3c;
> usb_microdia_control_write(dev, 0x11ab, buf, 4); // URB 2066
> buf[0] = 0x78; // ALEX: 0x7c
> usb_microdia_control_write(dev, 0x1000, buf, 1); // URB 2067
> buf[0] = 0x18; // ALEX: 0x1c
> usb_microdia_control_write(dev, 0x1002, buf, 1); // URB 2068
> buf[0] = 0x18; // ALEX: 0x1c
> usb_microdia_control_write(dev, 0x1002, buf, 1); // URB 2069
> buf[0] = 0x38;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2070
> buf[0] = 0x04;
> usb_microdia_control_write(dev, 0x118a, buf, 1); // URB 2071
> buf[0] = 0x04;
> usb_microdia_control_write(dev, 0x0395, buf, 1); // URB 2072
>
> buf[0] = 0x78;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2073
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2074 // 0x38
> if (buf[0] == 0x38)
> buf[0] = 0x79;
> else if (buf[0] == 0xb8)
> buf[0] = 0xf9;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2075
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2076 // 0xb9
> if (buf[0] == 0x39)
> buf[0] = 0x7a;
> else if (buf[0] == 0xb9)
> buf[0] = 0xfa;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2077
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2078
> if (buf[0] == 0x3a)
> buf[0] = 0x7b;
> else if (buf[0] == 0xba)
> buf[0] = 0xfb;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2079
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2080 // 0x3b
> if (buf[0] == 0x3b)
> buf[0] = 0x7c;
> else if (buf[0] == 0xbb)
> buf[0] = 0xfc;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2081
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2082 // 0x3c
> if (buf[0] == 0x3c)
> buf[0] = 0x7d;
> else if (buf[0] == 0xbc)
> buf[0] = 0xfd;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2083
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2084 // 0x3d
> if (buf[0] == 0x3d)
> buf[0] = 0x7e;
> else if (buf[0] == 0xbd)
> buf[0] = 0xfe;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2085
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2086
> if (buf[0] == 0x3e)
> buf[0] = 0x7f;
> else if (buf[0] == 0xbe)
> buf[0] = 0xff;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2087
> usb_microdia_control_read(dev, 0x11b8, last_11b8, 1); // URB 2088
> if (last_11b8[0] == 0x3f)
> buf[0] = 0x70;
> else if (last_11b8[0] == 0xbf)
> buf[0] = 0xf0;
> buf[0] = buf[0] | 0x0d; // 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2089
>
>
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGES
> retI2C = 0;
> // Write to sensor register 0x06: Vertical Blanking
> buf[0] = 0x00; buf[1] = 0x2d; // 45 rows
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x06, i2c_flags, buf); // URBs 2090-2092
> // Write to sensor register 0x05: Horizontal Blanking
> buf[0] = 0x00; buf[1] = 0x04; // 4 columns (pixel clocks)
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x05, i2c_flags, buf); // URBs 2093-2095
> // Write to sensor register 0x20: Read Mode
> buf[0] = 0x00; buf[1] = 0x00; // normal readout
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x20, i2c_flags, buf); // URBs 2096-2098
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 3 !\n", -retI2C);
> return -1;
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x02;
> usb_microdia_control_write(dev, 0x1180, buf, 1); // URB 2099
>
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGE
> retI2C = 0
> // Write to sensor register 0x20: Read Mode
> buf[0] = 0x00; buf[1] = 0x00; // normal readout
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x20, i2c_flags, buf); // URBs 2100-2102
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 4 !\n", -retI2C);
> return -1;
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x02;
> usb_microdia_control_write(dev, 0x1182, buf, 1); // URB 2103
>
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGES
> retI2C = 0;
> // Write to sensor register 0x09: Shutter Width
> buf[0] = 0x00; buf[1] = 0x64; // integration of 100 rows
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x09, i2c_flags, buf); // URBs 2104-2106
> // Write to sensor register 0x2b: Green 1 Gain
> // 0x2c: Blue Gain
> buf[0] = 0x00; buf[1] = 0xa0; // 32*0.03125*2 = 2
> buf[2] = 0x00; buf[3] = 0xa0; // 32*0.03125*2 = 2
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x2b, i2c_flags, buf); // URBs 2107-2109
> // Write to sensor register 0x2d: Red Gain
> // 0x2e: Green 2 Gain
> buf[0] = 0x00; buf[1] = 0xa0; // 32*0.03125*2 = 2
> buf[2] = 0x00; buf[3] = 0xa0; // 32*0.03125*2 = 2
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x2d, i2c_flags, buf); // URBs 2110-2112
> // "Dummy" write to sensor Register 0x33: RESERVED
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 0, 0x33, i2c_flags, NULL); // URBs 2113-2114
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 5 !\n", -retI2C);
> return -1;
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118c, buf, 1); // URB 2115
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118d, buf, 1); // URB 2116
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118e, buf, 1); // URB 2117
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118f, buf, 1); // URB 2118
> buf[0] = 0x0a;
> usb_microdia_control_write(dev, 0x11ba, buf, 1); // URB 2119
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118c, buf, 1); // URB 2120
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118d, buf, 1); // URB 2121
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118e, buf, 1); // URB 2122
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118f, buf, 1); // URB 2123
> buf[0] = 0x14;
> usb_microdia_control_write(dev, 0x118b, buf, 1); // URB 2124
> buf[0] = 0x0a; buf[1] = 0x36; buf[2] = 0x56; buf[3] = 0x6e;
> buf[4] = 0x7f; buf[5] = 0x8d; buf[6] = 0x9b; buf[7] = 0xa8;
> buf[8] = 0xb4; buf[9] = 0xbd; buf[10] = 0xc7; buf[11] = 0xd0;
> buf[12] = 0xd9; buf[13] = 0xe2; buf[14] = 0xec; buf[15] = 0xf0;
> buf[16] = 0xf5;
> usb_microdia_control_write(dev, 0x1190, buf, 17); // URB 2125
>
> buf[0] = 0x16; buf[1] = 0x00; buf[2] = 0x2b; buf[3] = 0x00;
> buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xf6; buf[7] = 0x0f;
> buf[8] = 0xd2; buf[9] = 0x0f; buf[10] = 0x38; buf[11] = 0x00;
> buf[12] = 0x34; buf[13] = 0x00; buf[14] = 0xcf; buf[15] = 0x0f;
> buf[16] = 0xfd; buf[17] = 0x0f; buf[18] = 0x00; buf[19] = 0x00;
> buf[20] = 0x00;
> for (k=0; k<9; k++) // AT FIRST START + FIRST CYCLE: first 8 writes 21 bytes 0x00
> {
> usb_microdia_control_write(dev, 0x10e1, buf, 21); // URB 2126 - 2134
> }
>
> buf[0] = 0x07;
> usb_microdia_control_write(dev, 0x10f7, buf, 1); // URB 2135
> buf[0] = 0x18; // ALEX: 0x00
> usb_microdia_control_write(dev, 0x10f6, buf, 1); // URB 2136
> buf[0] = 0x16; buf[1] = 0x00; buf[2] = 0x2b; buf[3] = 0x00;
> buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xf6; buf[7] = 0x0f;
> buf[8] = 0xd2; buf[9] = 0x0f; buf[10] = 0x38; buf[11] = 0x00;
> buf[12] = 0x34; buf[13] = 0x00; buf[14] = 0xcf; buf[15] = 0x0f;
> buf[16] = 0xfd; buf[17] = 0x0f; buf[18] = 0x00; buf[19] = 0x00;
> buf[20] = 0x00;
> usb_microdia_control_write(dev, 0x10e1, buf, 21); // URB 2137
> buf[0] = 0x01;
> usb_microdia_control_write(dev, 0x10f8, buf, 1); // URB 2138
> buf[0] = 0x0a;
> usb_microdia_control_write(dev, 0x10fa, buf, 1); // URB 2139
> buf[0] = 0x00;
> usb_microdia_control_write(dev, 0x10f9, buf, 1); // URB 2140
> buf[0] = 0x00;
> usb_microdia_control_write(dev, 0x10f9, buf, 1); // URB 2141
> buf[0] = 0x0a;
> usb_microdia_control_write(dev, 0x11ba, buf, 1); // URB 2142
> buf[0] = 0x00; buf[1] = 0x00; buf[2] = 0x00; buf[3] = 0x00;
> usb_microdia_control_write(dev, 0x11bc, buf, 4); // URB 2143
> for (k=0; k<48; k++) buf[k] = 0x00;
> usb_microdia_control_write(dev, 0x11c0, buf, 48); // URB 2144
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118c, buf, 1); // URB 2145
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118d, buf, 1); // URB 2146
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118e, buf, 1); // URB 2147
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x118f, buf, 1); // URB 2148
> buf[0] = 0x2d; buf[1] = 0x2d; buf[2] = 0x3a; buf[3] = 0x05;
> buf[4] = 0x04; buf[5] = 0x3f;
> usb_microdia_control_write(dev, 0x11a5, buf, 6); // URB 2149
> buf[0] = 0x14; buf[1] = 0xec; buf[2] = 0x0a; buf[3] = 0xf6;
> usb_microdia_control_write(dev, 0x11af, buf, 4); // URB 2150
> buf[0] = 0x32; buf[1] = 0xdd; buf[2] = 0x2d; buf[3] = 0xdd;
> usb_microdia_control_write(dev, 0x11b3, buf, 4); // URB 2151
> buf[0] = 0x47; // ALEX: 0x04
> usb_microdia_control_write(dev, 0x10e0, buf, 1); // URB 2152
> buf[0] = 0x01;
> usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 2153
> buf[0] = 0x67; // ALEX: 0x24
> usb_microdia_control_write(dev, 0x10e0, buf, 1); // URB 2154
> buf[0] = 0x0d; buf[1] = 0x08; buf[2] = 0x08; buf[3] = 0x0d;
> buf[4] = 0x08; buf[5] = 0x08; buf[6] = 0x0d; buf[7] = 0x0d;
> buf[8] = 0x0d; buf[9] = 0x0d; buf[10] = 0x11; buf[11] = 0x0d;
> buf[12] = 0x0d; buf[13] = 0x11; buf[14] = 0x15; buf[15] = 0x21;
> buf[16] = 0x15; buf[17] = 0x15; buf[18] = 0x11; buf[19] = 0x11;
> buf[20] = 0x15; buf[21] = 0x2a; buf[22] = 0x1d; buf[23] = 0x1d;
> buf[24] = 0x19; buf[25] = 0x21; buf[26] = 0x32; buf[27] = 0x2a;
> buf[28] = 0x32; buf[29] = 0x32; buf[30] = 0x2e; buf[31] = 0x2a;
> buf[32] = 0x2e; buf[33] = 0x2e; buf[34] = 0x36; buf[35] = 0x3a;
> buf[36] = 0x4b; buf[37] = 0x43; buf[38] = 0x36; buf[39] = 0x3a;
> buf[40] = 0x47; buf[41] = 0x3a; buf[42] = 0x2e; buf[43] = 0x2e;
> buf[44] = 0x43; buf[45] = 0x5c; buf[46] = 0x43; buf[47] = 0x47;
> buf[48]= 0x4f; buf[49] = 0x53; buf[50] = 0x58; buf[51] = 0x58;
> buf[52] = 0x58; buf[53] = 0x32; buf[54] = 0x3f; buf[55] = 0x60;
> buf[56] = 0x64; buf[57] = 0x5c; buf[58] = 0x53; buf[59] = 0x64;
> buf[60] = 0x4b; buf[61] = 0x53; buf[62] = 0x58; buf[63] = 0x53;
> usb_microdia_control_write(dev, 0x1100, buf, 64); // URB 2155
> buf[0] = 0x0d; buf[1] = 0x11; buf[2] = 0x11; buf[3] = 0x15;
> buf[4] = 0x11; buf[5] = 0x15; buf[6] = 0x26; buf[7] = 0x15;
> buf[8] = 0x15; buf[9] = 0x26; buf[10] = 0x53; buf[11] = 0x36;
> buf[12] = 0x2e; buf[13] = 0x36; buf[14] = 0x53; buf[15] = 0x53;
> buf[16] = 0x53; buf[17] = 0x53; buf[18] = 0x53; buf[19] = 0x53;
> buf[20] = 0x53; buf[21] = 0x53; buf[22] = 0x53; buf[23] = 0x53;
> buf[24] = 0x53; buf[25] = 0x53; buf[26] = 0x53; buf[27] = 0x53;
> buf[28] = 0x53; buf[29] = 0x53; buf[30] = 0x53; buf[31] = 0x53;
> buf[32] = 0x53; buf[33] = 0x53; buf[34] = 0x53; buf[35] = 0x53;
> buf[36] = 0x53; buf[37] = 0x53; buf[38] = 0x53; buf[39] = 0x53;
> buf[40] = 0x53; buf[41] = 0x53; buf[42] = 0x53; buf[43] = 0x53;
> buf[44] = 0x53; buf[45] = 0x53; buf[46] = 0x53; buf[47] = 0x53;
> buf[48] = 0x53; buf[49] = 0x53; buf[50] = 0x53; buf[51] = 0x53;
> buf[52] = 0x53; buf[53] = 0x53; buf[54] = 0x53; buf[55] = 0x53;
> buf[56] = 0x53; buf[57] = 0x53; buf[58] = 0x53; buf[59] = 0x53;
> buf[60] = 0x53; buf[61] = 0x53; buf[62] = 0x53; buf[63] = 0x53;
> usb_microdia_control_write(dev, 0x1140, buf, 64); // URB 2156
> buf[0] = 0x47; // ALEX: 0x04
> usb_microdia_control_write(dev, 0x10e0, buf, 1); // URB 2157
> buf[0] = 0x03;
> usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 2158
> buf[0] = 0x4b; // ALEX: 0x08
> usb_microdia_control_write(dev, 0x10e0, buf, 1); // URB 2159
>
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGES
> retI2C = 0;
> // Writes to sensor registers 0x02: Column Start
> // 0x03: Window Hight
> buf[0] = 0x00; buf[1] = 0x16; // coulmn 22
> buf[2] = 0x01; buf[3] = 0xe1; // 481
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x02, i2c_flags, buf); // URBs 2160-2162
> // Writes to sensor registers 0x04: Window Width
> // 0x05: Horizontal Blanking
> buf[0] = 0x02; buf[1] = 0x81; // 641
> buf[2] = 0x00; buf[3] = 0x04; // 4 columns (pixel clocks)
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x04, i2c_flags, buf); // URBs 2163-2165
> // Writes to sensor registers 0x06: Vertical Blanking
> // 0x07: Output Control
> buf[0] = 0x00; buf[1] = 0x2d; // 45 rows
> buf[2] = 0x30; buf[3] = 0x02; // RESERVED options
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 4, 0x06, i2c_flags, buf); // URBs 2166-2167
> // Writes to sensor register 0x0e: UNDOCUMENTED
> buf[0] = 0x00; buf[1] = 0x08;
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x0e, i2c_flags, buf); // URBs 2168-2170
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 6 !\n", -retI2C);
> return -1;
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x02; buf[1] = 0x00; buf[2] = 0x02; buf[3] = 0x00;
> buf[4] = 0x28; buf[5] = 0x3c;
> usb_microdia_control_write(dev, 0x1180, buf, 6); // URB 2171
> buf[0] = 0x00; buf[1] = 0xa0; buf[2] = 0x00; buf[3] = 0xf0; buf[4] = 0x00;
> usb_microdia_control_write(dev, 0x10fb, buf, 5); // URB 2172
> buf[0] = 0x0c;
> usb_microdia_control_write(dev, 0x1189, buf, 1); // URB 2173
> buf[0] = 0x00; buf[1] = 0x00; buf[2] = 0x6a; buf[3] = 0x50;
> usb_microdia_control_write(dev, 0x11a1, buf, 4); // URB 2174
> buf[0] = 0x00; buf[1] = 0x00; buf[2] = 0x50; buf[3] = 0x3c;
> usb_microdia_control_write(dev, 0x11ab, buf, 4); // URB 2175
> buf[0] = 0x03;
> usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 2176
> buf[0] = 0x0a;
> usb_microdia_control_write(dev, 0x11ba, buf, 1); // URB 2177
> buf[0] = 0x00;
> usb_microdia_control_write(dev, 0x11b9, buf, 1); // URB 2178
> buf[0] = 0x0b;
> usb_microdia_control_write(dev, 0x11ba, buf, 1); // URB 2179
> buf[0] = 0x01;
> usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 2180
> buf[0] = 0x78; // ALEX: 0x7c
> usb_microdia_control_write(dev, 0x1000, buf, 1); // URB 2181
> buf[0] = 0x18; // ALEX: 0x1c
> usb_microdia_control_write(dev, 0x1002, buf, 1); // URB 2182
> buf[0] = 0x18; // ALEX: 0x1c
> usb_microdia_control_write(dev, 0x1002, buf, 1); // URB 2183
> buf[0] = 0x7d; // ALEX: 0xfc
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2184
> buf[0] = 0x04;
> usb_microdia_control_write(dev, 0x118a, buf, 1); // URB 2185
> buf[0] = 0x04;
> usb_microdia_control_write(dev, 0x0395, buf, 1); // URB 2186
>
> if (last_11b8[0] == 0x3f)
> buf[0] = 0x78;
> else if (last_11b8[0] == 0xbf)
> buf[0] = 0xf8;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2187
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2188 // 0x38
> if (buf[0] == 0x38)
> buf[0] = 0x79;
> else if (buf[0] == 0xb8)
> buf[0] = 0xf9;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2189
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2190 // 0xb9
> if (buf[0] == 0x39)
> buf[0] = 0x7a;
> else if (buf[0] == 0xb9)
> buf[0] = 0xfa;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2191
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2192 // 0xba
> if (buf[0] == 0x3a)
> buf[0] = 0x7b;
> else if (buf[0] == 0xba)
> buf[0] = 0xfb;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2193
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2194 // 0x3b
> if (buf[0] == 0x3b)
> buf[0] = 0x7c;
> else if (buf[0] == 0xbb)
> buf[0] = 0xfc;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2195
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2196 // 0x3c
> if (buf[0] == 0x3c)
> buf[0] = 0x7d;
> else if (buf[0] == 0xbc)
> buf[0] = 0xfd;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2197
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2198 // 0x3d
> if (buf[0] == 0x3d)
> buf[0] = 0x7e;
> else if (buf[0] == 0xbd)
> buf[0] = 0xfe;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2199
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2200
> if (buf[0] == 0x3e)
> buf[0] = 0x7f;
> else if (buf[0] == 0xbe)
> buf[0] = 0xff;
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2201
> usb_microdia_control_read(dev, 0x11b8, buf, 1); // URB 2202
> if (buf[0] == 0x3f)
> buf[0] = 0x70;
> else if (buf[0] == 0xbf)
> buf[0] = 0xf0;
> buf[0] = buf[0] | 0x0d; // 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES
> usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 2089
>
>
> // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> // I2C MESSAGES
> retI2C = 0;
> // Write to sensor register 0x06: Vertical Blanking
> buf[0] = 0x00; buf[1] = 0x2d; // 45 rows
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x06, i2c_flags, buf); // URBs 2204-2206
> // Write to sensor register 0x05: Horizontal Blanking
> buf[0] = 0x00; buf[1] = 0x04; // 4 columns (pixel clocks)
> retI2C += sn9c20x_write_i2c_data(dev, sensor_slave_id, 2, 0x05, i2c_flags, buf); // URBs 2207-2209
> // Read of sensor register 0x36: Chip Version (mirror of reg0xff)
> retI2C += sn9c20x_read_i2c_data(dev, sensor_slave_id, 2, 0x36, i2c_flags, buf); // URBs 2211-2215 // 0x82 0x3a
> if (retI2C < 0)
> {
> UDIA_INFO("%d errors occured in I2C-message-block 7 !\n", -retI2C);
> return -1;
> }
> // END OF I2C MESSAGES
> // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> buf[0] = 0x03;
> usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 2216
>
> /*** NOW DRIVER DOES STOP-SEQUENCE WITHOUT WRITES TO 0x1007 AND 0x1006 (URBs 3544-3550) ***/
> /*** 2nd CYCLE: ALL MESSAGES (URBs 1953 - URBs 2216) ARE REPEATED ***/
> /*** ----- WE DON'T DO THIS, IT SEEMS TO BE UNNECESSARY ----- ***/
>
> buf[0] = 0x20;
> usb_microdia_control_write(dev, 0x1007, buf, 8); // URB 2489
> buf[0] = 0x00;
> usb_microdia_control_write(dev, 0x1006, buf, 8); // URB 2490
> // => These two writes seem to cause the cam to start sending isochronus USB messages
>
> return 0;
> }
>
>
>
> /**
> * @brief From 5 start-stop-logs (made by Alex Carlos, Boris Borisov and Comer352l)
> *
> * @param dev
> *
> * @returns 0 (ok) or -1 (error)
> *
> * @author Comer352l
> *
> * Windows driver version: 5.7.23.000
> * Windows versions: 2000 and XP
> * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
> * All logs were made using AMCAP with 640x480, RGB24
> */
> int microdia_6270_stop_stream(struct usb_microdia *dev)
> {
> int ret = 0;
> __u8 buf[3];
>
> buf[0] = 0x20;
> ret += usb_microdia_control_write(dev, 0x1007, buf, 1); // URB 3541
> buf[0] = 0x20;
> ret += usb_microdia_control_write(dev, 0x1006, buf, 1); // URB 3542
> // => These two writes seem to cause the cam to stop sending isochronus USB messages
>
> buf[0] = 0x01;
> ret += usb_microdia_control_write(dev, 0x1061, buf, 1); // URB 3544
> buf[0] = 0x38; // ALEX: 0x3c
> ret += usb_microdia_control_write(dev, 0x1000, buf, 1); // URB 3545
> buf[0] = 0x6d; // ALEX: 0xec; FRANK: also 0x6c
> ret += usb_microdia_control_write(dev, 0x11b8, buf, 1); // URB 3546
> buf[0] = 0x38; buf[1] = 0xe7; buf[2] = 0x11;
> ret += usb_microdia_control_write(dev, 0x1000, buf, 3); // URB 3547
> // INTERRUPT COMMING BACK (URB 2227)
> // SELECT ALTERNATE SETTINGS (URB 3548)
> // INTERRUPT GOING DOWN (URB 3549)
> buf[0] = 0x00;
> ret += usb_microdia_control_write(dev, 0x1066, buf, 1); // URB 3550
>
> if (ret < 9)
> {
> UDIA_INFO("One ore more errors occured while stopping stream !\n");
> return -1;
> }
> else
> return 0;
> }
>
>
>
--
-------------------------------------
"O único lugar onde o sucesso vem
antes do trabalho é no dicionário"
(Albert Einstein)
Saulo Andrade Almeida
ICQ: 16456755
MSN: sauloa...@hotmail.com
Jabber: sauloa...@jaber.org
Skype: sauloaalmeida
Ahm yes, I forgot to mention that:
This is a known issue. It's not 6270 specific, some people with other
cams reported that overflow too.
For testing purposes, you can increase frame_size in microdia_v4l.c from
640*480=307200 to 640*480*1.5=460800.
I will try to fix it as soon as I find some time again (not before next
week). Maybe someone with more time wants to do this earlier.
Frank
Frank
Thanks for feedback, I will correct output of number of errors ;-)
Your dmesg output shows that all I2C operations failed, but I have no
Idea why. Could you investigate this (maybe simply try again) ?
Frank
Bobby
Frank
Btw, does driver work for you? It should now display good image (at least it
does for 624e, 624f, 6242)
Ahm sorry: same result as reported by Boris.
I just made a quick test using camorama and I get a stream but no clear
picture (see attachment).
Maybe it's simply RGB24 ? Hopefully, I will find some time this weekend...
Btw, thanks for great work !
Frank
There's nice function in driver: microdia_getraw. You can try to call it
instead of microdia_raw2bgr24 or microdia_raw2i420 to determine if your cam
produces rgb24 or i420 stream. Look at microdia_bayer.c (argggh, we should
rename this file :)))
Regards
Vasily
we should also replace all the sourceforge links from the files and add
some doxygen stuff "$ make doc" is always complaining about. An update
for README would be appropriate.
I'll make a patch tomorrow. ;-)
GWater
For today microdia driver works only with 624f, 624e and 6242 cams.
Actually we can use libjpeg in userspace tool :) We're not limited in using
libraries ;)
Regards
Vasily
Please correct me if I'm wrong
GWater
This is true for v4l2, but it isn't for v4l. Since our driver supports v4l
ioctls, it didn't harm to add jpeg-decoder into it. (Well, I don't like idea
of jpeg decoder in kernelspace, it will be better to find way how to disable
compression)
Why do you say that? One of the project's explicit goals was kernel
inclusion, and every indication I've seen is that no way will JPEG
decompression be accepted in the kernel -- I was not aware of this
being a V4L version issue.
Dave
GWater
> Why do you say that? One of the project's explicit goals was kernel
> inclusion, and every indication I've seen is that no way will JPEG
> decompression be accepted in the kernel -- I was not aware of this
> being a V4L version issue.
>
> Dave
Personally I don't like jpeg decoder in the kernel - and now driver doesn't
contains any cpu-eater-decoders. I prefer to find out how to enable\disable
compression. And v4l ioctls wasn't added by me, they already exist when I've
joined project ;) Should we drop them?
Btw, many userspace apps do not supports jpeg stream directly, what we should
do in case when we have jpeg only?
> Why do you say that? One of the project's explicit goals was kernel
> inclusion, and every indication I've seen is that no way will JPEG
> decompression be accepted in the kernel -- I was not aware of this
> being a V4L version issue.
>
> Dave
Btw, two branches can easily co-exist. One (main branch) - cleaned up - can be
included into the kernel, and another one with some hacks (i.e. jpeg-decoder,
etc) can be provided as patches to the main branch.
Regards
Vasily
Nope, gspca has the worst code style I ever seen.