Discussion:
Canon LiDE 210
(too old to reply)
Jörg Frings-Fürst
2017-07-25 20:45:03 UTC
Permalink
Raw Message
Hello,

I forward this bug from Debian[1]. Please can someone check the
included patch?


[quote]
Dear maintainer,

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
bug #792465.

Simply initializing the Genesys_Device-Struct with 0's via memset after calling
malloc or
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
--- a/backend/genesys.c
+++ b/backend/genesys.c
@@ -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;



[/quote]

Many thanks


CU
Jörg


[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869673
--
New:
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).

Jörg Frings-FÌrst
D-54470 Lieser

Threema: SYR8SJXB
Wire: @joergfringsfuerst

IRC: j_f-***@freenode.net
     j_f-***@oftc.net

My wish list: 
 - Please send me a picture from the nature at your home.
Olaf Meeuwissen
2017-08-03 09:45:54 UTC
Permalink
Raw Message
Hi Jörg,
Post by Jörg Frings-Fürst
Hello,
I forward this bug from Debian[1]. Please can someone check the
included patch?
diff --git a/backend/genesys.c b/backend/genesys.c
index 984cead..eb8695a 100644
--- a/backend/genesys.c
+++ b/backend/genesys.c
@@ -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;
Patch looks simple enough, but I think a better place to set the initial
value of usb_mode is where dev is created, in attach() itself.

I'll attach my suggested patch to the Debian bug report[1] and follow up
there.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869673

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Loading...