Table of Contents

Introduction

System requirements

Installation

Configuration

The SCOadmin Scanner Manager

Manual Configuration

SANE Applications

scanimage

xscanimage

xsane

xcam

Debugging

Tested Combinations of Host Bus Adapters (HBAs) and Scanners

Known Problems

Links

Questions? Comments?


Introduction (from the SANE home page)

SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The SANE API is public domain and its discussion and development is open to everybody. The current source code is written for UNIX (including GNU/Linux) and is available under the GNU General Public License (the SANE API is available to proprietary applications and backends as well, however).

SANE is a universal scanner interface. The value of such a universal interface is that it allows writing just one driver per image acquisition device rather than one driver for each device and application. So, if you have three applications and four devices, traditionally you'd have had to write 12 different programs. With SANE, this number is reduced to seven: the three applications plus the four drivers. Of course, the savings get even bigger as more and more drivers and/or applications are added.

Not only does SANE reduce development time and code duplication, it also raises the level at which applications can work. As such, it will enable applications that were previously unheard of in the UNIX world. While SANE is primarily targeted at a UNIX environment, the standard has been carefully designed to make it possible to implement the API on virtually any hardware or operating system.

While SANE is an acronym for ``Scanner Access Now Easy'' the hope is of course that SANE is indeed sane in the sense that it will allow easy implementation of the API while accommodating all features required by today's scanner hardware and applications. Specifically, SANE should be broad enough to accommodate devices such as scanners, digital still and video cameras, as well as virtual devices like image file filters.

If you're familiar with TWAIN, you may wonder why there is a need for SANE. Simply put, TWAIN does not separate the user-interface from the driver of a device. This, unfortunately, makes it difficult, if not impossible, to provide network transparent access to image acquisition devices (which is useful if you have a LAN full of machines, but scanners connected to only one or two machines; it's obviously also useful for remote-controlled cameras and such). It also means that any particular TWAIN driver is pretty much married to a particular GUI API (be it Win32 or the Mac API). In contrast, SANE cleanly separates device controls from their representation in a user-interface. As a result, SANE has no difficulty supporting command-line driven interfaces or network-transparent scanning. For these reasons, it is unlikely that there will ever be a SANE backend that can talk to a TWAIN driver. The converse is no problem though: it would be pretty straight forward to access SANE devices through a TWAIN source. In summary, if TWAIN had been just a little better designed, there would have been no reason for SANE to exist, but things being the way they are, TWAIN simply isn't SANE.

System Requirements

Installation

Before you can install SANE you have to pkgadd the glibs package:
pkgadd -d `pwd`/glibs-2.0.3.pkg
Then pkgadd the SANE package: This will install the binaries, librabries, header files, man pages etc. in /usr/local. Make sure you've got /usr/local/bin in your $PATH. The installation of XSANE and The Gimp is optional but recommended. XSANE offers a number of features xscanimage doesn't provide (xscanimage is part of the SANE package). The Gimp is probably the best open source image viewer and editor that is currently available.

Configuration

The SCOadmin Scanner Manager

Before you can use any of the applications, i.e. scanimage/xscanimage/xcam/xsane you have to configure the scanner. The easiest way to do so is to use the SCOadmin Scanner Manager. Start the client either via the SCOadmin launcher or directly from the command line (as root):
# scoadmin scanner

Note: The GUI doesn't support the configuration of QuickCam cameras yet. The devices have to configured manually by editing the appropriate configuration files in /usr/local/etc/sane.d.



 

Manual Configuration

Edit the drivers configuration file as root and specify the scanner's SCSI address or the address of the parallel port the QuickCam camera is connected to. The configuration files are located in /usr/local/etc/sane.d, e.g. hp.conf. Create an entry like: to reflect your configuration. The syntax is It is also necessary to edit /usr/local/etc/sane.d/dll.conf to enable the backend that is needed to drive the scanner, e.g. hp. Backends are disabled if the name of the backend is prefixed with a hash, e.g. #hp. See also Debugging. Only the backends that are not commented out are loaded.

