Re: Patch for Microtek ScanMaker X6 (microtek2 backend)

Sebastian Erdmann (serdmann@cs.tu-berlin.de)
Fri, 20 Nov 1998 13:41:21 +0100 (MET)

On Fri, 20 Nov 1998 00:31:31 +0100, Bernd Schroeder wrote:
>
> This sounds indeed strange. Normally the scanner should be in reset state
> after it is switched on. Or are the colors wrong if the scanner is switched
> on before the system is booted (or the SCSI driver is loaded) ? Then
> the SCSI driver sends one or more commands to the device, but these
> commands should not affect the results of a scan.

I tried every computer/scanner power-up sequence I could think of :-)
I also tried loading/unloading the SCSI driver, but the problem occurs
every time. It doesn't seem to be related to SCSI, since it occurs on
both the Adaptec AVA-1505 host adapter (supplied with the scanner)
and my NCR 53C810 controller.

[...]
> > I fixed it anyway to prevent potential problems: The scanner seems
> > to come up with random values for the NTRACK and NCALIB bits in
> > the system status. The fix (included in the patch below) was to
> > explicitly set these bits to zero in sane_start().
>
> NCALIB set to 1 prevents the scanner from calibration before a scan.
> This is explicitly set (and later reset) in the do_dummy_scan()-function.
> Please check, whether the differences for this bit result from these
> different settings.

Note that my patch places the call to do_dummy_scan() (and therefore
the call to scsi_send_diagnostic()) in sane_start() before the call
to scsi_send_system_status(). I did this because I'm not sure whether
the system status is preserved across a self test. Therefore I need
to set NTRACK and NCALIB in sane_start().

[...]
> I experimented with this command myself a while ago as a replacement for
> this "do_dummy_scan" stuff, but it has some disadvantages.
>
> In particular this command is used for every scan if scanimage is used, and
> as you wrote the execution of this command takes some time. On my
> own ScanMaker 630 every second "send diagnostics" fails, BTW, with
> sense code "lamp failure" :/ .

:-/ ... well, this bug doesn't occur on my scanner.

Yes, this "send diagnostics" command is annoying, because it keeps
the scanner busy for a rather long time. This is the reason for the
did_self_test flag in my patch. Of course, this flag doesn't help
with scanimage. On the other hand, my patch shouldn't affect your
ScanMaker 630, because do_dummy_scan() returns early for this model.

> I suggest not to include this patch into sane-1.00, but to remove the
> NTRACK and NCALIB changes, and also to introduce an option in the
> configuration file to enable/disable the "send diagnostics" command
> (but in a later release of the backend).
>
> Bernd

It would be sufficient to issue the "send diagnostics" command just
once after switching on the scanner. But I didn't find a way to
determine in software whether the scanner acts weirdly or not --
the only method seems to be to manually inspect a scanned image.

As an alternative, I could write a small stand-alone program that
just issues a "send diagnostics" command. But such a program would
duplicate a lot of functionality of the SANE microtek2 backend and
the SCSI layer. Yet another alternative would be an option settable
via sane_control_option(). But those alternatives would all require
user intervention.

If you like, I could go ahead and implement the configuration file
option as per your suggestion. I think a similar option to control
do_dummy_scan would also be useful.

Sebastian

-- 
                                        ___
Sebastian Erdmann                      /
serdmann@cs.tu-berlin.de           ___|__
se@pobox.com                      (_  |
http://pobox.com/~se              __)  \___

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