[sane-devel] USB - scanner - devel

Yann E. MORIN yann.morin.1998@anciens.enib.fr
Sun, 22 Sep 2002 02:28:05 +0200


--------------Boundary-00=_TADTQDO6ABLCA9CNND8L
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

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@home  446 | / \ HTML MAIL    |   v   conspiracy.  |
---------------------------------------------------------------------------

--------------Boundary-00=_TADTQDO6ABLCA9CNND8L
Content-Type: text/plain;
  charset="iso-8859-1";
  name="gdb.out"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb.out"

W3ltb3JpbkByb2F6aG9uIE1lcmxpbl0kIGdkYiBtZXJsaW4KR05VIGdkYiA1LjEuMQpDb3B5cmln
aHQgMjAwMiBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4KR0RCIGlzIGZyZWUgc29mdHdh
cmUsIGNvdmVyZWQgYnkgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlLCBhbmQgeW91IGFy
ZQp3ZWxjb21lIHRvIGNoYW5nZSBpdCBhbmQvb3IgZGlzdHJpYnV0ZSBjb3BpZXMgb2YgaXQgdW5k
ZXIgY2VydGFpbiBjb25kaXRpb25zLgpUeXBlICJzaG93IGNvcHlpbmciIHRvIHNlZSB0aGUgY29u
ZGl0aW9ucy4KVGhlcmUgaXMgYWJzb2x1dGVseSBubyB3YXJyYW50eSBmb3IgR0RCLiAgVHlwZSAi
c2hvdyB3YXJyYW50eSIgZm9yIGRldGFpbHMuClRoaXMgR0RCIHdhcyBjb25maWd1cmVkIGFzICJp
Mzg2LW1hbmRyYWtlLWxpbnV4Ii4uLgooZ2RiKSBicmVhayBmaW5kc2Nhbm5lcgpCcmVha3BvaW50
IDEgYXQgMHg4MDRhMzc2OiBmaWxlIG1lcmxpbjY3MC1WMC4wMi5jLCBsaW5lIDY5Ni4KKGdkYikg
cnVuClN0YXJ0aW5nIHByb2dyYW06IC9ob21lL3ltb3Jpbi9kZXYvc2FuZS9NZXJsaW4vbWVybGlu
Ck1lcmxpbjY3MCBWMC4wMiBmb3IgZGV2ZWxvcGVycyBvbmx5CgpCcmVha3BvaW50I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