sane-project-website/man/sane-usb.5.html

169 wiersze
7.7 KiB
HTML

<HTML>
<HEAD>
<TITLE>sane-usb.5</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF TEXT=#000000><H1 ALIGN=CENTER><IMG SRC="../images/sane.png" HEIGHT=117 WIDTH=346></H1>
<H1>sane-usb.5</H1>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
<B><A HREF="sane-usb.5.html">sane-usb(5)</A></B> SANE Scanner Access Now Easy <B><A HREF="sane-usb.5.html">sane-usb(5)</A></B>
</PRE>
<H2>NAME</H2><PRE>
sane-usb - USB configuration tips for SANE
</PRE>
<H2>DESCRIPTION</H2><PRE>
This manual page contains information on how to access scanners with a
USB interface. It focusses on two main topics: getting the scanner de-
tected by the operating system kernel and using it with SANE.
This page applies to USB most backends and scanners, as they use the
generic sanei_usb interface. However, there is one exceptions: USB
Scanners supported by the microtek2 backend need a special USB kernel
driver, see <B><A HREF="sane-microtek2.5.html">sane-microtek2(5)</A></B> for details.
</PRE>
<H2>QUICK START</H2><PRE>
This is a short HOWTO-like section. For the full details, read the fol-
lowing sections. The goal of this section is to get the scanner de-
tected by <B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B>.
Run sane-find-scanner. If it lists your scanner with the correct vendor
and product ids, you are done. See section <B>SANE</B> <B>ISSUES</B> for details on
how to go on.
sane-find-scanner doesn't list your scanner? Does it work as root? If
yes, there is a permission issue. See the <B>LIBUSB</B> section for details.
Nothing is found even as root? Check that your kernel supports USB and
that libusb is installed (see section <B>LIBUSB</B>).
</PRE>
<H2>USB ACCESS METHODS</H2><PRE>
For accessing USB devices, the USB library libusb is used. There used
to exist another method to access USB devices: the kernel scanner
driver. The kernel scanner driver method is deprecated and shouldn't be
used anymore. It may be removed from SANE at any time. In Linux, the
kernel scanner driver has been removed in the 2.6.* kernel series. Only
libusb access is documented in this manual page.
</PRE>
<H2>LIBUSB</H2><PRE>
SANE can only use libusb 0.1.6 or newer. It needs to be installed at
build-time. Modern Linux distributions and other operating systems come
with libusb.
Libusb can only access your scanner if it's not claimed by the kernel
scanner driver. If you want to use libusb, unload the kernel driver
(e.g. rmmod scanner under Linux) or disable the driver when compiling a
new kernel. For Linux, your kernel needs support for the USB filesystem
(usbfs). For kernels older than 2.4.19, replace "usbfs" with "usbdevfs"
because the name has changed. This filesystem must be mounted. That's
done automatically at boot time, if /etc/fstab contains a line like
this:
none /proc/bus/usb usbfs defaults 0 0
The permissions for the device files used by libusb must be adjusted
for user access. Otherwise only root can use SANE devices. For <I>Linux</I>,
the devices are located in /proc/bus/usb/ or in /dev/bus/usb, if you
use udev. There are directories named e.g. "001" (the bus name) con-
taining files "001", "002" etc. (the device files). The right device
files can be found out by running scanimage -L as root. Setting permis-
sions with "chmod" is not permanent, however. They will be reset after
reboot or replugging the scanner.
Usually udev or for older distributions the hotplug utilities are used,
which support dynamic setting of access permissions. SANE comes with
udev and hotplug scripts in the directory tools/udev and tools/hotplug.
They can be used for setting permissions, see /usr/lo-
cal/share/doc/sane-backends/README.linux, tools/README and the README
in the tools/hotplug directory for more details.
For the <B>BSDs</B>, the device files used by libusb are named <I>/dev/ugen*</I>.
Use chmod to apply appropriate permissions.
</PRE>
<H2>SANE ISSUES</H2><PRE>
This section assumes that your scanner is detected by sane-find-scan-
ner. It doesn't make sense to go on, if this is not the case. While
sane-find-scanner is able to detect any USB scanner, actual scanning
will only work if the scanner is supported by a SANE backend. Informa-
tion on the level of support can be found on the SANE webpage
(<I>http://www.sane-project.org/</I>), and the individual backend manpages.
Most backends can detect USB scanners automatically using "usb" config-
uration file lines. This method allows one to identify scanners by the
USB vendor and product numbers. The syntax for specifying a scanner
this way is:
usb <I>VENDOR</I> <I>PRODUCT</I>
where <I>VENDOR</I> is the USB vendor id, and <I>PRODUCT</I> is the USB product id of
the scanner. Both ids are non-negative integer numbers in decimal or
hexadecimal format. The correct values for these fields can be found by
running sane-find-scanner, looking into the syslog (e.g., /var/log/mes-
sages) or under Linux by issuing the command "cat /proc/bus/usb/de-
vices". This is an example of a config file line:
usb 0x055f 0x0006
would have the effect that all USB devices in the system with a vendor
id of 0x55f and a product id of 0x0006 would be probed and recognized
by the backend.
If your scanner is not detected automatically, it may be necessary to
edit the appropriate backend configuration file before using SANE for
the first time. For a detailed description of each backend's configu-
ration file, please refer to the relevant backend manual page (e.g.
<B><A HREF="sane-mustek_usb.5.html">sane-mustek_usb(5)</A></B> for Mustek USB scanners).
Do <B>not</B> create a symlink from <I>/dev/scanner</I> to the USB device because
this link is used by the SCSI backends. The scanner may be confused if
it receives SCSI commands.
</PRE>
<H2>ENVIRONMENT</H2><PRE>
<B>SANE_DEBUG_SANEI_USB</B>
If the library was compiled with debug support enabled, this en-
vironment variable controls the debug level for the USB I/O sub-
system. E.g., a value of 128 requests all debug output to be
printed. Smaller levels reduce verbosity. Values greater than 4
enable libusb debugging (if available). Example: export SANE_DE-
BUG_SANEI_USB=4.
<B>SANE_USB_WORKAROUND</B>
If your scanner does not work when plugged into a USB3 port, try
setting the environment variable SANE_USB_WORKAROUND to 1. This
may work around issues which happen with particular kernel ver-
sions. Example: export SANE_USB_WORKAROUND=1.
</PRE>
<H2>SEE ALSO</H2><PRE>
<B><A HREF="sane.7.html">sane(7)</A></B>, <B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B>, <B>sane-"backendname"</B>(5), <B><A HREF="sane-scsi.5.html">sane-scsi(5)</A></B>
</PRE>
<H2>AUTHOR</H2><PRE>
Henning Meier-Geinitz &lt;henning@meier-geinitz.de&gt;
14 Jul 2008 <B><A HREF="sane-usb.5.html">sane-usb(5)</A></B>
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>