[sane-devel] (no subject)

Bertrik Sikken bertrik at zonnet.nl
Sat Jan 7 00:22:43 UTC 2006

Hash: SHA1

Ben Tasker wrote:
> Hi There,
> Having just bought a Xerox 4800 One touch flatbed scanner and found it
> unsupported (dont ask why i ddint check first) I am going to try and
> create a SANE backend for it. Any help will be greatly appreciated, I
> assume there is no other backend being developed for this scanner?
> Should mention I have no idea how long it will take me to create the
> backend as I havent really done much with SANE before, an interested
> browse through the source perhaps but little more. I assume if I use an
> existing backend as a template then I should still manage to create
> compatability with SANE.

How long it takes depends on a lot of things, but expect something
like 6 months or longer.

Is it an USB scanner? If so, please post the USB vendor and product
ids here (use something like lsusb). There is a chance that there
is already a driver for it.
There is a tool called sane-find-scanner, run it and see what it

You need to know what's chipset is inside your scanner.
If you know the chipset, you can tehn try to find a datasheet
that describes how to program it. It's not common to find one

Try the check-usb-chip tool, it attempts to identify some known
scanner chips.
Sometimes you can get clues by peeking in the windows driver
files (for example the .inf's) or by looking in the registry.
If you haven't been able to find out more (using the tools
mentioned above), you can perhaps get some more information
by opening it up and taking note of the chip numbers.

If you really need to write a new backend from scratch, you
can use USB sniffer software like http://benoit.papillault.free.fr/usbsnoop/
to capture some USB packets from the windows driver.
When you have taken some, put them up on a website somewhere
and post a link to the mailing list.
Even though the scanner chip may be different from other
scanners, the transport protocol may be similar.

I think it is best to first start with a very simple test
tool that replays some of the captured data. Layer it up
in three parts:
* transport layer that reads/write register settings and
reads/write bulk data. Use libusb to talk to usb.
In the final sane backend, you easily adapt this layer to use
sanei_usb* functions (API is very similar to libusb)
* a core layer that implements the basic functionality for
doing a scan (switching the lamp, moving the carriage, doing
a scan with certain parameters)
* user-interface layer. For the test tool this is simply a
command line / argument parser that calls specific test functions
in the core layer. In the final sane backend, this layer
glues the sane backend interface to your core layer.

I think there's a backend-writing.txt (or something similar)
that describes best practices for coding style etc. to allow
easy integration into sane.

Kind regards,
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the sane-devel mailing list