[sane-devel] multiple scanners

Henning Meier-Geinitz henning at meier-geinitz.de
Fri Jan 17 17:06:15 GMT 2003


Hi,

On Fri, Jan 17, 2003 at 07:13:46PM +0300, Sergey Vlasov wrote:
> > > Hmm. Looking at the Linux USB scanner kernel driver, I suspect that
> > > the device scan would be blocked in open() when it hits an used
> > > device.
> > 
> > I dond't think so. The locks are only active during the call to
> > open_scanner(), not while the device is open. Scanning an already
> > opened device will run into the  "if (scn->isopen)" test and exit.
> > At least that's the case in recent kernels.
> > 
> > The following example with three scanners works here:
> > 
> > $ scanimage -L
> > device gt68xx:/dev/usb/scanner2' is a Plustek OpticPro 1248U flatbed  scanner
> > device gt68xx:/dev/usb/scanner1' is a Mustek BearPaw 2400 CU Plus flatbed scanner
> > device gt68xx:/dev/usb/scanner0' is a Mustek ScanExpress 1200 UB Plus flatbed scanner
> > 
> > $ scanimage -d gt68xx:/dev/usb/scanner0 >/tmp/image0.pnm & \
> >   scanimage -d gt68xx:/dev/usb/scanner1 >/tmp/image1.pnm & \ 
> >   scanimage -d gt68xx:/dev/usb/scanner2 >/tmp/image2.pnm
> 
> But what if you do 'scanimage -L' while some scanning is in progress?

$ scanimage -d gt68xx:/dev/usb/scanner0 >/tmp/image0.pnm & scanimage -L
device gt68xx:/dev/usb/scanner2' is a Plustek OpticPro 1248U flatbed scanner
device gt68xx:/dev/usb/scanner1' is a Mustek BearPaw 2400 CU Plus flatbed scanner

scanner0 isn't printed, but that's ok. The output is a bit slow
because of all that "kernel: scanner.c: open_scanner(0): Scanner
device is already open" messages printed to syslog. I guess I'll
downgrade this error to a debug.

But it's not blocked while the device is open.

Bye,
  Henning



More information about the sane-devel mailing list