[sane-devel] genesys backend

Pierre Willenbrock pierre at pirsoft.dnsalias.org
Tue Oct 18 15:41:18 UTC 2005


John William Dalton schrieb:
> I've managed to get sane/xsane working with my Canon LiDE 60.
>
> I did this by compiling the experimental CVS genesys
> backend (including Pierre's recent support for the LiDE35/40/50).
> Before compilation I replaced every instance of the LiDE 35
> USB ID (0x2213) with the USB ID for the LiDE 60 (0x221c).
>
> I tested preview mode and scanning at 75dpi, 150dpi, 300dpi, 600dpi,
> 1200dpi and 2400dpi.  All worked.
>
> There were  a few minor issues noticed.  Unless mentioned the
> scan area was set to 'full':
>
> 1) In some modes there is a 'klunk' noise after the scanning head
> finishes scanning and before it starts its return journey.
> Possibly the scan head is travelling just a little too far
> and hitting the end of the track? This 'klunk' is not there when
> the same operation is done under windows.
> The nature of the klunk varies with the scan mode as below:
>
> Preview: soft klunk
>

Preview is just a regular scan(75dpi in most cases). We (currently)
don't handle that in a different way.

> 75dpi: soft klunk
>
> 150dpi: nasty klunk and short grinding noise as the scan head hits
> the end of it's travel.  I think the grinding noise is the gear
> drive of the scan head skipping a couple of teeth as the scan head
> can't go any further.
>
> 300dpi: no klunk.  Nice and smooth.  If the scan area is set to the
> bottom quarter of the page, there is a 'klunk' as the scan head reaches
> the end of its travel.  The scanning is a little noisier than windows
> (but it's faster??)

At 150 and 75dpi modes the stepper motor is driven at highest speed,
which is indeed faster than with the windows driver. I did a bit of hand
tuning of the acceleration/deceleration curve.

I think the deceleration is too fast(At least the first few steps. Many
later steps will then be misaligned, until the motor is at a speed below
its max start speed). Could you try to change the maximum final speed in
genesys_devices.c, lines 383 and 389. The speed there is expressed in
time per step, therefore higher value means lower speed.

Another value which can be tuned is the step count. This is the total
number of steps used for acceleration/deceleration.

genesys_devices.c:381
   {{
       3000, //maximum start speed, time/step
       1300, //maximum final speed, time/step
       50,   //step count
       0.8,
   },

After changing anything in tat file you need to update the timestamp of
genesys.c, using touch or saving it again.

Another place you could look at is the y size of the scan area
(genesys_devices.c:456), if the scan head really hits its upper position.

>
> 600dpi: no klunk.  The stepper motor makes a medium noise.  Under
> windows it is audible, but much a quieter low level hum.
>
> 1200dpi: no klunk.  The stepper motor makes a lot of noise.  Under
> windows it is almost silent.
>

I need to research that a bit. I can imagine two problems:
-The scanners feature some kind of power selection for the stepper
motor, so it should be set differently for high resolution modes.
-The motor is used in full step mode although it should be used in half
step mode.

>
> 2) Before each scan the scan head spends some time dithering backwards
> and forwards, before commencing the scan.  Some sort of a calibration
> run?  Under windows the scanner does not do this.  I did observe though
> that when the windows software was installed it spend a minute or so
> doing a calibration run and storing the results.
>

That is indeed the calibration, which is done before every scan. This is
because we do not cache the calibration results.

>
> I'm not sure if the above issues are LiDE 60 specific, or also
> present with the LiDE 35.  Either way, the driver seems to be a great
> piece of work and just needs some fine tuning for the LiDE 60.
>
> When I get a chance I'll try a usbsnoop on the windows driver,
> put the log on my website and post a link.  (I gather you are
> experienced at reverse engineering USB logs Pierre?  Do you
> have any interest in looking at an LiDE 60 log, or guiding me
> though the process?)
>

Getting a usb log is easy. Start the sniffer, select the device, replug
it, and there you go. The larger Problem is analyzing the resulting log.
 I created a script for that, which reformats the log and does some
interpretation. That output was the base for my test program.

> I also plan to do an audio recording of the scanner driven by both
> sane and its windows drivers.  Hopefully I can then accurately
> compare scan times and by doing an FFT, and looking at the audio
> spectrum, figure out whether there is any difference in the rate
> at which the stepper motor is being driven.
>
>
> An additional issue.  When xsane starts up, it presents a list
> of found scanners for em to chose from.  The LiDE 60 does not appear
> in this list.  I have to explicitly provide the device
> genesys:libusb:005:006, as reported by sane-find-scanner, on
> the xsane command line.  Does anyone know how to get a USB scanner
> to appear in the list of available scanners?
>

No idea, why it doesn't show up in xsanes scanner list.

Regards,
  Pierre



More information about the sane-devel mailing list