Discussion:
Bug#598102: sane-utils: scanimage fails on HP ScanJet 3300C with "Device busy"
Robbert Kouprie
2010-09-26 12:36:19 UTC
Permalink
Package: sane-utils
Version: 1.0.21-4
Severity: normal


Hi,

While 'scanimage -L' lists my HP ScanJet 3300C USB scanner, the scanning itself does not work. scanimage returns a 'Device busy'. There are no other programs than SANE that are configured to use the scanner.

***@srv:~$ lsusb | grep Scan
Bus 003 Device 002: ID 03f0:0205 Hewlett-Packard ScanJet 3300c

***@srv:~$ scanimage -L
device `niash:libusb:003:002' is a Hewlett-Packard ScanJet 3300C flatbed scanner

***@srv:~$ ls -la /dev/bus/usb/003/002
crw-rw-r-- 1 root scanner 189, 257 Sep 25 14:17 /dev/bus/usb/003/002

***@srv:~$ SANE_DEBUG_DLL=1 SANE_DEBUG_SANEI_USB=128 SANE_DEBUG_HP=255 SANE_DEBUG_NIASH=255 /usr/bin/scanimage -d niash:libusb:003:002 --format tiff
[sanei_debug] Setting debug level of dll to 1.
[dll] sane_init: SANE dll backend version 1.0.12 from sane-backends 1.0.21
[sanei_debug] Setting debug level of niash to 255.
[niash] sane_init
[sanei_debug] Setting debug level of sanei_usb to 128.
[sanei_usb] sanei_usb_init: marking existing devices
[sanei_usb] sanei_usb_init: Looking for kernel scanner devices
[sanei_usb] sanei_usb_init: can't stat /dev/usb/: No such file or directory
[sanei_usb] sanei_usb_init: Looking for libusb devices
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 002 on 003
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 003
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 002
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 001
error obtaining child information: Operation not permitted
[sanei_usb] sanei_usb_init: found libusb device (0x03f0/0x0205) interface 0 at libusb:003:002
[sanei_usb] store_device: add dn 0 with libusb:003:002
[sanei_usb] sanei_usb_init: device 0x1d6b/0x0001, interface 0 doesn't look like a scanner (9/9)
[sanei_usb] sanei_usb_init: device 0x1d6b/0x0001: no suitable interfaces
[sanei_usb] sanei_usb_init: device 0x1d6b/0x0001, interface 0 doesn't look like a scanner (9/9)
[sanei_usb] sanei_usb_init: device 0x1d6b/0x0001: no suitable interfaces
[sanei_usb] sanei_usb_init: device 0x1d6b/0x0002, interface 0 doesn't look like a scanner (9/9)
[sanei_usb] sanei_usb_init: device 0x1d6b/0x0002: no suitable interfaces
[sanei_usb] sanei_usb_init: found 1 devices
[sanei_usb] sanei_usb_init: device 00 is libusb:003:002
[niash] Looking for ScanJet 3300C...
[sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0205
[niash] _AttachUsb: found libusb:003:002
[niash] niash: _ReportDevice 'libusb:003:002'
[niash] Looking for ScanJet 3400C...
[sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0405
[niash] Looking for ScanJet 4300C...
[sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0305
[niash] Looking for HP ScanJet 4300c...
[sanei_usb] sanei_usb_find_devices: vendor=0x047b, product=0x1002
[niash] Looking for Snapscan Touch...
[sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x0100
[niash] Looking for Office Scanner USB 19200...
[sanei_usb] sanei_usb_find_devices: vendor=0x047b, product=0x1000
[niash] sane_open: libusb:003:002
[niash] Trying to open libusb:003:002...
[sanei_usb] sanei_usb_open: trying to open device `libusb:003:002'
USB error: could not set config 1: Connection timed out
[sanei_usb] sanei_usb_open: libusb complained: could not set config 1: Connection timed out
[niash] NiashXferOpen failed for 'libusb:003:002'
[niash] NiashOpen failed
scanimage: open of device niash:libusb:003:002 failed: Device busy
[niash] sane_exit

How can I troubleshoot this further?

Regards,
Robbert

