[sane-devel] [PATCH] Progress on HP2400 (genesys backend)
stef.dev at free.fr
Tue Jun 7 20:20:28 UTC 2011
Le mardi 7 juin 2011 21:07:08 Alexey Osipov, vous avez écrit :
> Hi, dear SANE developers!
> Proposed patch enable support of 50/150/600dpi Color/Gray/LineArt modes
> for Hewlett-Packard ScanJet 2400 scanner.
> This was made by parsing UsbSnoop logs with stef's scripts (thank you!).
> 100/300dpi modes were already good, so I didn't touch them.
> I have also refined sensor and motor values for 1200dpi modes, but there
> are some problems with them.
> Here is a list of remaining problems I can't solve:
> 1. 1200dpi Gray mode works, but the resulting image is interlaced
> vertically with black one-pixel width lines. Why this can happen?
> Example: http://lion-simba.github.com/1200dpi_gray_lines.tiff
> 2. 1200dpi Color mode works, but very slow. Scanner warm-up and
> calibration takes approx 5 mins before head even moves. Then, when
> scanning begins, head moves forward and backward each few lines. I have
> made timestamped logs of this situation (truncated log attached). You can
> see - problem is in "gl646_bulk_read_data" which regularly hangs for
> approx 10 seconds like this:
> during warm-up and calibration:
> 1307470777: [genesys_gl646] gl646_bulk_read_data: trying to read 65472
> bytes of data 1307470778: [genesys_gl646] gl646_bulk_read_data read 65472
> bytes, 679896 remaining 1307470778: [genesys_gl646] gl646_bulk_read_data:
> trying to read 65472 bytes of data 1307470778: [genesys_gl646]
> gl646_bulk_read_data read 65472 bytes, 614424 remaining 1307470778:
> [genesys_gl646] gl646_bulk_read_data: trying to read 65472 bytes of data
> [9 seconds delay]
> 1307470787: [genesys_gl646] gl646_bulk_read_data read 65472 bytes, 548952
> remaining 1307470787: [genesys_gl646] gl646_bulk_read_data: trying to read
> 65472 bytes of data 1307470787: [genesys_gl646] gl646_bulk_read_data read
> 65472 bytes, 483480 remaining ---------------------
> during scan:
> 1307471061: [genesys_gl646] gl646_bulk_read_data: requesting 30464 bytes
> 1307471061: [genesys_gl646] gl646_bulk_read_data: trying to read 30464
> bytes of data [9 seconds delay]
> 1307471070: [genesys_gl646] gl646_bulk_read_data read 30464 bytes, 0
> remaining 1307471070: [genesys_gl646] gl646_bulk_read_data: end
> Any ideas of what is wrong? Proprietary driver running on the same
> system scan well in 1200dpi Color, so I think this is not libusb bug.
> Maybe some GL646 miscofiguration?
> 3. In all modes, there are extra pixels to the left of the image, which
> are beyond of glass window of scanner. Meanwhile, right side of image is
> cropped by (i guess) same number of pixels. I think it can be fixed by
> tuning CCD_start_xoffset/dummy_pixel/sensor_pixels in Genesys_Sensor,
> but I'm unsure what is for exactly? What is dummy_pixel?
good job, if I understand well, 50, 100, 150, 300 and 600 dpi modes are
correct. That's great.
The 1 & 2 issues are surely related. Some registers maybe incorrectly
set. What you can do is to compare all the register set at scan time with the
one from USB log at 1200 dpi. If you look at the code there some places in
genesys_gl646.c where some actions are taken depending of the CCD. Maybe a
case for the HP2400 CCD should be added.
For point 3, dummy pixel value is written in register 0x31. You can
ignore CCD_start_xoffset and tune left start of scan area with the geomertry
values of Genesys_Model hp2400c_model in genesys_devices.c
More information about the sane-devel