Rene Vellekoop wrote:
>
> Hi there!
>
> I use a Mustek 600 II N scanner. 'scanimage -L' returns:
>
> device `pnm:0' is a Noname PNM file reader virtual device
> device `pnm:1' is a Noname PNM file reader virtual device
> device `mustek:0x36b' is a Mustek MFC-06000CZ flatbed scanner
>
> Looks quite nice I think, the scanner moves about a centimeter up and down, lamp
> goes on, no problem..
>
> But when I acctually want to scan an image the scanner gives me the same action
> as the 'initialisation' as mentioned above but then locks up. CTRL-C sais:
> stopping scanner... but this has no effect I have to kill the scanimage process
> and a 0 byte output file remains.
I think i had a similar problem (with sane pre-1.00). The solution is an
'usleep' inserted in sanei/sanei_ab306.c:
***************
/* Send a single command-byte over the AB306N-interface. */
static void
ab306_cout (Port *p, int val)
{
u_long base = p->base;
usleep(100); <<<================
while ((ab306_inb (p, base + 1) & 0x80)); /* wait for dir flag */
ab306_outb (p, base, val);
ab306_outb (p, base + 1, 0xe0);
while ((ab306_inb (p, base + 1) & 0x80) == 0); /* wait for ack
*/
ab306_outb (p, base + 1, 0x60);
}
****************
I forgot who originally sent this patch to the mailing list.
Also, you need a patch enabling correct color scanning, which i attach
to this message. Again, i don't know the original author. I also don't
know if these patches are already integrated in the current sane
version.
The Mustek 600 II N that we have at our institute is working fine with
these patches, however sometimes there are colored horizontal stripes at
the upper or at the lower edge of the picture. My remedy is to scan a
larger area and then crop with xv or gimp.
good luck.
--Heinrich Rebehn
University of Bremen Physics / Electrical and Electronics Engineering - Department of Telecommunications -
E-mail: mailto:rebehn@comm.uni-bremen.de Phone : +49/421/218-4664 Fax : -3341 --------------79BF5AD747BD2DD7B1AD4E54 Content-Type: text/plain; charset=us-ascii; name="patch1" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch1"
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; }
--------------79BF5AD747BD2DD7B1AD4E54--
-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com