Your message dated Sun, 30 Jul 2017 10:37:50 +0200
with message-id <[email protected]>
and subject line Re: libsane: libusb_bulk_write returns "Resource temporarily
unavailable"
has caused the Debian Bug report #810919,
regarding libsane: libusb_bulk_write returns "Resource temporarily unavailable"
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
810919: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810919
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libsane
Version: 1.0.25-2
Severity: normal
Tags: patch
Dear Maintainer,
I have a Canon Canoscan N650U. It uses the 'plustek' USB sane backend.
When I upgraded my laptop, sane stopped working. sane_find_scanner would find
my Canoscan, but scanimage -L would hang for a long time (maybe 20 seconds) and
then fail, reporting no scanners found. If I ran scanimage -L again, it would
fail immediately. If I unplugged and restored the USB cable, the first scenario
occurred again. (xsane and the GIMP plugin also had the long pause, but would
usually eventually show the device as detected. However, any attempt to access
it caused an I/O error to be reported.)
With SANE_DEBUG_SANEI_USB set, I could see that six bulk writes of 4 or 5 bytes
each would succeed, but the seventh would return "Resource temporarily
unavailable". However, the code did not catch the error, leading to many more
failed writes, and hence the long delay.
After much experimentation, (at first I thought it was the device going to
sleep with autosuspend) I found a hack that would work: a delay before the call
to libusb_bulk_write.
Clearly, that's not a proper solution, but it's a workaround for me. I reduced
the timeout gradually to 50 microseconds, but gave up reducing it at that
point.
A diff of my hack is as follows (against source of sane-backends-1.0.25):
$ diff sanei_usb.c sanei_usb.c.orig
87,88d86
<
<
2416,2419d2413
< struct timespec sleepytime, sleepyremain;
<
< sleepytime.tv_nsec = 50000L; /* nanoseconds */
< sleepytime.tv_sec = 0;
2450,2451d2443
< nanosleep(&sleepytime, &sleepyremain); /* sg */
<
2456c2448
< if (write_size <= 0)
---
> if (write_size < 0)
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.4.0-fuji (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL
set to en_IE.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages libsane depends on:
ii acl 2.2.51-8
ii adduser 3.113+nmu3
ii libavahi-client3 0.6.31-4
ii libavahi-common3 0.6.31-4
ii libc6 2.19-7
ii libexif12 0.6.21-1
ii libgphoto2-6 2.5.2-2
ii libgphoto2-port12 2.5.9-2
ii libieee1284-3 0.2.11-10
ii libjpeg62-turbo 1:1.3.1-10
ii libsane-common 1.0.25-2
ii libtiff5 4.0.3-5
ii libusb-1.0-0 2:1.0.20-1
ii makedev 2.3.1-93
ii udev 204-10
Versions of packages libsane recommends:
pn libsane-extras <none>
ii sane-utils 1.0.25-2
Versions of packages libsane suggests:
pn avahi-daemon <none>
pn hplip <none>
-- no debconf information
--- End Message ---
--- Begin Message ---
Hello,
after 18 month one answer from upstream. So I close this bug.
Many thanks for your work.
CU
Jörg
--
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
Skype: joergpenguin
Ring: jff
IRC: [email protected]
[email protected]
My wish list:
- Please send me a picture from the nature at your home.
signature.asc
Description: This is a digitally signed message part
--- End Message ---