SANE Applications

scanimage

scanimage is a command line interface that if invoked without any options reads the data from the scanner and prints the raw data to the screen.

The command scanimage -L lists the devices that are available, e.g.

The simplest command to scan an image is: There's a number of parameters that can be used in addition to control the scanner (set the brighness, contrast, resolution etc.), e.g.

Note: Not all scanners support the same set of options. The UMAX S6E for example doesn't support the 'brighntess' and the 'contrast' parameters.


Note: There seems to be a bug in the hp backend. The value for the resolution will be ignored if the resolution parameter is specified before the mode parameter, and the mode is set to 'color', i.e.:

The scanners default value for the resolution (e.g. 300) will be used instead. The problem won't occur if you specify the mode first.


xscanimage

xscanimage is a graphical frontend to SANE.

xsane

xsane is another graphical frontend to SANE, but it provides more features than xscanimage and is constantly being improved.

xcam

xcam is an application that provides streaming video from a Connectix QuickCam camera. The application is not very stable. It is also not possible to write the images continuously to the disk, i.e. record to disk. The other SANE frontends can be used to aquire images from QuickCam cameras, too, comparable to a snapshot camera.

Debugging

There are a number of environment variables that can be set for debugging purposes. The numeric value specifies the debug level. The smaller the number, the less information is produced, e.g. a value of 1 will only bring up important messages such as errors. For example: The value can range between 0 (for no output) and 128 (very verbose).

Tested Combinations of Host Bus Adapters (HBAs) and Scanners

UMAX Vista-S6E UMAX Astra 610S HP ScanJet 6250C HP Scanjet 5P
Adaptec AIC-7880

(adsl)

Usually works without problems. From time to time SCSI commands time out and cause the machine to hang. If ptf7049e is installed the machine will recover. Usually works without problems. From time to time SCSI commands time out and cause the machine to hang. If ptf7049e is installed the machine will recover. No problems. No problems.
Adaptec AHA-2940

(adsl)

Usually works without problems. From time to time SCSI commands time out and cause the machine to hang. If ptf7049e is installed the machine will recover. Usually works without problems. From time to time SCSI commands time out and cause the machine to hang. If ptf7049e is installed the machine will recover. No problems. - not tested -
Buslogic BT-958

(blc)

Scanner calibration fails in color mode. Gray and Lineart are ok. No problems. No problems. - not tested -
Symbios SYM22801

(c8xx)

Scanner initialisation fails. Application runs in a loop. This only happens on UW 7.1. Fixed in UW 7.1.1 - not tested - Kernel panics (only UW 7.1). No problems on a system that runs UW 7.1.1. - not tested -
Symbios 8751sp

(c8xx)

Scanner initialisation fails. Application runs in a loop. Fixed in 7.1.1 Scanner initialisation fails. Application runs in a loop. Kernel panics (only UW 7.1). No problems on a system that runs 7.1.1. - not tested -
DPT PM2124

(dpt)

No problems. No problems. Scanner initialisation fails. First TEST_UNIT_READY command fails with SDI_CKSTAT. - not tested -

Known problems

There appears to be a bug in the HP driver. If the user puts a sheet of paper into the document feeder and changes the scan mode to something else than 'color', the scan geometry gets corrupted. The 'Top-left' slider is at maximum but still holds a value of zero. The will cause xscanimage to exit with an assertion error. The document feeder works fine if the scan mode is set to 'color'.

Not all scanner identify themselves as scanners (SCSI class 3). Some scanners vendors, like HP and Epson chose to report their devices as 'Processing Devices' (SCSI class 6). These scanners are not autodetected by the SCOadmin Scanner Manager.

Links

The SANE Home Page
The XSANE Home Page

Question? Comments?

Let me know!

Last update: 26/01/2000