[sane-devel] Mustek 6000CX dies after the first of three passes in color mode

Henning Meier-Geinitz henning@meier-geinitz.de
Thu, 4 Apr 2002 20:10:20 +0200


Hi,

On Thu, Apr 04, 2002 at 03:03:51AM +0200, Christian Fughe wrote:
> Scanimage stops immediately after the first of three passes in color mode.
> Scanimage does not wait for the scanner to finish backtracking. It seems,
> scanimage even does not wait for the scanner to start backtracking. I
> never did scans in color mode before.

I just tested this scanner and it works for me. However, my scanner
has version 4.04 but I'm not sure if this makes a difference.

> The scanner is connected to a 486 with a very small HD. The 486 does not
> have enough space for the compiler and the default environment for the
> compiler. Thus I compiled sane on a newer computer without scsi abilities,
> mounted the compiled directory via network, and did a 'make install' on
> the 486 in the mounted directory. Both computers do run SuSE Linux 7.1.
> The newer computer is upgraded to kernel 2.4.18, the older one uses the
> default 2.2.18 kernel.

I'm using 2.4 only but the driver also worked with 2.2. The different
kernels shouldn't harm but you never know...

> [mustek] area_and_windows: tlx=0 (0 mm); tly=0 (0 mm); brx=2550 (215 mm); bry=4158 (352 mm)
> [mustek] dev_cmd: fd=3, src=0xbfff70b4, src_size=15, dst=(nil), dst_size=0
> [mustek] dev_cmd: sending:  04 00 00 00 09 00 09 00 00 00 00 f6 09 3e 10
> [mustek] dev_cmd: finished: dst_size=0, status=Success
> [mustek] inquiry: sending INQUIRY
[...]
> [mustek] dev_cmd: finished: dst_size=96, status=Device busy
> [mustek] sane_start: inquiry command failed: Device busy

This is the problem. The backend usually waits for the scanner to
become ready with "area_wait_ready". However, your scanner tells the
backend that it is ready (status=Success) immediately. Then it tells
the backend that it isn't in the next command (inquiry).

You could try the following: Look into backend/mustek.c and search for
the following code:

static SANE_Status
dev_wait_ready (Mustek_Scanner *s)
{
  if (s->hw->flags & MUSTEK_FLAG_N)
      return n_wait_ready (s);
   else if (s->hw->flags & MUSTEK_FLAG_THREE_PASS)
      return scsi_area_wait_ready (s);
      
Change the last two lines to:

   else if (s->hw->flags & MUSTEK_FLAG_THREE_PASS)
     {
        scsi_area_wait_ready (s);
	return scsi_inquiry_wait_ready (s);
     }

Does this help? If not, please send a bug report again.

Bye,
  Henning