This commit is contained in:
gferg 2004-06-29 13:50:39 +00:00
parent a0a6376e2f
commit 6f3236a9b2
3 changed files with 59 additions and 54 deletions

View File

@ -4012,7 +4012,7 @@ the least possible space. Particularly aimed at notebook users. </Para>
Scanner-HOWTO</ULink>,
<CiteTitle>The Scanner HOWTO</CiteTitle>
</Para><Para>
<CiteTitle>Updated: Jan 2004</CiteTitle>.
<CiteTitle>Updated: May 2004</CiteTitle>.
Documents the steps necessary for access and use of a photographic
scanner device on a system running Linux. </Para>
</ListItem>

View File

@ -1112,7 +1112,7 @@ fax anything under Linux (and other Unices in general). </Para>
Scanner-HOWTO</ULink>,
<CiteTitle>The Scanner HOWTO</CiteTitle>
</Para><Para>
<CiteTitle>Updated: Jan 2004</CiteTitle>.
<CiteTitle>Updated: May 2004</CiteTitle>.
Documents the steps necessary for access and use of a photographic
scanner device on a system running Linux. </Para>
</ListItem>

View File

@ -17,6 +17,14 @@
<!--revision history-->
<revhistory>
<revision>
<revnumber>1.1</revnumber>
<date>2004-05-16</date>
<authorinitials>jhs</authorinitials>
<revremark>Libusb and kernel 2.6-series updates, clarifications</revremark>
</revision>
<revision>
<revnumber>1.05</revnumber>
@ -166,7 +174,7 @@ I apologize in advance, but I cannot answer any technical questions or <quote>pl
I am neither an expert on scanners nor do I have every model of scanner ever manufactured available for testing.
My only contribution to scanner support within Linux is the compiling of my own limited experience with the exaustive input of others to produce a succinct but (hopefully) straightforward HOWTO.
My only contribution to scanner support within Linux is the compiling of my own limited experience with the exhaustive input of others to produce a succinct but (hopefully) straightforward HOWTO.
</para>
</sect2>
@ -179,7 +187,7 @@ First, filenames are referenced in a paragraph like so: <filename>/path/file</fi
<para>
Commands in Linux are executed (or 'called') at the command prompt, otherwise known as the 'command line.'
If you are in the non-graphical (text-based) environment you will usually be presented the Bash shell prompt which is a dollar sign: <screen>$</screen>...or the hash mark: <screen>#</screen>...if you have logged in as root or have acquired root, or 'superuser' privleges.
If you are in the non-graphical (text-based) environment you will usually be presented the Bash shell prompt which is a dollar sign: <screen>$</screen>...or the hash mark: <screen>#</screen>...if you have logged in as root or have acquired root, or 'superuser' privileges.
You can also access the Bash shell in the X window system, otherwise known as X or X11, with an <ulink url="http://invisible-island.net/xterm/">xterm</ulink> or similar X-terminal-emulator.
@ -262,7 +270,8 @@ Information on enabling the USB subsystem and USB scanner support is found in <x
<sect2 id="parport-type">
<title>Parallel Port Scanners</title>
<para>Parallel-port scanners on the whole can be made to work if there is a backend that supports them, however if your device also has a USB port (which the vast majority of new scanners released nowadays do) and a working USB backend you are strongly encouraged to use that instead, as it may be more easily configured.
</para>
<para>
If your model has only a parallel-port interface and a proprietary or non-standard controller you could be out of luck. If you have found there is a supported backend for the parallel-port interface of your scanner, then you should see <xref LinkEnd="parport-general">.
</para>
</sect2>
@ -272,9 +281,9 @@ If your model has only a parallel-port interface and a proprietary or non-standa
<para>
Some IEEE 1394 scanners are supported as of the time of this writing, particularly those manufactured by Nikon and Epson.
The IEEE 1394 interface has been supported since the 2.4-series Linux kernel.
The IEEE 1394 interface has been supported since the 2.4-series Linux kernel. IEEE 1394 scanners require your system be equipped with a IEEE 1394 PCI card or a mainboard IEEE 1394 port, as well as have IEEE 1394 support enabled in your kernel or as a loaded module.
If you have IEEE 1394 support in your kernel you should check the SANE supported devices by manufacturer link in <xref linkend="interfaces"> and read the manpage next to your hardware (if any) for any issues related to your specific hardware.</para>
You should check the SANE supported devices by manufacturer link in <xref linkend="interfaces"> and read the manpage next to your hardware (if any) for any issues related to your specific hardware.</para>
</sect2>
<sect2 id="ossupport">
@ -284,12 +293,14 @@ If you have IEEE 1394 support in your kernel you should check the SANE supported
<sect2 id="libusb">
<title>USB Scanners and Libusb</title>
<para>
This section was at one time entitled <quote>USB Scanner Kernel Support,</quote> but the existence of <ulink url="http://libusb.sourceforge.net/">libusb</ulink> promises to make the need for a USB-scanner enabled kernel unnecessary.
This section was at one time entitled <quote>USB Scanner Kernel Support,</quote> but the existence of <ulink url="http://libusb.sourceforge.net/">libusb</ulink> promises to make the need for a USB-scanner enabled kernel unnecessary. Libusb is a project to create a userspace (i.e., non-kernel) library to access USB devices regardless of operating system.
For more information on the differences between these consult <command>man sane-usb</command>.
If you would prefer the more conventional kernel support for your USB Scanner, go on to <xref linkend="usb-kernel">.
</para>
<para>
If you would prefer the more conventional kernel support for your USB Scanner, go on to <xref linkend="usb-kernel">, but be advised that kernel support for USB scanner devices is dropped in favor of libusb in kernel version 2.6.0 and higher.
Most distributions at this point are offering libusb in their stable branches (and some install it by default), so if you don't already have kernel support for USB scanner devices then you may only have to install the libusb package in order to access your device.
@ -376,11 +387,11 @@ Since you probably already know if your card is supported from the <ulink url="h
<title>Kernel USB and USB Scanner Support</title>
<para>
For USB scanner support, you will need USB subsystem support in your kernel, whether usb-ohci, usb-ehci, or whatever protocol of USB driver your system prefers.
USB support has been present in the Linux kernel since the late 2.2 series.
USB support has been present in the Linux kernel since the late 2.2-series.
For a more in-depth discussion of USB support in general, I direct you to the <ulink url="http://www.linux-usb.org/">linux-usb project site</ulink>.
If you wish to use the kernel to access your scanner (instead of libusb oulined in <xref linkend="libusb">) you will need to have 'USB scanner support' enabled, which, if present, is visible within <command>dmesg</command>, or by <command>lsmod</command> if a loaded module.
If you have a 2.4-series of kernel or earlier and wish to use the kernel USB-scanner support to access your scanner (instead of libusb outlined in <xref linkend="libusb">) you will need to have 'USB scanner support' enabled, which, if present, is visible within <command>dmesg</command>, or by <command>lsmod</command> if a loaded module.
If you want to find out which modules are loaded, at the command line or in an xterm type the following:
</para>
@ -509,49 +520,27 @@ The following section applies to all hardware types.
Some specifics with regard to scanner interface types are mentioned in the paragraphs at the end of this section.</para>
<sect2 id="devfsd">
<title>Device Filesystem</title>
<title>Device Filesystem and Udev</title>
<para>
<ulink url="http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html">Devfs</ulink>, or 'device filesystem' has been an option in the Linux kernel since the late 2.2 series.
<ulink url="http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html">Devfs</ulink>, or 'device filesystem' has been an option in the Linux kernel since the late 2.2-series.
If you haven't used it up to this point then I would suggest you at least consider it.
It can immensely simplify device management.
Devfsd, the device filesystem daemon, creates and removes devices on your system dynamically without the need for user input.
You can tell if your system is running devfsd if you run <command>ls -f /dev/</command> at the command line or in an xterm, and see mostly symlinks pointing to a device file, or <quote>node</quote>, within a logically ordered hierarchy of subdirectories within <filename>/dev</filename>.
You can also see devfsd running when you check running programs with <command>ps -A</command> at the command line.
The daemon consumes very little memory.
If you are running devfsd/devfs you can probably skip the following sections as the archaic process of creating device nodes will be done for you and it's simply a matter of finding the device by selecting the appropriate symlink in <filename>/dev</filename>.
Devfsd, the device filesystem daemon, creates and removes devices on your system dynamically without the need to manually create devices. If you are running devfsd/devfs you can probably skip the following sections as the process of creating device nodes will be done for you and it's simply a matter of finding the appropriate device node in <filename>/dev</filename>.
</para>
<para>If you want to give devfs a try, you need to enable '/dev file system' and 'Automatically mount at boot' in the 'File Systems' section of kernel configuration.
Yes, it absolutely requires a recompile of your kernel if you don't have it in there already.
WARNING: the only other supporting package required is 'devfsd' that you can obtain from your distribution vendor.
WARNING: If you enable devicefs to automatically mount at boot-time without installing the devfs daemon you will be left with an unbootable system!</para>
<para>
Devfs does not obviate the need to change permissions of devices for access by users.</para>
<para>
Naturally the above comments about devfs are the opinion of your humble author (among others) and should be treated as just that, especially if you are a relative newbie or are not quite ready to compile your own kernel.</para>
<para>
Beginning in the 2.6 series kernel devfs has been deprecated in favor of a userspace (i.e., non-kernel) daemon known as udev, though devfs remains as an option.
Beginning in the 2.6-series kernel devfs has been deprecated in favor of a userspace daemon known as udev, though devfs remains as an option.
You can find information on udev <ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ">here</ulink> if you are inclined to live on the bleeding edge.
You can find information on udev <ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ">here</ulink>.
</para>
</sect2>
<sect2 id="dev-manual">
<title>Creating Devices Manually</title>
<para>If you aren't running devfs and devfsd, this is how it will need to be done, unless you are using libusb for a USB scanner, in which case you can skip this step and move on to <xref linkend="SANE">.
<para>If you are running a system with correctly configured devfs, udev or libusb, you can skip this step and go to <xref linkend="SANE">.
There are two ways to accomplish the creation of necessary devices manually. One is to use <command>MAKEDEV</command> and the other is to create the device nodes at the command line.
</para>
@ -648,36 +637,36 @@ It is a good idea to be sure that your user account can access the device once a
The most security-conscious way to do that is to add scanner access to a particular group.
On my system, the members of the group 'video' are allowed to use the scanner and other photographic devices.
On my system, the members of the group 'scanner' are allowed to use the scanner.
The way to accomplish this is to first change the ownership of the devices in <filename>/dev</filename> like so (as root):
</para>
<para><screen>
# chown root.video /dev/usb/scanner*
# chown root.scanner /dev/usb/scanner*
</screen></para>
<para>...where <command>root.video</command> are the owner and group the device will now belong to.
<para>...where <command>root.scanner</command> are the owner and group the device will now belong to.
Obviously the specific command will vary by your system and the type of device, whether <filename>/dev/sg*</filename> on SCSI scanners, etc.
It is important that you change the ownership of the device node itself and not the symlink; symlinks' ownerships are affected only by changing the parent devices or files they point to.
</para>
<para>To see if your user account is a member of the group in question, as root issue the following command: <command>grep -e video /etc/group</command>.
<para>To see if your user account is a member of the group in question, as root issue the following command: <command>grep -e scanner /etc/group</command>.
You should see something like the following:</para>
<para><screen>
video:x:44:
scanner:x:103:
</screen></para>
<para>...where '44' is the group number.
<para>...where '103' is the group number.
Since no members follow the last colon in the 'video' group we can add them, let's say user 'jhs' with the command</para>
Since no members follow the last colon in the 'scanner' group we can add them, let's say user 'jhs' with the command</para>
<para><screen>
# adduser jhs video</screen></para>
# adduser jhs scanner </screen></para>
<para>After this it's simply a matter of allowing read and write access for the user in question of the device like so:</para>
@ -814,15 +803,31 @@ If you have a SCSI or a USB scanner, at the command line you can issue the follo
<para>
<screen>$ sane-find-scanner</screen></para>
<para>...which should find and identify your scanner from a list of possible devices.
<para>...which should find and identify your scanner from a list of possible devices. (Note to Debian users: starting with Sarge, or unstable, sane-find-scanner is available in the 'sane-utils' package. In Woody it is available in the 'libsane' package.)
If your scanner is a type not looked for by <command>sane-find-scanner</command>, you can try
If your scanner is a type not looked for by <command>sane-find-scanner</command>, you can try as root
<command>scanimage --list-devices</command>
which may yield more information about attached devices (you may need to do this twice).
which should yield information about attached devices. For example, this is the output on my system:
<screen>
device `v4l:/dev/video0' is a Noname BT878 video (Hauppauge (bt878)) virtual device
device `epson:/dev/scanner0' is a Epson Perfection1240 flatbed scanner
</screen>
whereas when using libusb it registers as
<screen>
device `v4l:/dev/video0' is a Noname BT878 video (Hauppauge (bt878)) virtual device
device `epson:libusb:001:003' is a Epson Perfection1240 flatbed scanner
</screen>
Make note of the 'backend:device' information obtained; this will be our device name to specifically access the scanner from the command line.
Also, be aware that sane-find-scanner is a separate utility that does not guarantee support under SANE, it only looks for devices that claim to be scanners.
Note that sane-find-scanner is a separate utility that does not guarantee support under SANE, it only looks for devices that claim to be scanners.
</para>
<para>Next you should test the scanner's image grabbing ability.
@ -846,7 +851,7 @@ For example, if you have an Epson and a Mustek scanner, using "-d epson" or "-d
The complete path is only needed if you have more that one scanner supported by the same backend.
Obviously <command>/dev/scanner</command> should be substituted with whatever scanner device you've configured (or <filename>/dev/video0</filename> in the case of a v4l device).
Obviously <command>/dev/scanner</command> should be substituted with whatever scanner device you've configured (e.g., <filename>/dev/video0</filename> in the case of a v4l device, and libusb as seen in the sane-find-scanner example above).
The <command>--format</command> switch can be either pnm or tiff, but if left out will default to pnm.
@ -941,7 +946,7 @@ If your scanner is supported and you can see your hardware you'll know your prob
<para>First, locate your configuration files, located in one of the usual places: <filename>/etc/sane.d</filename> or <filename>/usr/local/etc/sane.d</filename>.
In genera,l if you obtained a precompiled package from your distribution or a binary from the SANE homepage it is in <filename class="directory">/etc</filename>, while if you compiled it from source it is in <filename>/usr/local/etc/sane.d</filename>.
In general, if you obtained a precompiled package from your distribution or a binary from the SANE homepage it is in <filename class="directory">/etc</filename>, while if you compiled it from source it is in <filename>/usr/local/etc/sane.d</filename>.
Change (<command>cd</command>) to that particular directory.