This project's goal is to implement a SANE backend for flatbed scanners with the RTS88xx chipset, the following document describes and explains the procedures to undertake in order to fully install and configure a working version of the package. Although the major aim was to write a SANE backend, to ease the testing and experimenting, a test tool was also built, it shares most of the code with the SANE backend, but provides a simpler interface and (hopefully) turns the building and configuration processes, as well as error and bug tracking more easy to cope with. Since this project is in alpha stage, it is therefore recommended that users build and use this test tool before trying to build the SANE backend.
As of the date of this writing, the package makes use of two distinct ways of accessing USB scanners:
Kernel 2.4: By using the Linux kernel native support for accessing USB scanners. This method provides a better through output, but requires a Linux kernel v2.4.13 or greater. Since most mainstream GNU/Linux distributions ship with kernels older than the required version, the user will probably need to compile a new kernel. (this method is from now on refered as kernel method)
Kernel 2.6 (default): By using libUSB. This method was implemented in order to save users the trouble to (re)compile a new Linux kernel (it is also very handy to port the test tool to other systems). It requires a Linux kernel or a OpenBSD/FreeBSD/NetBSD kernel with ugen support. Please note that you must install LibUSB 0.1.5 (or greater) in your system to use this method. (this method is from now on refered as libusb method). The most 2.6 kernels are supports the libusb.
The default under GNU/Linux systems is to build the package with both methods (if available) and let the user choose which to use at run time. Alternatively the user might want to build the package with just one of the methods, which is perfectly possible (see details bellow).
In all the examples below we will use the distribution file hp4470c-0.14b.tar.gz.
Please note that this tools are provided with no warranty, use them at your own risk.
Hardware:
A Hewlett Packard 4400c, 4470c, 3500, 3530 or a 3530 flatbed scanner
A USB controller (UHCI, OHCI or EHCI) supported by the Linux kernel
Software:
GNU/Linux systems
Linux kernel version 2.4.13 or greater (kernel method) or
The following items should be checked before trying to install the package:
It is mandatory that you run a 2.4 series Linux kernel (at least version 2.4.13 to use the kernel method) with the following tens compiled as modules or builted in:
Capability |
Module |
Notes |
---|---|---|
Support for USB - CONFIG_USB |
usbcore.o |
Required |
Preliminary USB device filesystem - CONFIG_USB_DEVICEFS |
n/a |
Required to use libusb method, optional otherwise |
UHCI (Intel PIIX4, VIA, ...) support - CONFIG_USB_UHCI |
usb-uhci.o |
Required on systems with an UHCI USB controller |
UHCI Alternate Driver (JE) support - CONFIG_USB_UHCI_ALT |
uhci.o |
An alternative driver for UHCI USB controllers (compile this or the previous, only one is required) |
OHCI (Compaq, iMacs, ...) support - CONFIG_USB_OHCI |
usb-ohci.o |
Required on systems with an OHCI USB controller |
USB Scanner support - CONFIG_USB_SCANNER |
scanner.o |
Required to use the kernel method, not recommended to use the libusb method |
In order to properly build SANE with the sane_hp_rts88xx backend, you should remove any previously installed version of SANE and all related packages (thanks to Harman Nagra for pointing this out).
Since 2.3.46 the Linux kernel includes a dynamic device filesystem called "devfs" (device file system). With devfs, there is no need to create the device files, because they are dynamically created for you. For USB Scanners, the device is created in /dev/usb/scannerX where X can range from 0 to 15 depending on the number of scanners connected to the system. To see if you have devfs, check if the file .devfsd exists in /dev by issuing the command:
bash# ls /dev/.devfsd
If .devfsd is listed, then you have devfs, so keep on reading, otherwise jump to "Without devfs". If you would like to maintain the file /dev/usbscanner0 in order to maintain compatibility with applications, then add the following to /etc/devfsd.conf:
REGISTER ^usb/scanner0$ CFUNCTION GLOBAL symlink usb/scanner0 usbscanner0
UNREGISTER ^usb/scanner0$ CFUNCTION GLOBAL unlink usbscanner0
If you intend to use more than one scanner at a time (up to 16 are permited), add a device for each USB scanner like this:
bash# mknod /dev/usbscanner[X] c 180 [Y]
where [X] is a number between 0 and 15, and [Y] = [X] + 48.
So, to
add 2 USB scanners, issue the command:
bash# mknod /dev/usbscanner0 c 180 48
bash# mknod /dev/usbscanner1 c 180 49
If you foresee using only one scanner it is best to:
bash# mknod /dev/usbscanner0 c 180 48
bash# ln -s /dev/usbscanner0 /dev/usbscanner
Set the appropriate permissions for /dev/usbscanner[0-15] (don't forget about group and world permissions). Both read and write permissions are required for proper operation. For example:
bash# chmod 666 /dev/usbscanner0
Although the process of building and installing libUSB is out of the scope of this document, we warn you of the following:
Under GNU/Linux, LibUSB requires that the preliminary USB device filesystem is mounted in the proper place (/proc/bus/usb), to mount it do:
bash# mount -t usbdevfs usbdevfs /proc/bus/usb/
or add the following line to you /etc/fstab:
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
Before using libUSB under GNU/Linux, you must unload the scanner.o module (if it's not compiled as module, but builted-in, libUSB will never be able to claim the USB interface to access the scanner). To unload the scanner.o module do the following:
bash# modprobe scanner vendor=0x3f0 product=0x805 (hp4470c=0x805; hp4400c=0x705)
Under OpenBSD/FreeBSD/NetBSD, LibUSB will not work correctly if your kernel is compiled with uscanner support, you must recompile your kernel and remove uscanner support.
Unpack the sources like this:
bash# cd /usr/src
bash# tar xvzf /path/to/sources/hp4470c-0.1x.tar.gz
bash# cd hp4470c-0.1x
To build the package with both USB access methods just issue:
bash# make
To see the what you can do with the test tool do:
bash# ./hp4470c -h
Unpack SANE backends source code to the desired directory, and use the patch-sane.sh script provided with the package (lets assume that the SANE source directory was unpacked to the parent directory of the test tool):
bash# ./patch-sane.sh ../sane-backend-x.x.x
If everything went right, then just build SANE backends, doing the usual
bash# ./configure
bash# make
bash# make install
Only for Linux today?. I have no another feed back.
If something goes wrong, we recommend reloading the scanner module and possibly also the USB controller module (for example, 'modprobe -r scanner' 'modprobe -r uhci' 'modprobe uhci' modprobe 'scanner')
To report bugs and make sugestions send me a mail. To make things easier, provide us at least the following information:
Kernel version
Package version and revision
USB method you're using
LibUSB version, if any