Discussion:
Kodak i30 Initialisation
(too old to reply)
Sebastian Schmachtel
2017-05-26 14:39:44 UTC
Permalink
Raw Message
Hi,

i'm trying to use a Kodak i30 Sheetfeed-Scanner, which is an AVISION OEM
Scanner, thus should be working with the avision backend. I'm currently
running Debian Testing with sane 1.0.14-12 and libsane 1.0.25-4. When
trying to scan, the scanner gets stuck with some IO Errors:

env SANE_DEBUG_AVISION=7 scanimage > scan.pnm 2> /tmp/debug.log:
...
[avision] try to read status to clear the FIFO
[avision] avision_usb_status: timeout 500, 1 retries
[avision] ==> (bulk read) going down ...
[avision] <== (bulk read) got: 0, status: 0
[avision] ==> (interrupt read) going down ...
[avision] <== (interrupt read) got: 0, status: 0
[avision] === Got error 9 trying to read status. ===
[avision] wait_ready: test unit ready failed (Error during device I/O)
....

However sane-find-scanner and scanimage -L seem fine (when the scanner
is not blocked):

found USB scanner (vendor=0x040a [KODAK ], product=0x6001 [i30 SCANNER])
at libusb:007:003
could not fetch string descriptor: Pipe error
could not fetch string descriptor: Pipe error

[avision] attach: "KODAK" - "i30 Scanner" not yet in whitelist!
[avision] attach: You might want to report this output.
[avision] attach: To: ***@exactcode.de (the Avision backend author)
device `avision:libusb:007:003' is a Kodak i30 sheetfed scanner

When running Windows 7 in a VM and assigning the scanner to it, the
scanner works of course. The Suprising part is, that after using the
scanner in the VM it works with SANE flawlessly as well until the next
power cycle...
So there seems to be something wrong with scanner initialisation. Can
somebody give me a hint how to find this issue? Maybe sniff the usb
traffic of the windows driver? (I've never done this, so maybe someone
can help) Other ideas are welcome as well...

Regards
Sebastian
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Olaf Meeuwissen
2017-05-31 11:22:10 UTC
Permalink
Raw Message
Hi Sebastian,

No-one has followed up yet. I'll give it a go and Cc: the avision
backend maintainer.

The avision backend info lists the Kodak i30 as untested.

@Rene> You've got yourself a tester ;-)
Post by Sebastian Schmachtel
[...]
When running Windows 7 in a VM and assigning the scanner to it, the
scanner works of course. The Suprising part is, that after using the
scanner in the VM it works with SANE flawlessly as well until the next
power cycle...
So there seems to be something wrong with scanner initialisation. Can
somebody give me a hint how to find this issue? Maybe sniff the usb
traffic of the windows driver? (I've never done this, so maybe someone
can help) Other ideas are welcome as well...
This sounds like a firmware download issue. That is, after powering the
scanner up, you first need to sends a firmware file to the device. When
you turn the power off, the scanner forgets all about any firmware file
that was downloaded to it. It has a bad case of Alzheimer's, so to say.

The Windows driver knows it has to send the file, of course, and does so
(possibly checking with the device if really needed first). The SANE
driver may have support for this, I don't know, I'm not familiar with
the backend internals, but if so, it needs to be able to find the right
firmware file.

# I had a quick look at the avision.c code and there is some mention of
# firmware. Looks like it supports downloading as well as checking for
# the need to do so of firmware but this may need a bit of tinkering on
# crude inspection.
# @Rene> Do you have any idea what might be needed? I don't.

You could check the Windows driver for a firmware file. Typical file
name extension would be .bin or maybe .dat (just guessing here). The
files I've seen (for a different backend!) were 64K (65536 bytes). I
don't know but 64K sounds like a nice firmware file size number to me.

Since you run in a Windows VM, sniffing should be quite easy to do with
wireshark. What you're looking for is a lot of USB traffic on the first
scan after you power on that just sends gobs of data *to* the scanner.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Sebastian Schmachtel
2017-06-07 14:57:22 UTC
Permalink
Raw Message
Hi,

thank you for your Answer.
Post by Olaf Meeuwissen
# I had a quick look at the avision.c code and there is some mention of
# firmware. Looks like it supports downloading as well as checking for
# the need to do so of firmware but this may need a bit of tinkering on
# crude inspection.
You could check the Windows driver for a firmware file. Typical file
name extension would be .bin or maybe .dat (just guessing here). The
files I've seen (for a different backend!) were 64K (65536 bytes). I
don't know but 64K sounds like a nice firmware file size number to me.
Since you run in a Windows VM, sniffing should be quite easy to do with
wireshark. What you're looking for is a lot of USB traffic on the first
scan after you power on that just sends gobs of data *to* the scanner.
Thank you for mentioning Wireshark. That makes USB sniffing quite easy.
I was however not sucessful in finding Firmware transmissions. I did a
capture of the Initialisation (attach to VM) and then scanning an empty
page. But before starting the scan there are only small packages <=320
bytes in both directions. The scan consists then of course of bigger
chunks from the scanner. I have uploaded the pcap, if this might help:
https://ufile.io/h0c2s

My next idea would be to compare sane initialisation and windows
initialisation, maybe there is something to learn from...

Sebastian
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
René Rebe
2017-06-07 15:13:47 UTC
Permalink
Raw Message
Hi,
Post by Sebastian Schmachtel
Hi,
thank you for your Answer.
Post by Olaf Meeuwissen
# I had a quick look at the avision.c code and there is some mention of
# firmware. Looks like it supports downloading as well as checking for
# the need to do so of firmware but this may need a bit of tinkering on
# crude inspection.
You could check the Windows driver for a firmware file. Typical file
name extension would be .bin or maybe .dat (just guessing here). The
files I've seen (for a different backend!) were 64K (65536 bytes). I
don't know but 64K sounds like a nice firmware file size number to me.
Since you run in a Windows VM, sniffing should be quite easy to do with
wireshark. What you're looking for is a lot of USB traffic on the first
scan after you power on that just sends gobs of data *to* the scanner.
Thank you for mentioning Wireshark. That makes USB sniffing quite easy.
I was however not sucessful in finding Firmware transmissions. I did a
capture of the Initialisation (attach to VM) and then scanning an empty
page. But before starting the scan there are only small packages <=320
bytes in both directions. The scan consists then of course of bigger
https://ufile.io/h0c2s
My next idea would be to compare sane initialisation and windows
initialisation, maybe there is something to learn from...
The i30 does not need/get firmware, and worked a decade ago.

If it is broken in sane today, then it is likely due to one of the “I have
a crazy HP scanner and made wild edits” kind of changes since then :-/

René
--
ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
http://exactcode.com | http://exactscan.com | http://ocrkit.com | http://t2-project.org | http://rene.rebe.de
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Loading...