Hi,

golan...@aol.com schrieb:
> I made the changes you suggested and troubleshot a few things and got
> the scanner to be found as a LiDE 60 with scanimage.  I got an invalid
> argument error when I tried to do 'scanimage >image.pnm'.
> 
> Below is a debugging log after I issued 'export
> SANE_DEBUG_GENESYS_GL841=255' and 'export SANE_DEBUG_SANEI_USB=255'.

Sometimes SANE_DEBUG_GENESYS=255 is interesting, too.

> ---Log---
> 
> [sanei_usb] sanei_usb_init: found libusb device (0x04a9/0x2214)
> interface 0  at libusb:001:009
> [sanei_usb] sanei_usb_init: found 1 devices
> ....
> [sanei_usb] sanei_usb_open: trying to open device `libusb:001:009'
> [sanei_usb] sanei_usb_open: configuration nr: 0
> [sanei_usb] sanei_usb_open:     interface nr: 0
> [sanei_usb] sanei_usb_open:   alt_setting nr: 0
> [sanei_usb] sanei_usb_open: endpoint nr: 0
> [sanei_usb] sanei_usb_open: direction: 128
> [sanei_usb] sanei_usb_open: address: 1 transfertype: 2
> [sanei_usb] sanei_usb_open: found bulk-in endpoint (address 0x01)
> [sanei_usb] sanei_usb_open: we already have a bulk-in endpoint (address:
> 0x81), ignoring the new one
> [sanei_usb] sanei_usb_open: endpoint nr: 1
> [sanei_usb] sanei_usb_open: direction: 0
> [sanei_usb] sanei_usb_open: address: 2 transfertype: 2
> [sanei_usb] sanei_usb_open: found bulk-out endpoint (address 0x02)
> [sanei_usb] sanei_usb_open: we already have a bulk-out endpoint
> (address: 0x02), ignoring the new one
> [sanei_usb] sanei_usb_open: endpoint nr: 2
> [sanei_usb] sanei_usb_open: direction: 128
> [sanei_usb] sanei_usb_open: address: 3 transfertype: 3
> [sanei_usb] sanei_usb_open: found interrupt-in endpoint (address 0x03)
> [sanei_usb] sanei_usb_open: we already have a int-in endpoint (address:
> 0x83), ignoring the new one
> [sanei_usb] sanei_usb_open: opened usb device `libusb:001:009' (*dn=0)
> [sanei_debug] Setting debug level of genesys_gl841 to 255.
> [genesys_gl841] gl841_init
> [genesys_gl841] gl841_init_registers
> [genesys_gl841] gl841_setup_sensor
> [genesys_gl841] gl841_init_registers complete
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 12, value = 135,
> index = 0, len = 1
> [sanei_usb] 0000: 04                                             
> ................
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 12, value = 131,
> index = 0, len = 1
> [sanei_usb] 0000: 0E                                             
> ................
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 12, value = 133,
> index = 0, len = 1
> [sanei_usb] 0000: 00                                             
> ................
> [genesys_gl841] gl841_bulk_write_register (size = 208)
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 01 A0                                          
> ................
> [genesys_gl841] reg[0x01] = 0xa0
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 02 38                                          
> .8..............
> [genesys_gl841] reg[0x02] = 0x38
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 03 5F                                          
> ._..............
> [genesys_gl841] reg[0x03] = 0x5f
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 04 10                                          
> ................
> [genesys_gl841] reg[0x04] = 0x10
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 05 40                                          
> .@..............
> [genesys_gl841] reg[0x05] = 0x40
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 06 18                                          
> ................
> [genesys_gl841] reg[0x06] = 0x18
> [sanei_usb] sanei_usb_control_msg: rtype = 0x40, req = 4, value = 131,
> index = 0, len = 2
> [sanei_usb] 0000: 07 00                                          
> ................
> USB error: error sending control message: Protocol error
> [sanei_usb] sanei_usb_control_msg: libusb complained: error sending
> control message: Protocol error
> [genesys_gl841] gl841_bulk_write_register: failed while writing command:
> Invalid argument
> scanimage: open of device genesys:libusb:001:009 failed: Invalid argument
> 
> I'm not sure if this is a problem with the backend not supporting my
> scanner or if I have made a mistake in the setup of the scanner.  Any
> help would be appreciated.
> 

This happens either with faulty usb equipment, or the scanner resets
itself. This happens when it short-circuits itself(i guess) responding
to an errorneous register write. I suspect register 0x03 is
responsible(lamp power etc.). The attached patch should clarify this, by
giving the scanner more time to react on the register writes. The last
successfull write should be the one leading to the reset.

Regards,
  Pierre
-------------- next part --------------
Index: backend/genesys_gl841.c
===================================================================
RCS file: /cvsroot/sane/sane-backends/backend/genesys_gl841.c,v
retrieving revision 1.3
diff -u -r1.3 genesys_gl841.c
--- backend/genesys_gl841.c     5 Dec 2005 20:50:57 -0000       1.3
+++ backend/genesys_gl841.c     28 Dec 2005 22:24:19 -0000
@@ -408,6 +408,7 @@
 
       DBG (DBG_io2, "reg[0x%02x] = 0x%02x\n", ((u_int8_t *) reg)[2 * i],
           ((u_int8_t *) reg)[2 * i + 1]);
+      usleep(100000);
   }
   
 
From che...@che-che.com  Thu Dec 29 02:15:33 2005
From: che...@che-che.com (Juan Jose Pablos)
Date: Thu Dec 29 02:16:07 2005
Subject: [sane-devel] usbsnoop for colorpage slim 1200
Message-ID: <43b346c5.2060...@che-che.com>

Hi,
I managed to get a log for the usb transation for this scanner. I do not
know if this would help on the development of  the genesys backend.
I just did a scan of a small portion. I had a look but I have to admit
that I do not know what it means, I would like to help, but I do not
know how. This output seems nothing to do with the output that I try on
the linux box.

My guest is that this needs more study, but a guide  would be nice.

Here is the log:
http://apertus.es/~cheche/usbsnoop_cps1200_051229.log.gz if anyone is
interested, just have a look

cheers,
cheche




Reply via email to