2017-07-25 20:45:03 UTC
I forward this bug from Debian. Please can someone check the
the following problem caused our Canon LiDE 210 to produce loud noises by the
motor until the scanner is manually turned off or to abort with the message
"Error during device I/O".
I refer to version 1.0.25-2 and 1.0.25-4.1 but also tested with the newest
changes in the genesys-backend from experimental / git.
I think this is the problem causing the behaviour:
In the "attach" function in genesys.c the memory for the Genesys_Device-struct
is allocated by malloc and "already_initialized" is set to false.
However, as far as i can see, the usb_mode member is never initialized
before "sanei_genesys_asic_init" in genesys_low.c is accessing it. Here it is
wrongly assumed that it should be >= 0, otherwise the whole
part which decides which usb mode is used is going to be skipped and the value
stays as it is.
This leads (if, as in my case, usb_mode is < 0) to the described behavior,
since for example now in genesys_gl124.c "gl124_slow_back_home" simply returns
with SANE_STATUS_GOOD (is there maybe a surrounding #ifdef UNIT_TESTING macro
missing?) which I think
is not correct.
It seems likely to me that this is also reason for the behaviour described in
Simply initializing the Genesys_Device-Struct with 0's via memset after calling
just setting usb_mode to 0 is solving the problem for me:
diff --git a/backend/genesys.c b/backend/genesys.c
index 984cead..eb8695a 100644
@@ -210,6 +210,8 @@ sanei_genesys_init_structs (Genesys_Device * dev)
Â Â Â Â Â Â Â Â Â Â Â dev->model->motor_type);
Â Â Â Â Â }
+Â Â dev->usb_mode = 0;
Â Â Â /* set up initial line distance shift */
Â Â Â dev->ld_shift_r = dev->model->ld_shift_r;
Â Â Â dev->ld_shift_g = dev->model->ld_shift_g;
GPG Fingerprint: 63E0 075F C8D4 3ABB 35ABÂ Â 30EE 09F8 9F3C 8CA1 D25D
GPG key (long) : 09F89F3C8CA1D25D
GPG KeyÂ Â Â Â Â Â Â Â : 8CA1D25D
CAcert Key S/N : 0E:D4:56
Old pgp Key: BE581B6E (revoked since 2014-12-31).
Â Â Â Â Â firstname.lastname@example.org
My wish list:Â
Â - Please send me a picture from the nature at your home.