Bugzilla – Bug 920067
Canon LiDE20 USB scanner issues with Acer laptop [intel] + USB3.0 controller (xhci)
Last modified: 2015-08-24 10:13:56 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"
Created attachment 624922 [details] hwinfo --all
Created attachment 624923 [details] lsmod
Created attachment 624925 [details] lsusb -v
Created attachment 624926 [details] lsusb
Created attachment 624927 [details] sane-find-scanner
Created attachment 624928 [details] "scanimage -L" without hanging
Created attachment 624929 [details] "scanimage -L" hanging
Created attachment 624930 [details] "scanimage -L"
Created attachment 624931 [details] scanimage segfault
Created attachment 624932 [details] uname -a
Created attachment 624933 [details] xsane error
Created attachment 624934 [details] xsane crash
Created attachment 624935 [details] xsane trace
Created attachment 624936 [details] xsane scan
Created attachment 624937 [details] yast scanner setup
Created attachment 624938 [details] yast scanner setup
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.
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.
"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
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.
FYI see the "sane to work with USB 3.0" mail thread on http://lists.alioth.debian.org/pipermail/sane-devel/2014-November/thread.html http://lists.alioth.debian.org/pipermail/sane-devel/2014-December/thread.html in particular http://lists.alioth.debian.org/pipermail/sane-devel/2014-November/032853.html and the "Scanner failure when connected via USB3" mail thread on http://lists.alioth.debian.org/pipermail/sane-devel/2015-February/thread.html
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.
(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.
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.
"sanei_usb: Linux USB3/xhci workarounds" http://anonscm.debian.org/cgit/sane/sane-backends.git/commit/?id=014b45d920f1fb630e1a31bb01f1da02ea2a6a87
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!
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.
(In reply to Johannes Meixner from comment #27) Yes, that is correct.
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!
Nice, Johannes, could you update the package, or backport the patch?
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
*** Bug 942793 has been marked as a duplicate of this bug. ***