[sane-devel] 'scanimage -L' fails first time with modular SCSI drivers

abel deuring a.deuring@satzbau-gmbh.de
Tue, 19 Feb 2002 16:13:00 +0100

Tim Waugh wrote:
> On Linux, when the SCSI drivers are compiled modular, 'scanimage -L'
> fails unless they modules are loaded.
> After running it once (and it fails), the drivers appear to have been
> automatically loaded (by an open("/dev/sg0") I think), and so a
> subsequent 'scanimage -L' works.
> [root@cyberelk root]# scanimage -L
> No scanners were identified. If you were expecting something
> different,
> check that the scanner is plugged in, turned on and detected by the
> sane-find-scanner tool (if appropriate). Please read the documentation
> which came with this software (README, FAQ, manpages).
> [root@cyberelk root]# scanimage -L
> device `hp:/dev/sg0' is a Hewlett-Packard C5110A flatbed scanner
> Curiously enough, if I create a link /dev/scanner -> sg0, I don't see
> this behaviour and the first 'scanimage -L' succeeds.
> I'm trying this with SANE 1.0.7.

Don't know, if this is related, but the Sharp backend has the bug that
it considers the REQUEST SENSE result "power on reset" to be an error.
So, if you have only /dev/sg0, no /dev/scanner, scanimage -L fails, if
the scanner was power-cycled after the SCSI driver module has been
loaded. With /dev/scanner present, detecting the scanner at either
/dev/scanner or /dev/sg0 (the one being accessed first, don't know which
it is...) will fail, but accessing the second device file will succeed.
A second "scanimage -L" will then show two scanners, attached to
/dev/sg0 and /dev/scanner.