[sane-devel] Genesys HP scanjet 2400

Gerald Murray gmurray at cloudnet.com
Sun Nov 27 11:47:35 UTC 2005

Thanks to Pierre Willenbrock and Stefane Voltz.  Both have done
fine work on the genesys backend.

[PATCH] at the end.
Scanner: hp scanjet 2400
using sane-backends-cvs20051124

Problems remaining:
- Head moves two times the expected distance.
- Excessive time in genesys_warm_up_lamp()
- There was no image in the STDOUT output (file size 1523712)
- Status register for lamp reports OFF, but lamp remains ON.
- Head remains where the scan stopped.
- In lineart mode, depth:1 was what I expected.  depth:8 was reported.

So, that is the report as of now.  The rest is the detail of the above.

The program loops in genesys_warm_up_lamp().
My tests showed that there was a diff = 0.000 % after about 45 seconds.
I patched the code to report SANE_STATUS_GOOD after 45 seconds period.

The scanner was expected to stop at 110mm, but continued to 228mm and parked.
The lamp stayed on, even after the provided off-time was exceeded.
The scan log showed no reason for stopping the scan.
54886 lines into the log, there is the line:
[genesys_gl646] gl646_park_head (wait_until_home = 1)
[genesys] sanei_genesys_read_register (0x41, 0xe4) completed (1 time)
[genesys] sanei_genesys_read_register (0x41, 0xc5) completed (2979 times)
[genesys] sanei_genesys_read_register (0x41, 0xc1) completed (45128 times)
NOTE: the lamp was ON, even though the register reports it as OFF.
The program stalled, and received SIGKILL.

The command:
scanimage --lamp-off-time 1
# turns the lamp off and executes slow-go-home certainly slow enough.
--mode lineart
[genesys] genesys_read_ordered_data: dumping current_setup:
        pixels: 1176
        lines: 1299
        depth: 8        <-- can this be right for lineart?
        channels: 1
        exposure_time: 11000
        xres: 300
        yres: 300
        half_ccd: yes
        stagger: 0
        max_shift: 0

best regards,

Patch only affects the log output.  This adjustment is consistent with
the gl646 document that shows the address is >> 4 in the register.
Currently, this just 'appears' wrong, but is actually correct.

--- sane-backends/backend/genesys.c     2005-11-24 00:01:51.000000000 -0600
+++ sane-backends+/backend/genesys.c    2005-11-27 11:03:46.000000000 -0600
@@ -325,9 +325,9 @@
   SANE_Status status;

   DBG (DBG_io,
-       "sanei_genesys_set_buffer_address: setting address to 0x%05x\n",
+       "sanei_genesys_set_buffer_address: set to 0x%05x (before>>4 into
        addr & 0xfffffff0);
+  /* the buffer is offset 4 bits addr A[18..0] = B[14..0] */
   addr = addr >> 4;

   status = sanei_genesys_write_register (dev, 0x2b, (addr & 0xff));

More information about the sane-devel mailing list