Bug 920067 - Canon LiDE20 USB scanner issues with Acer laptop [intel] + USB3.0 controller (xhci)
Canon LiDE20 USB scanner issues with Acer laptop [intel] + USB3.0 controller ...
Status: RESOLVED UPSTREAM
: 942793 (view as bug list)
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Other
13.2
All openSUSE 13.2
: P5 - None : Normal (vote)
: ---
Assigned To: Johannes Meixner
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-28 17:33 UTC by robert spitzenpfeil
Modified: 2015-08-24 10:13 UTC (History)
4 users (show)

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
hwinfo --all (29.59 KB, text/plain)
2015-02-28 17:34 UTC, robert spitzenpfeil
Details
lsmod (4.26 KB, text/plain)
2015-02-28 17:34 UTC, robert spitzenpfeil
Details
lsusb -v (34.66 KB, text/plain)
2015-02-28 17:35 UTC, robert spitzenpfeil
Details
lsusb (481 bytes, text/plain)
2015-02-28 17:35 UTC, robert spitzenpfeil
Details
sane-find-scanner (1.43 KB, text/plain)
2015-02-28 17:35 UTC, robert spitzenpfeil
Details
"scanimage -L" without hanging (62.96 KB, text/plain)
2015-02-28 17:36 UTC, robert spitzenpfeil
Details
"scanimage -L" hanging (38.26 KB, text/plain)
2015-02-28 17:36 UTC, robert spitzenpfeil
Details
"scanimage -L" (87 bytes, text/plain)
2015-02-28 17:37 UTC, robert spitzenpfeil
Details
scanimage segfault (389.94 KB, text/x-log)
2015-02-28 17:37 UTC, robert spitzenpfeil
Details
uname -a (124 bytes, text/plain)
2015-02-28 17:38 UTC, robert spitzenpfeil
Details
xsane error (19.20 KB, image/jpeg)
2015-02-28 17:38 UTC, robert spitzenpfeil
Details
xsane crash (52.41 KB, text/x-log)
2015-02-28 17:38 UTC, robert spitzenpfeil
Details
xsane trace (548.52 KB, text/plain)
2015-02-28 17:39 UTC, robert spitzenpfeil
Details
xsane scan (4.39 MB, text/x-log)
2015-02-28 17:40 UTC, robert spitzenpfeil
Details
yast scanner setup (71.83 KB, image/jpeg)
2015-02-28 17:41 UTC, robert spitzenpfeil
Details
yast scanner setup (60.94 KB, image/jpeg)
2015-02-28 17:41 UTC, robert spitzenpfeil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert spitzenpfeil 2015-02-28 17:33:38 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
Build Identifier: 

In short, the scanner works just once and then things hang. Sometimes reconnecting it "fixes" things for a short while, but it is essentially unusable.

I have tested this scanner with 4 computers:

* Old AMD-based PC with USB 2.0 (13.1): works all the time
* Even older AMD-based PC with USB 2.0 (13.2): works as far as tested
* Old Intel-based Laptop with USB 2.0 (13.2): works all the time
* Brand-new Intel-based laptop (Acer) with USB 3.0 (13.2): no go

I have experienced crashes / hangs using: (logfiles later)

* scanimage -L
* xsane

Setting up the scanner using "Yast2-scanner" seems odd. Sometimes it shows the scanner associated with the suitable "plustek" driver, sometimes it shows as "not configured". Something is badly wrong.

It appears other people have had issues with USB 3.0 and scanners with the "xhci_hcd" driver. I tried to blacklist it, but without it I don't have ANY USB on that laptop.

I have tried the latest default kernel (3.19.something), same issue.

Reproducible: Always

