[sane-devel] Scanner failure when connected via USB3

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Fri Oct 31 08:58:31 UTC 2014


Hi Mike,

First of all, apologies for the somewhat belated reply.  I will try to
piece all the bits from your flurry of mails that followed this one
together in this reply.

Mike Cloaked writes:

>> > [...]  The only change since the previous time I booted the same
>> > laptop is that I ran a system update - but there was no obvious
>> > package that was updated that would have contributed to the changed
>> > behaviour!
>>
>> Not obvious to you perhaps but maybe someone else?  Would you happen to
>> have the full list of packages (as well as their old and new versions)?
>> Maybe someone will spot something.
>>
>> BTW, did you boot with the same kernel?
>
> [...] I will post the full list of updated packages from the pacman
> log. Yes it was booted with the same kernel though the kernel was
> updated from 3.16 to 3.17 only a few days ago and is now running with
> the new kernel.

If the kernel was updated, it is no longer the same kernel.  Going
through the list of updated packages, the kernel update is the only one
that seems to have a possible impact on your issue.

> The other thing I had wondered/thought about was that it might be a partial
> hardware failure. However the same usb3 port on the laptop where the
> scanner was plugged in was used to plug in an external usb hard drive and
> that works without any problems.  Also the scanner was plugged in to a
> different laptop with only usb2 ports and it was fine with xsane on that
> laptop. So that suggests that the hardware is not the problem either at the
> laptop port or for the scanner.
>
> I also separately have a multifunction printer/scanner (Samsung SCX4500W)
> that was working fine as both printer and scanner when connected via usb2
> to a previous desktop that only had usb2 ports, but that machine is now
> replaced with a new desktop that only has usb3 ports - the MFP works
> without any error connected to a usb3 port for the printer functions but
> the scanner hangs xsane whilst connected to the same physical port.
> However the scanner when connected via its ethernet wired network
> connection works fine from xsane using tcp.  So the scanner function seems
> to work provided it is not connected to a usb3 port. That desktop also runs
> arch linux.  A few months ago I tested this MFP plugging into the laptop
> with usb3 ports and xsane hung when scanning was attempted on the laptop
> via usb3 as well.
>
> The combined set of information from these tests seems to indicate that
> there is an issue with usb2 printers connected to a machine via usb3 when
> using sane, though of course I only have archlinux so I don't know if the
> same scanners would work properly when connected via usb3 to a machine
> running a different version of linux where the package sets are versioned
> differently? If anyone has either of the two scanners that I have, and are
> running Ubuntu, Fedora,Mint or another version of linux in a machine with
> usb3 ports it would be a very useful comparison?

To summarize your findings, you only have an issue when using scanners
(including an MFP) via USB3 ports.  They work fine on USB2 ports or via
the network.  Other devices (including the same MFP's printer part) work
fine on USB3 ports.  Although we cannot rule out the possibility of a
Arch Linux specific issue, the problem seems to be with SANE's use of
USB.

I've had a quick look at the kernel threads you referred to.  It seems
that the kernel's XHCI support may also still need some work.  However,
seeing that your other devices work fine (but not knowing anything about
the kernel's USB3 internals really), I think SANE's use of USB could use
some scrutiny as well.  Most, if not all, SANE backends use a wrapper
around libusb that might be at fault.

One note about the storage device you attached, that is unlikely to use
libusb.  Printer drivers, though, most likely rely on libusb for their
communication.  So if printing works without a hitch, that would point
a bigger finger in the direction of SANE's USB wrapper.

I had an admittedly cursory look at your USB captures.  What struck me
is the enormous amount of USB control messages in
wireshark-start-xsane-acquire-preview-crash.pcapng, some 4234 packets
out of a total of 4326 captured.  That's 97.9% of the packets.  While I
find that surprising, I don't know whether it is abnormal.  Maybe
someone with more knowledge of USB3 Linux support can chime in here?

That same capture also showed some bulk transfers but I don't know
anything about the protocol for this scanner.

Seeing the power/level warning only once may be due to the kernel
caching things.  As for the MCE, you may want to chase your logs for the
events that got logged (apparently).  You can probably find them in
kern.log.  Reading up on MCEs[1], I got the impression that it could be
related to the large number of USB control messages.

 [1] https://en.wikipedia.org/wiki/Machine-check-exception

Please note that I am just thinking out loud (and don't have a lot of
experience in this area).

I'll see if I can find some time to play around with another scanner and
reproduce some of what you're seeing.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



More information about the sane-devel mailing list