old-www/HOWTO/Scanner-HOWTO/sane.html

362 lines
7.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>SANE</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Scanner HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Making and Accessing the Scanner Devices"
HREF="dev-intro.html"><LINK
REL="NEXT"
TITLE="Testing Your Scanner"
HREF="testing.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Scanner HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="dev-intro.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="testing.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="SANE"
></A
>4. SANE</H1
><P
>The final prerequisite for scanner access is the SANE backend(s) and optionally, a suitable SANE-frontend.
The former are the drivers and low-level access tools that interface with your scanner, and the latter are graphical applications for access and use of your scanner within X.
Only the former are required for scanner access, though a frontend is highly recommended in order to manipulate images and to actually be able to see your images in a windowed environment without having to print them.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="GETTING-SANE"
></A
>4.1. Getting SANE</H2
><P
>You can acquire the suite of SANE backends at <A
HREF="http://www.sane-project.org/source.html"
TARGET="_top"
> http://www.sane-project.org/source.html</A
>, where you can obtain binaries for nearly all Linux distributions as well as source code.
If you are planning on compiling from source, you probably already know what to do, but the following link is available for those that want a refresher, that of the <A
HREF="http://tldp.org/HOWTO/Software-Building-HOWTO.html"
TARGET="_top"
>Software Building HOWTO</A
>.
In addition, be sure that if you have a previous sane installation that it is removed prior to installing your freshly-compiled version, and that you should acquire the most recently released stable version of the source code for compiling.</P
><P
>Those who wish to install binaries should download the corresponding file and then install as usual, i.e. for rpm-based distributions:</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
># rpm -iVh sane-backends-VERSION.rpm</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>For Debian users there is a SANE package in stable (Woody), testing (Sarge) and unstable (Sid) package repositories, so a simple <B
CLASS="COMMAND"
>apt-get install sane</B
> is all that is required, whatever version you are using.</P
><P
>Those who prefer compiling the latest version of SANE from source can acquire it from <A
HREF="ftp://ftp.mostang.com/pub/sane/"
TARGET="_top"
>ftp.mostang.com/pub/sane</A
>.
There is a more in-depth (though rather pessimistic) write-up of how to compile SANE from source and get a SCSI scanner working from scratch, at <A
HREF="http://www.xs4all.nl/~ljm/SANE/howto.html"
TARGET="_top"
>Laurent-jan's HOWTO page originally written by Steve Sheriff</A
> (the graphics are interesting, too).</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONFIG-SANE"
></A
>4.2. Configuring SANE</H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="MFGR"
></A
>4.2.1. SANE Backends</H3
><P
>Whether you obtained your distribution's official SANE package, obtained a binary from the SANE homepage or compiled your own SANE binary from source, SANE should identify the appropriate backend to use for your hardware when you call <B
CLASS="COMMAND"
>scanimage</B
> or any other frontend.
If no device is found when you run <B
CLASS="COMMAND"
>scanimage -L</B
> or your chosen frontend, see <A
HREF="troubleshooting.html"
>Section 7</A
> for more info. </P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="NETWORKED"
></A
>4.2.2. Across a Network</H3
><P
>If you are interested in making scanner services available across a network from or to a remote machine, you will need to edit the <TT
CLASS="FILENAME"
>saned.conf</TT
> file in the configuration directory of the <EM
>server</EM
> (the computer with the scanner), whether <TT
CLASS="FILENAME"
>/etc/sane.d</TT
> or <TT
CLASS="FILENAME"
>/usr/local/etc/sane.d</TT
>.
It usually consists of an entry 'scan-client.somedomain.firm' that will need to be replaced with the hostname of the client you want to be able to use the server's scanner.
If you prefer an IP address this can be used instead.</P
><P
>The saned daemon will need to be run as well as inetd or xined on the server.
See <B
CLASS="COMMAND"
>man saned</B
> for the exact changes required to inetd.conf or xined.conf.
In addition port 6566 will need to be added to the <TT
CLASS="FILENAME"
>/etc/services</TT
> file:</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>sane 6566/tcp </PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>The client computer (without the scanner) will need net.conf edited to include the server machine name, i.e., 'scan-server.somedomain.firm.'</P
><P
>Also for the client(s), be sure the entry <SPAN
CLASS="QUOTE"
>"net"</SPAN
> isn't commented out in the <TT
CLASS="FILENAME"
>dll.conf</TT
> file.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="V4L"
></A
>4.2.3. Using SANE with a Video4linux Device</H3
><P
>Video4linux devices include webcams, still cameras and video capture devices.
SANE is capable of accessing these.
To do this, locate the file in the configuration directory (<TT
CLASS="FILENAME"
>/etc/sane.d</TT
> or <TT
CLASS="FILENAME"
>/usr/local/etc/sane.d</TT
>) named <TT
CLASS="FILENAME"
>v4l.conf</TT
>.
Opening this file yields something similar to the following content:</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
># In order to use the v4linux backend you have to give the device
# You can enable multiple lines if
# you really have multible <EM
>[sic]</EM
> v4l devices.
#
/dev/bttv0
/dev/video0
/dev/video1
/dev/video2
/dev/video3</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>The initial line of this file really tells you all you need to know, so remember this when we get to the sections on testing the scanner hardware.
Just be sure that whatever device your kernel identifies your camera or other v4l device as is uncommented (i.e., has the # removed from in front of it as above).
You will obviously need to do this as root.
In addition, be sure the line 'v4l' isn't commented out in the <TT
CLASS="FILENAME"
>dll.conf</TT
> file.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="dev-intro.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="testing.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Making and Accessing the Scanner Devices</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Testing Your Scanner</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>