Steps to Reproduce:
1. Attach scanner
2. Try to use it
3. "Bad vibrations"
Comment 1 robert spitzenpfeil 2015-02-28 17:34:31 UTC
Created attachment 624922 [details]
hwinfo --all
Comment 2 robert spitzenpfeil 2015-02-28 17:34:51 UTC
Created attachment 624923 [details]
lsmod
Comment 3 robert spitzenpfeil 2015-02-28 17:35:09 UTC
Created attachment 624925 [details]
lsusb -v
Comment 4 robert spitzenpfeil 2015-02-28 17:35:25 UTC
Created attachment 624926 [details]
lsusb
Comment 5 robert spitzenpfeil 2015-02-28 17:35:49 UTC
Created attachment 624927 [details]
sane-find-scanner
Comment 6 robert spitzenpfeil 2015-02-28 17:36:32 UTC
Created attachment 624928 [details]
"scanimage -L" without hanging
Comment 7 robert spitzenpfeil 2015-02-28 17:36:52 UTC
Created attachment 624929 [details]
"scanimage -L" hanging
Comment 8 robert spitzenpfeil 2015-02-28 17:37:16 UTC
Created attachment 624930 [details]
"scanimage -L"
Comment 9 robert spitzenpfeil 2015-02-28 17:37:41 UTC
Created attachment 624931 [details]
scanimage segfault
Comment 10 robert spitzenpfeil 2015-02-28 17:38:01 UTC
Created attachment 624932 [details]
uname -a
Comment 11 robert spitzenpfeil 2015-02-28 17:38:22 UTC
Created attachment 624933 [details]
xsane error
Comment 12 robert spitzenpfeil 2015-02-28 17:38:48 UTC
Created attachment 624934 [details]
xsane crash
Comment 13 robert spitzenpfeil 2015-02-28 17:39:21 UTC
Created attachment 624935 [details]
xsane trace
Comment 14 robert spitzenpfeil 2015-02-28 17:40:36 UTC
Created attachment 624936 [details]
xsane scan
Comment 15 robert spitzenpfeil 2015-02-28 17:41:00 UTC
Created attachment 624937 [details]
yast scanner setup
Comment 16 robert spitzenpfeil 2015-02-28 17:41:29 UTC
Created attachment 624938 [details]
yast scanner setup
Comment 17 robert spitzenpfeil 2015-02-28 17:48:16 UTC
It seems that "sane-find-scanner" always works, it detects the scanner correctly. But I'm not sure if this actually needs talking to the scanner, or if this is just the same information as provided by "lsusb".

Anything that actually talks to the device doesn't end well.
Comment 18 robert spitzenpfeil 2015-02-28 17:54:59 UTC
I have also tested the offending Acer laptop with another Canon scanner, the "LiDE 30" (appears to be essentially the same, might have different FW, certainly different USB device ID). Sadly this one doesn't work either, identical issues.

All of these scanners work "out of the box" with sane / xsane on 3 machines, but NOT on this Acer laptop. The main difference between these machines (expect age and platform) is USB 2 vs. USB 3.
Comment 19 robert spitzenpfeil 2015-02-28 20:03:34 UTC
"When plugging in a usb2 printer/scanner to a usb3 interface there is currently a bug in the xhci kernel code that causes the xsane process to hang when the scanner is connected."

https://wiki.archlinux.org/index.php/sane#Hangs_while_scanning_due_to_xhci_pre-boot_mode

---

Just guessing, but could this be it?

XHCI, "brain-dead scanner", and microframe rounding

http://www.spinics.net/lists/linux-usb/msg120507.html
Comment 20 Johannes Meixner 2015-03-02 10:34:25 UTC
It is a known issue at SANE upstream that some/many/most? scanners
do not work at USB 3 ports on some/many/most? computers.

I am not at all a USB expert which means I can neither debug
lower-level USB issues nor fix them.

As far as I noticed on some USB3 related mail threads on
the "sane-devel@lists.alioth.debian.org" mailing list,
something seems to have changed how the kernel works
in case of USB3 compated to how it worked with USB2.

FYI, see also "USB Speed" at
https://en.opensuse.org/SDB:Configuring_Scanners

From my non-expert point of view the issue is not caused by openSUSE,
neither by openSUSE-specific changes of our kernel or libusb
nor by openSUSE-specific changes of the sane-backends software.

Therefore the issue belongs to "upstream", either the kernel
or libusb or SANE or perpaps even all of them.