-- System Information:
Debian Release: squeeze/sid
APT prefers squeeze-volatile
APT policy: (500, 'squeeze-volatile'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages sane-utils depends on:
ii adduser 3.112 add and remove users and groups
ii debconf [debconf-2.0] 1.5.35 Debian configuration management sy
ii libavahi-client3 0.6.27-2 Avahi client library
ii libavahi-common3 0.6.27-2 Avahi common library
ii libc6 2.11.2-6 Embedded GNU C Library: Shared lib
ii libieee1284-3 0.2.11-6 cross-platform library for paralle
ii libsane 1.0.21-4 API library for scanners
ii libusb-0.1-4 2:0.1.12-16 userspace USB programming library
ii update-inetd 4.37 inetd configuration file updater

sane-utils recommends no packages.

Versions of packages sane-utils suggests:
ii avahi-daemon 0.6.27-2 Avahi mDNS/DNS-SD daemon
pn unpaper <none> (no description available)

-- debconf information:
* sane-utils/saned_run: false
* sane-utils/saned_scanner_group: true
Julien BLACHE
2010-09-26 14:16:35 UTC
Permalink
reassign 598102 libsane
found 598102 1.0.21-4

Hi,
Post by Robbert Kouprie
[niash] sane_open: libusb:003:002
[niash] Trying to open libusb:003:002...
[sanei_usb] sanei_usb_open: trying to open device `libusb:003:002'
USB error: could not set config 1: Connection timed out
[sanei_usb] sanei_usb_open: libusb complained: could not set config 1: Connection timed out
[niash] NiashXferOpen failed for 'libusb:003:002'
[niash] NiashOpen failed
scanimage: open of device niash:libusb:003:002 failed: Device busy
[niash] sane_exit
How can I troubleshoot this further?
Those look like genuine errors, so first check your logs for kernel
messages about your scanner, and if there's nothing there:
- check that the scanner does work
- plug the scanner directly into the machine, unplug any other USB
devices that aren't strictly required

The backend hasn't seen any serious activity in over 2 years, so if it
worked before, it should still work today.

JB.
--
Julien BLACHE - Debian & GNU/Linux Developer - <***@debian.org>

Public key available on <http://www.jblache.org> - KeyID: F5D6 5169
GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169
Robbert Kouprie
2010-09-26 14:56:58 UTC
Permalink
Hi Julian,

Thanks for your reply. I did some more testing, and this problem may
very well be not the libsane's fault. At this point I am not sure where
the problem lies.
Post by Julien BLACHE
Those look like genuine errors, so first check your logs for kernel
There are indeed messages in the kernel logs. I omitted them earlier
because they are related to scanbuttond, which I had shutdown before
testing with scanimage. (scanbuttond used to work in the past, but it
broke a while ago after a libsane update).

These are the kernel messages:

[ 65.732459] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd scanbuttond
rqt 64 rq 12 len 1 ret -110
[ 75.736306] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd scanbuttond
rqt 192 rq 12 len 1 ret -110
[ 85.732147] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd scanbuttond
rqt 64 rq 12 len 1 ret -110
[ 96.197038] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd scanbuttond
rqt 64 rq 12 len 1 ret -110
[ 106.196888] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd scanbuttond
rqt 64 rq 12 len 1 ret -110

and also:

[ 5258.573727] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd
sane-find-scann rqt 128 rq 6 len 2 ret -110
[ 5259.576805] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd
sane-find-scann rqt 128 rq 6 len 2 ret -110

(sane-find-scanner is called by scanbuttond initialization script)
Post by Julien BLACHE
- check that the scanner does work
The device isn't broken or something like that. It works flawless when
connected to Windows. And it has worked in Linux.
Post by Julien BLACHE
- plug the scanner directly into the machine, unplug any other USB
devices that aren't strictly required
It is plugged in directly, and no other USB devices are connected.

So about the testing I did, I've just powercycled the device (having
scanbuttond stopped), and it directly started working after that.

But after a fresh system boot, the device never works. This seems to be
related to scanbuttond being started at boot.

If I disable the scanbuttond startup, scanimage works after boot.

So, it seems like scanbuttond in the boot process is confusing the USB
layer or the scanner itself. And even if I shutdown scanbuttond after
boot, the scanner is still broken until I reset the device.

Scanbuttond also uses libsane and libusb. So, the question is, who is at
fault here?

Any ideas?

Robbert
Julien BLACHE
2010-09-26 16:24:23 UTC
Permalink
reassign 598102 scanbuttond
thanks

Robbert Kouprie <***@radium.jvb.tudelft.nl> wrote:

Hi,
Post by Robbert Kouprie
There are indeed messages in the kernel logs. I omitted them earlier
because they are related to scanbuttond, which I had shutdown before
testing with scanimage. (scanbuttond used to work in the past, but it
broke a while ago after a libsane update).
[ 65.732459] usb 3-1: usbfs: USBDEVFS_CONTROL failed cmd scanbuttond
rqt 64 rq 12 len 1 ret -110
-110 is -ETIMEOUT, at this point the scanner is wedged and, as you've
found out, needs a good ol' powercycle to get back to working order.

Reassigning to scanbuttond.

JB.
--
Julien BLACHE <***@debian.org> | Debian, because code matters more
Debian & GNU/Linux Developer | <http://www.debian.org>
Public key available on <http://www.jblache.org> - KeyID: F5D6 5169
GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169
Loading...