complete PDF
Complete EPUB
One page


9_usb PDF

(pdf) (epub) (1 page)
1 Intro
2 What is Sane?
3 Buying a scanner
4 How do I install
5 It doesn't work
6 Scanner specifics
7 . SCSI problems
8 Paralel port scanners
9 USB Problems
10 Network-scanning
11 I can make a scan! Great, what's next?

9. USB Problems

9.1. Is there a how-to or some general information on USB-scanners?

See http://www.zianet.com/k5di/usb/usb-scanner.txt

9.2. How can I use a USB scanner with Linux 2.6?

With Linux 2.4.* you could either use the kernel scanner module or libusb to access USB scanners. In Linux 2.6.4 the kernel scanner module was removed. Therefore with this and later kernels libusb must be used. While SANE automatically uses libusb when the library and its header file were present during the build of sane-backends, setting permissions will require some attention.

The device files used by libusb are located in /proc/bus/usb/ (e.g. /proc/bus/usb/001/003 ). The exact file name can be found out by running sane-find-scanner which would print libusb:001:003 in this case. While setting permissions with e.g. chmod +rw proc/bus/usb/001/003 seems to work, this change is not permanent. The permissions will be reset when the scanner is replugged or Linux is rebooted.

One solution to set permissions on-the-fly are the Linux hot-plug tools that should come with any current distribution. SANE itsself comes with a hotplug script and related documentation in the tools/hotplug/ directory. Please refer to the README in that directory for the details. You might also wish to browse through the documentation for the Plustek; it has quite a nice section on how to set-up your USB access.

/usr/share/doc/sane-backends-*/plustek/Plustek-USB.txt

9.3. Should I use "libusb" or the scanner.o module?

It is recomended that you use libusb. Most backends now support it. Libusb is a normal library libusb.so in /usr/lib or so, which allows low-level access to usb devices from user-space applications. This library is automatically used when the permissions in /proc/bus/usb/0*/* allow you to access the device. You'll need the usbfb mounted to /proc/bus/usb and the permissions must allow your user to access the device.

Note that RedHat calls the usbfs usbdevfs. They are however the same.

9.4. What module should I load in Linux for my scanner?

Basically, a Linux must recognise the USB. This means you should load the module ohci, uhci or usb/uhci (for USB 1.1) or ehci (for usb 2.0). Note that this applies to Linux kernel 2.2 and 2.4 only.

There are three kernel drivers for USB scanners available. The drivers are not interchangeable. If it works with one driver it won't work with any other driver.

1. The generic usbscanner driver

This driver supports a multitude of scanners. Loaded as a module it can be made to recognise any USB scanner with two or three USB-endpoints. That doesn't mean that it will work with every type of scanner.

Available: 2.4 kernels and backport to 2.2; obsolete for 2.6.

Usage: The driver implements a genuine USB device. A backend must be aware of the difference to scsi.

Scanners: many.

Known issues: It will recognise some scanners it can't drive

2. The microtek driver

This driver will recognise a few scanners made by the company it is named for. It's tested only with the X6.

Available: Linux 2.4-kernels. The backport doesn't work.

Usage: To SANE the scanners appear to be scsi devices. The scsi buffer must be limited to 32K SANE 1.0.3 should work out of the box, if the buffer is shrunk.

Scanners: X6 and perhaps some other microtek scanners

Known issues: C6 crashes.

3. The usbscsiscanner driver

This driver will work for the HP 5300C only.

Available: As a patch to the 2.4 kernels. The patch must be extracted from the linux-usb-devel mailing list's archive.

Usage: The scanner appears to be a scsi device. The avision backend must be hacked to recognise it.

Scanners: HP 5300C

Known issues: As yet none, as it has been tested only once

After this, you'll probably want to do a:

modprobe scanner

9.5. How can I avoid having to 'modprobe scanner' after each boot?

There are three soliutions:

Compile scanner.o into the kernel, not as a module. load scanner.o unconditionally from the init scripts, for example from /etc/rc.d/rc.local

install the hotplug utilities and compile USB support as modules Debian users can put

scanner in

/etc/modules

to load at start-up

9.6. Should I make a link /dev/scanner -> /dev/usbscanner

No. All the SCSI-backends will try to access /dev/scanner. They will send SCSI-commands which may not be apprpriate for your USB-scanner.

9.7. On my Linux 2.4.16-kernel, the scanner causes a system-freeze

There's a bug in the kernel USB scanner driver that may freeze your system. Update to kernel version 2.4.17.

9.8. Using the "alternate" uhci kernel driver, scanning works but is much slower than it was before.

Several people have noticed severe performance degredation with the latest uhci (JE) drivers. The alternative module named "usb-uhci" (also included in the standard kernel distribution, option CONFIG_USB_UHCI) does not show this effect and allows much faster scans.

9.9. USB hardware problems.

Some people have reported problems when the scanner is connected through an USB hub, or using an nForce USB card. In all cases, faulty hardware seemd to be the problem. And in many cases, the hardware seemed to function on Windows systems (at least for a while).