[#315803] Canon LiDE 110 (genesys) - possible timing issue with USB3

View Trackers | Bugs | Export CSV

2017-07-31 08:46
Submitted by:
Jeff MacLoue (jmacloue-guest)
Assigned to:
Gerhard Jaeger (gja-guest)
backends (drivers)
Canon LiDE 110 (genesys) - possible timing issue with USB3

Detailed description
I have a Canon LiDE110 scanner (GL847-based, according to the driver output) which doesn't work at all with my USB3-only motherboard (ASUS Q170M-C, no "companion" USB2 hub so the usual fix doesn't work) but works reliable enough with my older laptop (USB2 controller).

The usual recommendation is to plug it through a USB2 or USB1.1 hub which helps a bit but still scanning fails half of the time.

However as I discovered there is a hack to make it work through USB3 port: adding SANE_DEBUG_GENESYS_LOW=128 to the environment:


It makes the scanner function reliable enough (I'm using this hack for some time now, and just have scanned around 10 pages in a row with only a single failure).

This looks like a timing issue to me - when the driver doesn't need to output so many debug messages it still fails: e.g., with SANE_DEBUG_GENESYS_LOW=8 it usually freezes after a message like this:

[genesys_low] sanei_genesys_read_data_from_scanner (size = 403104 bytes)
[genesys_low] sanei_genesys_read_valid_words start
[genesys_low] sanei_genesys_read_hregister(0x102)=0x00
[genesys_low] sanei_genesys_read_hregister(0x103)=0x00
[genesys_low] sanei_genesys_read_hregister (0x104): failed while reading register: Invalid argument
[genesys_low] sanei_genesys_read_valid_words: Invalid argument
[genesys_low] sanei_genesys_read_data_from_scanner: checking for empty buffer failed: Invalid argument
[genesys_low] sanei_genesys_read_gl847_register(0x32)=0x00
[genesys_low] sanei_genesys_write_gl847_register (0x32, 0x00): failed : Invalid argument
[genesys_low] sanei_genesys_read_hregister(0x101)=0xb8
[genesys_low] sanei_genesys_read_hregister(0x100)=0xf1
[genesys_low] sanei_genesys_write_gl847_register (0x01, 0xa2) completed
[genesys_low] sanei_genesys_read_hregister(0x101)=0xf8
[genesys_low] sanei_genesys_read_hregister(0x100)=0xf0
[genesys_low] sanei_genesys_read_gl847_register(0x32)=0x5b
[genesys_low] sanei_genesys_write_gl847_register (0x32, 0x59) completed

(Not always register 0x104, I've seen 0x105 and 0x103 as well)

The whole scanning operation times out afterwards but the next time it may work as expected - without restarting xsane or unplugging the scanner. Also this failure happens only during scanner initialization and calibration - I don't remember a scanning failure mid-aquiring image or immediately afterwards.

With DEBUG level of 8 it works half of the time - at least as well as through the hub.

I'm using Slackware64 14.2, xsane-0.999 with stock sane 1.0.25, but tried building 1.0.27 from source and the latest one from Git repository - looks the same: no luck without low-level debug, more luck with debug level 8 and quite reliable with 128.

PS Not sure if a packet dump will be useful here, and as it is quite large - skipping it for now.

Followups: Sort comments antichronologically

Date: 2018-02-25 04:13
Sender: Olaf Meeuwissen

Hmm, 1.0.25 enabled a workaround for USB3 by default. For 1.0.27 and later, you need to enable it explicitly and can do so by setting the SANE_USB_WORKAROUND environment variable to 1.

However, seeing that you also seem to have this issue with the workaround enabled I'm wondering if the genesys backend itself is at fault.

Gerhard, can you take a look?

Attached Files:


Field Old Value Date By
assigned_tonone2018-02-25 04:13olaf-guest
Powered By FusionForge