The LiDE 60 and other GL841 Based Scanners Under SANE/Linux

As the owner of a Canon LiDE 60 scanner, I am attempting to get it to work with SANE.

Update

As at 26th July 2006 LiDE 60 support is in Debian Unstable (sid) and enabled by default (libsane 1.0.18-2). After installing the libsane package (automatically installed if you install the xsane scanning program) there should be nothing else to do to get your LiDE 60 working. Just don't forget to plug it in!

In case the above doesn't work I've left the old instructions for getting an LiDE 60 working below.

Obsolete instructions (see above)

As at April 2006 the LiDE 60 works with the latest version of SANE (1.0.17). Support is not enabled by default in Debian Unstable (sid)! The steps to get an LiDE60 working are:

  1. Install the SANE libraries and a suitable scanning application (xsane is popular):
    # apt-get install libsane xsane
  2. Edit the file '/etc/sane.d/hotplug/libsane.db' and add the lines:
    # Canon Inc.|LIDE 60
    0x04a9 0x221c root:scanner 0664

    (This makes the hotplug system recognise the PCI ID of the LiDE60.)
  3. Edit the file '/etc/udev/libsane.rules' and add the lines:
    # Canon Inc.|LIDE 60
    SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="221c", MODE="664", GROUP="scanner"

  4. Restart the hot plug system to pick up the change you just made:
    # /etc/init.d/hotplug restart
  5. Restart the udev system to pick up the change you just made:
    # /etc/init.d/udev restart
  6. Plug in your LiDE60 and start xsane. Xsane should detect your LiDE60 and you should be able to scan documents with it under Linux.
  7. If you still can't get the scanner to work, try rebooting. This restarts all daemons and makes sure the system will read the changes you have made.

I suspect LiDE60 support won't be enabled by default until libsane has had more testing with the LiDE60. LiDE60 support in SANE is brand new, and hasn't widely used (yet).

Figuring out the USB command sequence for the GL841 and LiDE60.

The first step has been to try and understand how to drive the scanner and the GL841 chip it contains.

The scanner was connected to a Windows machine and a log of the USB commands captured using a USB sniffer.

The resulting log was parsed using a modified version of the parseusbsnoop.awk script from SANE.

A PERL script was then written to convert this simplified log into a high level description of how to drive the scanner. It is a work in progress, but it is currently able to understand the entire command set for the GL841 chip. As such it should be a useful tool for understanding any GL841 based scanner, not just the LiDE 60.

The script is able to describe how each bit field in the GL841 is being manipulated and highlights accesses on which the value of a bit field changes. In addition the script can document accesses the front end WM8199 chip and some high level actions, such as reading blocks of data from the scanner. Work is in progress to extend the range of functions recognised, the eventual aim being to get the script to recognise function such as "scan in colour at 300dpi".

It is also possible to control the level to which the log is interpreted by adjusting the value of the variable $comment_level in the script. For example:

0 = no comments. Input is mirrored to output
1 = Input is anotated to the GL841 register level
2 = Input is anotated to the GL841 register and field level
3 = Input is anotated to the level of WM8199 registers
>3 = Input is annotated as far as possible.

An Example

The command sequence to produce the example output is:

$ parseusbsnoop_gl841.awk < usbsnoop.log > parsed.log
$ lide60_analyse.pl parsed.log

or for the adventurous:

$ parseusbsnoop_gl841.awk < usbsnoop.log | lide60_analyse.pl

Here is an example of the (long!) output of the PERL script as at 23rd November 2005. The sequence of scanner operations represented by this script is below. The hyperlinks jump to the relevant position in the log.

Start time (seconds)End time (seconds)Action
0 Start Log
+15 Attempted Preview, but it failed with an error.
+60 Preview
+92+176Calibration
+185 Full platen, 75 dpi, colour
+215 Full platen, 75 dpi, grayscale
+240 Full platen, 75 dpi, Black and white
+282 Square from 5cm to 15cm, 75 dpi, colour
+317 Full platen, 50 dpi, colour
+339 Full platen, 100 dpi, colour
+370 Full platen, 150 dpi, colour
+400 Full platen, 200 dpi, colour
+460 Full platen, 300 dpi, colour
+530 End Log

Links


Copyright John Dalton, 26th December 2005

This page is released under the terms of the GNU General Public License