[sane-devel] USB - scanner - devel

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Sun Sep 22 01:28:05 BST 2002


On Saturday 21 September 2002 12:49, you wrote:
 > the chip inside should be a merlin LM9832 or 9833. I currently
 > bought a Canon N670U which should be compatible with the N676U
 > and will try an integrate it into the Plustek backend so far.
 > I'm not sure if the patch will make it into SANE 1.0.9 but I'm rather
 > optimistic...

OK. In dmesg, the device identifies itself as VID/PID:0x4a9/0x220D, that is
the same as a N670U. So the chip inside ought to be the same (or compatible).
After some digging, I came up with these results: N676U scans at 48 bits,
and LM9832 does only 42 bits. So it should be a LM9833. I got the datasheet
from National Semiconductors, but I doubt it'll be of interest...

Next, dmesg would spit that the device is claimed by no driver. In fact,
linux USB scanner driver hasn't got this VID/PID pair as a recognized device.
Patched the driver so that my device is recognized, works OK. Will send the
PID/VID pair to the maintainer.

Next, I tried to run the merlin test. Well, it segfaults when searching for
the scanner : the pointer for the device appears to be a wild pointer, as
gdb says "Cannot acces memory at address 0x1031". Any clue? (Attached is the
output of my gdb session.) OTOH, files look to be a bit 'old', as last
version is dated february `02.

I'm currently digging in plustek* and trying hard to understand what's
goin' on in there. From what I see, adding a descriptor {"VID/PID", DCapsDef,
HWDef, "name"} for the device ought to be enough.
What I don't get is how to 'compute' the data to fill the structures DCapsDef
and HWDef : is it some kind of black magic, found by luck or by chance? Or is
it data extracted from some datasheet one have only by paying?

What I don't get is why there is this very line in the code:

/*     {"0x04A9-0x220D", ,, "N670U"}, */

Anyhow, there looks to be work in progress in the area. Let me know about
code/patches to test. In the meantime, I'll tweak values in the DCapsDef and
HWDef fields to see what I can get out of my scanner.

Cheers,
Yann.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
|  0 662 376 056  | Software  Designer | \ / CAMPAIGN     |  ___               |
| --==< °_° >==-- °---.----------------:  X  AGAINST      |  \e/  There is no  |
| web: ymorin.free.fr | SETI at home  446 | / \ HTML MAIL    |   v   conspiracy.  |
°---------------------°----------------°------------------°--------------------°
-------------- next part --------------
[ymorin at roazhon Merlin]$ gdb merlin
GNU gdb 5.1.1
Copyright 2002 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-mandrake-linux"...
(gdb) break findscanner
Breakpoint 1 at 0x804a376: file merlin670-V0.02.c, line 696.
(gdb) run
Starting program: /home/ymorin/dev/sane/Merlin/merlin
Merlin670 V0.02 for developers only

Breakpoint 1, findscanner (vendor=1193, product=8717) at merlin670-V0.02.c:696
696         usb_init(  );
(gdb) step
697         usb_find_busses(  );
(gdb) step
698         usb_find_devices(  );
(gdb) print {struct usb_bus}usb_busses
$1 = {next = 0x0, prev = 0x0, dirname = "001", '\000' <repeats 4093 times>, devices = 0x1111}
(gdb) step
702         for( bus = usb_busses; bus; bus = bus->next )
(gdb) print {struct usb_bus}usb_busses
$2 = {next = 0x0, prev = 0x0, dirname = "001", '\000' <repeats 4093 times>, "X", devices = 0x1031}
(gdb) step
704             for( dev = bus->devices; dev; dev = dev->next )
(gdb) step
712                 if( ( dev->descriptor.idVendor == vendor ) && ( dev->descriptor.idProduct == product ) )
(gdb) print {struct usb_device}dev
Cannot access memory at address 0x1031
(gdb) step

Program received signal SIGSEGV, Segmentation fault.
0x0804a3b7 in findscanner (vendor=1193, product=8717) at merlin670-V0.02.c:712
712                 if( ( dev->descriptor.idVendor == vendor ) && ( dev->descriptor.idProduct == product ) )
(gdb) signal 9
Continuing with signal SIGKILL.

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb) quit



More information about the sane-devel mailing list