# sane-0.72 and mustek 600 II N

Henning Meier-Geinitz (hmg-ml@gmx.de)
Thu, 9 Apr 1998 01:56:51 +0200

- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: David Wolfskill: "Re: find scanner via /proc/scsi/scsi"
- Previous message: Matto Marjanovic: "Re: Question regarding PNM-Format (OS/2)"

Hi!

I tried sane-0.72 with the following system:

Linux 2.0.33 (Pentium166), gtk+ 0.99.8, gimp 0.99.22, mustek 600 II N
parallel port scanner.

Some comments:

1)
Sane compiles without errors. As reported some time ago, the scanner
only works (most of the time) if SANE_DEBUG_SANEI_AB306 is set to 4
or higher. I couldn't locate exactly this problem.

2)
Lineart, halftone and greyscale work. Color doesn't, there are
horizontal stripes and wrong colors. I did some changes in mustek.c
and that works for me. But it's more a hack. Please try the enclosed
patch because I don't know if this works with all mustek 600 II N
scanners. line-distance-fix must be *disabled*, my scanner sends the
correct line-distance values. The data color sequence is RGB. In the
scanner the first lcd line is red, second blue, third green.

I got errors with resolutions > 300 dpi in color mode:
"Xlib: unexpected async reply (sequence 0xe5c)!". These can be
ommitted by changing the standard buffer size from 32k to something
higher, for example in mustek.c, reader_process (hack!):

lines_per_buffer = sanei_scsi_max_request_size / bpl;
--> lines_per_buffer = 128 * 1024 / bpl;

3)
After using xscanimage the light istn't shut off.

4)
If the scan process is stopped manually, mustek.c waits 60 s
(timeout) everytime before resetting the scanner. Bug or feature?

5)
If I want to leave xscanimage, X seems to hang für about 5 seconds. No
key or mouse click is accepted anywhere.

6)
If the scanning process is aborted by killing xscanimage, the scanner
won't react any more. A newly started xscanimage waits forever. I have
to turn off and on the scanner manually.

7)
mustek.c doesn't ignore empty lines in mustek.conf. It tries to open
"" as a device for every empty line.

8)
My scanner is much faster in color mode than in grey mode. It seems to
backtrack in grey mode but not in color mode.

Keep on the good work!

Ciao, Henning

And now the patch for color-support:

diff -ruN sane-0.72.orig/backend/mustek.c sane-0.72/backend/mustek.c
--- sane-0.72.orig/backend/mustek.c Tue Mar 3 04:02:43 1998
+++ sane-0.72/backend/mustek.c Thu Apr 9 01:10:58 1998
@@ -1394,7 +1394,7 @@
}
}
- num_saved_lines = s->ld.index[0] - s->ld.index[2];
+ num_saved_lines = s->ld.index[0] - s->ld.index[1];
if (num_saved_lines > 0)
/* restore the previously saved lines: */
memcpy (out, s->ld.buf[0], num_saved_lines * bpl);
@@ -1404,7 +1404,7 @@
if (++s->ld.lmod3 >= 3)
s->ld.lmod3 = 0;
- c = color_seq[s->ld.lmod3];
+ c = s->ld.lmod3;
if (s->ld.index[c] < 0)
++s->ld.index[c];
else if (s->ld.index[c] < s->params.lines)
@@ -1421,17 +1421,17 @@
DBG (1, "fix_line_distance_pp: lmod3=%d, index=(%d,%d,%d)\n",
s->ld.lmod3,
s->ld.index[0], s->ld.index[1], s->ld.index[2]);
- num_lines = s->ld.index[2] - s->ld.ld_line;
+ num_lines = s->ld.index[1] - s->ld.ld_line;
/* copy away the lines with at least one missing
color component, so that we can interleave them
with new scan data on the next call */
- num_saved_lines = s->ld.index[0] - s->ld.index[2];
+ num_saved_lines = s->ld.index[0] - s->ld.index[1];
memcpy (s->ld.buf[0], out + num_lines * bpl,
num_saved_lines * bpl);
/* notice the number of lines we processed */
- s->ld.ld_line = s->ld.index[2];
+ s->ld.ld_line = s->ld.index[1];
/* return number of complete (r+g+b) lines */
return num_lines;
}

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com

- Next message: David Wolfskill: "Re: find scanner via /proc/scsi/scsi"
- Previous message: Matto Marjanovic: "Re: Question regarding PNM-Format (OS/2)"