Configuring Scanner Software

Fundamentally, SANE is an application programming interface (API); it provides a set of routines that programs can call to use a scanner—any scanner. SANE effectively has three major parts:

• The libraries that implement the API (aka the middleware or meta back-ends )

• The drivers that access the scanner (aka the back-ends)

• The programs that call the SANE API (aka the front-ends)

Two front-ends can be very different from one another. For instance, text-mode front-ends can enable scanning from the command line, and X-based front-ends provide GUI preview scans and other common scanning features.

Much of the task of configuring SANE involves setting up the correct back-end for your scanner. This task is accomplished by editing two files:

/etc/sane.d/dll.conf This file holds a list of the SANE back-ends for which SANE should search when it's called upon to do some work. Back-ends are typically named after the scanner's manufacturer, sometimes with a model number appended, such as mustek or umax1220u. Lines that begin with a hash mark (#) are comments, and are ignored.

Scanner-Specific Configuration Files In addition to dll.conf, the /etc/sane.d directory holds configuration files for specific scanners. These files are named after the back-ends, with .conf appended, such as mustek.conf or umax1220u.conf. In most cases, you don't need to adjust these files. Sometimes, though, you can improve a scanner's performance by tweaking the settings. Most files include comments describing the parameters; uncomment the sample configurations or make the changes described in the comments to alter the scanner's performance.

Note All major Linux distributions place SANE configuration files in /etc/sane.d; however, If you build SANE from source code without changing the defaults, these files will be in /usr/local/etc/sane.d.

You can discover which scanners are available by typing two commands. First, type sane-find-scanner. This command searches likely local scanner interfaces to locate scanners. The result should be one or more output lines identifying the device filename at which a scanner resides, such as /dev/usb/scannerO. (Symbolic links between device files or duplicate device files sometimes make a scanner appear twice.) If sane-find-scanner doesn't find a scanner that you know exists, be sure it's connected and, if applicable, turned on. Also verify that you've loaded the appropriate drivers. USB scanners require the scanner driver, SCSI scanners need the driver for your SCSI host adapter and the SCSI generic (sg) driver, and parallel-port scanners require Linux parallel port support (parport and, on IA-32 systems, parport_pc). The sane-find-scanner program won't detect networked scanners (see the upcoming section, "Network Scanning," for more information on this topic).

Once you're sure that the scanner hardware is accessible, you can check to see if SANE correctly identifies the scanner model. You can perform this task by typing scanimage -L. This command calls the scanimage front-end, which is normally used to scan an image; however, with the -L parameter, this program merely identifies available scanners. If all is working, you'll see output such as this:

device ,umax1220u:/dev/usb/scanner0' is a UMAX Astra 1220U flatbed scanner

Most distributions ship with SANE configurations that disable most or all scanners. Thus, if scanimage -L doesn't yield the results you expect, you should check /etc/sane.d/dll.conf and uncomment the line corresponding to your back-end. If you need to add a very new back-end, follow the instructions that came with it to learn how to do this. Red Hat is unusual in that it ships with uncommented configurations for many common scanners; therefore, it may work without modification as soon as it's installed. This setup may slow down scanner detection slightly, though.

One other configuration detail may need attention: device file permissions. The device file (such as /dev/usb/scannerO, as returned by scanimage -L in the preceding example) must be readable and writeable by anybody who'll use the scanner. Many distributions give world read/write access to this file by default, but you should double-check this detail to be sure it's set appropriately. If the file doesn't have world read/write permissions, use chmod to change the permissions. If the file is owned by a special scanner group that has read/write permissions, add any users who should have scanner access to this group.

0 0

Post a comment