Re: Writing Fujitsu M3091 backend

From: Tom Martone (tom@martoneconsulting.com)
Date: Tue Feb 27 2001 - 21:15:45 PST

  • Next message: mh: "Re: Writing Fujitsu M3091 backend"

    Greetings,

    > Question 1 - How to do duplex scanning.
    >
    > To use the duplex mode, I have to send an extended SET WINDOW command
    > to the scanner which should be no problem. The question is, how do I
    > then feed the two images into SANE? As far as I can see from the
    > existing driver, a subprocess gets started to read more-or-less raw
    > binary data from the scanner, which is then passed via a pipe to the
    > calling program; it seems to "leave" the backend via the sane_read
    > function. Since the scanner has dual scan heads and only 128 kB of
    > cache, in duplex mode it will send a data stream that contains two
    > interspersed images. I would be able to separate them on reading, but
    > what next? How do I tell the SANE middleware (or front-end for that
    > matter) that I actually have TWO images? How would a front-end (like
    > scanimage, the only one I've used so far) cope?
    >
    > If SANE doesn't support that, I could introduce a new parameter that
    > controls whether the front or rear side is to be scanned, and each
    > page would have to be run through the scanner twice. A waste, but
    > possible.
    >
    > I've grepped for "duplex" in the existing backends (1.0.4) but found
    > nothing.
    >

    The sane-bh driver for Bell+Howell Copiscan scanners supports duplex.
    From what you've described, it sounds like the implementation with the
    Fujitsu might be a bit more challenging though. With the Bell+Howell,
    you read the entire front page and then the entire back page so there's
    no need to buffer the data in the driver; the scanner itself (with its
    RSC controller) provides the buffering. The B+H only does black and
    white.

    As far as sending multiple pages to the front end(s), the current SANE
    standard supports this very well. I think that you should stay away
    from your duplex=hack approach and stay with two separate pages. A
    single sheet scanned in duplex will look like two sheets scanned
    single sided with an ADF.

    As far as front-ends go, xsane supports ADF mode and can deal with
    multiple pages in a single scan operation. For a command line, I took
    scanimage and reworked it into scanadf, which will also work with ADF
    and duplex scanners. The backend needs to reliably and correctly
    return the SANE_STATUS_NO_DOCS status code when the scanner is out
    of paper in the hopper. Look at the read loop in xsane and scanadf
    for the call sequence.

    The sane-bh driver is in CVS, but is not in 1.0.4. scanadf is not even
    in CVS. It's here: http://www.martoneconsulting.com/sane-scanadf.html

    Here's a bit from the sane-bh man page concerning duplex.

           Duplex scanning
                  Some models, such as the COPISCAN II 6338, support
                  duplex scanning. That is, they scan both sides of
                  the document during a single pass through the scan-
                  ner (the scanner has two cameras). This backend
                  supports duplex scanning (with the --duplex
                  option). The front and back page images are deliv-
                  ered consecutively as if they were separately
                  scanned pages.

           --duplex[=(yes|no)] [no]
                  Enable duplex (dual-sided) scanning. The scanner
                  takes an image of each side of the document during
                  a single pass through the scanner. The front page
                  is delivered followed by the back page. Most
                  options, such as compression, affect both the front
                  and back pages.

    Just my 2 cents on the merging of the multiple models and the --model
    option. You should investigate whether you can determine the model
    and its capabilities by inquiring the device. If you can, then you can
    enable/disable/alter the SANE backend options as appropriate for the
    device. If you get the model from the user, besides it potentially
    being incorrect :) , you don't have the same opportunity to get
    the options right the first time the user sees them. Also, you get
    into some nasty issues like requiring the --model to appear earlier than
    other options on the command line, in order for the subsequent
    options to be validated properly.

    There are a bunch of different variations on the Copiscan scanners
    and their capabilities and there are information bytes in the
    inquiry commands that report the differences. Some things are not
    that straightforward and rely on looking at the model number, for
    instance. I suspect that you'd have similar facilities with the
    Fujitsu.

    Tom

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



    This archive was generated by hypermail 2b29 : Tue Feb 27 2001 - 20:48:37 PST