You can still add comments to this issue report regardless that
it is closed as "upstream" - i.e. there is no need to reopen it
only to provide more information.
Comment 22 Johannes Meixner 2015-03-02 10:44:56 UTC
Oliver Neukum,
what is the generic method to tell the kernel
to make a USB3 port behave as if it was only a USB2 port?
It seems something like "rmmod xhci_hcd ; modprobe ehci_hcd"
does not make a hardware USB3 port behave as if it was only USB2.
Comment 23 Oliver Neukum 2015-03-02 11:21:56 UTC
(In reply to Johannes Meixner from comment #22)
> Oliver Neukum,
> what is the generic method to tell the kernel
> to make a USB3 port behave as if it was only a USB2 port?

That is just not possible. Generically the hardware cannot do.
Some Intel stuff can do it, but it has to be done at boot time.
Useless for hotpluggable stuff.

> It seems something like "rmmod xhci_hcd ; modprobe ehci_hcd"
> does not make a hardware USB3 port behave as if it was only USB2.

I will backport the scanner fixes once they hit Greg's tree in a final form.
Comment 24 robert spitzenpfeil 2015-03-02 23:22:40 UTC
It seems a possible workaround for xhci + scanners was committed to the sane-backends repo some time ago.

I've tested the plustek backend (canon scanners) on my USB 2 machine a bit, and it still scans, which is good.

Tomorrow I'll try replacing the plustek backend on the USB 3 laptop and shall report my findings. Fingers crossed.

If this should work, updating sane might be a quicker short-term fix for 13.x than waiting for a kernel update. Less impact, if something should go sour.
Comment 25 robert spitzenpfeil 2015-03-02 23:26:22 UTC
"sanei_usb: Linux USB3/xhci workarounds"

http://anonscm.debian.org/cgit/sane/sane-backends.git/commit/?id=014b45d920f1fb630e1a31bb01f1da02ea2a6a87
Comment 26 Johannes Meixner 2015-03-03 09:15:24 UTC
I provide sane-backends version git20150108 RPMs an unstable
development source only for testing, without any guarantee or
warranty, and without any support in my openSUSE build service
home project "home:jsmeix".

The sane-backends-git20150108 sources contain in the ChangeLog file:
-------------------------------------------------------------------------
2014-12-16 m. allan noah <kitno455 at gmail dot com>
        * sanei/sanei_usb.c: add calls to sanei_usb_set_altinterface in
        sanei_usb_close and sanei_usb_clear_halt- hopefully work around
        USB3/xhci problems in Linux.
-------------------------------------------------------------------------

Please carefully read
https://build.opensuse.org/project/show?project=home:jsmeix

You can get the packages in the "home:jsmeix" project
for example for openSUSE 13.2 via this direct URL
http://download.opensuse.org/repositories/home:/jsmeix/openSUSE_13.2/

When you like to upgrade an installed sane-backends 1.0.23 or 1.0.24
to sane-backends development version git20150108 you need to install
version git20150108 with plain rpm using "--force" e.g. like
# rpm -Uhv --force sane-backends-git20150108-2.1.x86_64.rpm
because for rpm the version number git2015010 is lower than
the installed version number 1.0.23 or 1.0.24.

For my scanner that uses the plustek driver sane-backends development
version git20150108 still works for me. This only means that
sane-backends development version git20150108 is not totally broken
but it does not mean that sane-backends development version git20150108
can also be used for your particular scanner at your particular computer.

Caution:
When you try it out and your scanner makes bad-sounding noises
the usual reason is that the scanner's internal moving parts
"do bad things" which means the scanner hardware could get damaged.

Perhaps you are a venturous openSUSE user who likes to try out
if sane-backends development version git20150108 works for you?
If you like to try it out, please report whether or not it works for you.

Many thanks in advance for testing it and for your feedback!
Comment 27 Johannes Meixner 2015-03-03 09:24:16 UTC
Robert Spitzenpfeil,
FYI regarding comment#24 "replacing the plustek backend":
As far as I understand it this cannot help because the changes
related to USB3 in sane-backends are in its generic USB hndling code
and not in the individual backends sources.
Comment 28 robert spitzenpfeil 2015-03-03 19:17:43 UTC
(In reply to Johannes Meixner from comment #27)

Yes, that is correct.
Comment 29 robert spitzenpfeil 2015-03-03 19:20:22 UTC
Success!

I installed the sane packages so kindly provided by 'Johannes Meixner' and am extremely happy to report that my dad's "Canon LiDE 20" now works flawlessly on any USB port (v2 or v3) on his apparently-too-new laptop.

I've tested and tortured the scanner & software all evening, and there was not a single issue.

IT WORKS!
Comment 30 Jiri Slaby 2015-06-04 07:36:51 UTC
Nice, Johannes, could you update the package, or backport the patch?
Comment 32 Johannes Meixner 2015-08-24 10:13:04 UTC
I will not generally (i.e. for all openSUSE users) upgrade
to a sane-backends development version - cf.
https://bugzilla.opensuse.org/show_bug.cgi?id=905034#c29
Comment 33 Johannes Meixner 2015-08-24 10:13:27 UTC
*** Bug 942793 has been marked as a duplicate of this bug. ***