[sane-devel] Testprog for Canoscan lide 50 doesn't work - Error in usb_con.c

Gian Domeni Calgeer gidoca@loefisch.org
Sat Jul 9 20:19:55 UTC 2005

Hello everybody

I'm not sure wether this is the right mailinglist, but I thought I'll post it 
here because I found this testprogram for canoscan lide on the page of the 
Genesys backend. 
On my PC the program doesn't work with a canoscan lide 50. The message 'Fatal: 
Device not found!' is shown. It's a error in the file usb_con.c. If the 
scanner is the only usb-device connected to my PC and I replace line 84-94 of 
usb_con.c with the following line, I can scan without any problem: 
I debugged it with gdb. That was the result:

$ gdb testprog
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux"...Using host libthread_db library 

(gdb) break usb_con.c:83
Breakpoint 1 at 0x804ec35: file usb_con.c, line 83.
(gdb) run
program: /files/download/canoscan_linux/canon-lide35/orig/canon-lide35/testprog

Breakpoint 1, usb_con_open () at usb_con.c:84
84          for(bus = usb_busses; bus; bus = bus->next) {
(gdb) print usb_device
usb_device             usb_device_descriptor
(gdb) print usb_busses
$1 = (struct usb_bus *) 0x8071028
(gdb) print usb_busses.next
$2 = (struct usb_bus *) 0x0
(gdb) print usb_busses.devices
$3 = (struct usb_device *) 0x8072048
(gdb) print usb_busses.devices.next
$4 = (struct usb_device *) 0x0
(gdb) print usb_busses.devices.descriptor.idVendor
$5 = {bLength = 18 '\022', bDescriptorType = 1 '\001', bcdUSB = 272, 
bDeviceClass = 9 '\t', bDeviceSubClass = 0 '\0', bDeviceProtocol = 0 '\0',
  bMaxPacketSize0 = 8 '\b', idVendor = 0, idProduct = 0, bcdDevice = 518, 
iManufacturer = 3 '\003', iProduct = 2 '\002', iSerialNumber = 1 '\001',
  bNumConfigurations = 1 '\001'}
(gdb) continue
Fatal: Device not found!

Program exited with code 01.

So, obviously, it's idVendor and idProduct which isn't set up correctly, but I 
don't know exactly why. 

Here's a little information about my system:

$ cat /proc/bus/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.11-1-686 uhci_hcd
S:  Product=Intel Corp. 82371AB/EB/MB PIIX4 USB
S:  SerialNumber=0000:00:02.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  1
P:  Vendor=04a9 ProdID=2213 Rev= 3.03
S:  Manufacturer=Canon
S:  Product=CanoScan
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   1 Ivl=8ms
$ cat /proc/version
Linux version 2.6.11-1-686 (dannf@firetheft) (gcc version 3.3.6 (Debian 
1:3.3.6-6)) #1 Mon Jun 20 22:00:38 MDT 2005
$ sudo sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure 
  # you have loaded a SCSI driver for your SCSI adapter.
  # Also you need support for SCSI Generic (sg) in your operating system.
  # If using Linux, try "modprobe sg".

found USB scanner (vendor=0x04a9 [Canon], product=0x2213 [CanoScan], 
chip=GL841) at libusb:001:002
  # Your USB scanner was (probably) detected. It may or may not be supported 
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.
$ scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

More information about the sane-devel mailing list