# Re: Patch for Microtek ScanMaker X6 (microtek2 backend)

Bernd Schroeder (bernd@aquila.muc.de)
Fri, 20 Nov 1998 00:31:31 +0100

- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Jonathan Buzzard: "Re: News from Minolta"
- Previous message: Bernd Schroeder: "Re: Microtek scanner V600"
- In reply to: Sebastian Erdmann: "Patch for Microtek ScanMaker X6 (microtek2 backend)"

Hi,

On Thu, Nov 19, 1998 at 03:53:49PM +0100, Sebastian Erdmann wrote:
>
> Hi,
>
> my Microtek Scanmaker X6 exhibits some strange behavior: After
> switching it on, colors (or greyscale tones) are "washed out" and
> horizontally unbalanced across the image. This occurs when using
> SANE 0.74 as well as SANE pre1.00. A simple workaround is to
> power-cycle the scanner (while keeping the computer running).

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.

> But since the windoze twain drivers can get the scanner to work
> without that extra power-cycle, I wasn't satisfied with the
> situation and started to look for a better solution. Unfortunately,
> the trace information obtained from setting "option dump 4" in
> microtek2.conf and setting SANE_DEBUG_MICROTEK2=255 in the
> environment didn't show significant differences between the
> "colors washed out" case and the normal case. In fact, the only
> difference I found turned out to be unrelated to the problem, but
> 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.

The NTRACK bit, however, should always be 0 in this version of the backend.
In the next release there will be an option to set this bit explicitly
(and thus avoiding backtracking).

> But the "colors washed out" problem did still persist.
> However, after some experimentation I found out that issuing
> a SEND DIAGNOSTIC command (which performs a scanner self test)
> fixes the problem. Since this command keeps the scanner busy for
> quite some time, I added a flag to the Microtek2_Device struct
> so the self test is only performed once in a xscanimage session.

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" :/ .

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

    --
    Bernd Schroeder
    Email: mailto:bernd@aquila.muc.de
    PGP public key available: mailto:pgp@aquila.muc.de | Subject: send key

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

     Next message: Jonathan Buzzard: "Re: News from Minolta"
     Previous message: Bernd Schroeder: "Re: Microtek scanner V600"
     In reply to: Sebastian Erdmann: "Patch for Microtek ScanMaker X6 (microtek2 backend)"