Bug 140248

Summary: xsane always reports Device Busy
Product: [Fedora] Fedora Reporter: Jonathan Eskritt <jeskritt>
Component: sane-backendsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 1.0.15-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-06 17:34:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output from "ps auxfww"
none
strace output
none
output from "SANE_DEBUG_PLUSTEK=35 scanimage >output 2>&1"
none
output from "SANE_DEBUG_SANEI_USB=128 scanimage >output 2>&1"
none
output from "export SANE_DEBUG_DLL=1 ; export SANE_DEBUG_PLUSTEK=20 ; export SANE_DEBUG_EPSON=5 ; scanimage >output 2>&1" none

Description Jonathan Eskritt 2004-11-21 19:07:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
I have xsane-0.92-13, sane-backends-1.0.14-6,  kernel-2.6.9-1.678_FC3.
When I start xsane it scans for devices as normal (though it does take
a lot longer than usual) and the xsane windows come up as normal. It
proper detects that I have a Epson Perfect 1250 scanner (USB). When I
go to aquire preview I get the error "Failed to start scanner: Device
Busy"

I used this scanner without issue on redhat 9, and fedora Core 1 & 2.
Only since upgrading to FC3 have I had this problem.

Version-Release number of selected component (if applicable):
xsane-0.92-13

How reproducible:
Always

Steps to Reproduce:
1. start xsane
2. click aquire preview
3.
    

Actual Results:  got the error "Failed to start scanner: Device Busy"

Expected Results:  scanner should have aquired a preview and put it in
the preview window

Additional info:

Comment 1 Tim Waugh 2004-11-22 11:08:40 UTC
If you switch the scanner off, and then on, does the scan work?

Comment 2 Jonathan Eskritt 2004-11-22 16:32:46 UTC
No, I still get the same error message

Comment 3 Tim Waugh 2004-11-22 16:49:41 UTC
What does:

  scanimage -L

and then:

  scanimage >/dev/null

say?

Comment 4 Jonathan Eskritt 2004-11-23 01:52:00 UTC
$ scanimage -L
device `plustek:libusb:003:008' is a Epson Perfection 1250/Photo USB
flatbed scanner

$ scanimage > /dev/null
scanimage: sane_start: Device busy



Comment 5 Jonathan Eskritt 2004-11-23 05:15:53 UTC
I don't know if it matters, but I have upgraded my kernel to the
latest version: kernel-2.6.9-1.681_FC3. I still get the same problems.

Comment 6 Tim Waugh 2004-11-23 11:16:50 UTC
What do these commands give as output?:

ls -l /proc/bus/usb/003/008
ps auxfww


Comment 7 Jonathan Eskritt 2004-11-23 16:09:15 UTC
Created attachment 107307 [details]
output from "ps auxfww"

Comment 8 Jonathan Eskritt 2004-11-23 16:10:29 UTC
The scanner changes it's USB device numbers every time I power it down.

$ scanimage -L
device `plustek:libusb:003:006' is a Epson Perfection 1250/Photo USB
flatbed scanner

$ ls -l /proc/bus/usb/003/006
-rw-------  1 jon root 57 Nov 23 09:02 /proc/bus/usb/003/006

jon is my user name, so I should have rw access.

The output to ps auxfww is pretty long so I made it an attachement.

Comment 9 Tim Waugh 2004-11-23 16:19:08 UTC
How about this?:

strace -eopen scanimage >/dev/null

I expect it will just show -EBUSY or something, so I'd also like to see the
output of:

fuser -v /proc/bus/usb/003/006

(obviously use the numbers from scanimage -L)

The fuser command comes from the psmisc package, in case you don't have that
installed.

Comment 10 Jonathan Eskritt 2004-11-23 19:44:00 UTC
Created attachment 107328 [details]
strace output

the fuser -v /proc/bus/usb/003/007 produced no output. I ran it as both a
regular user and as root.

Comment 11 Tim Waugh 2004-11-24 10:41:14 UTC
Oh, that's interesting:

open("/proc/bus/usb/003/007", O_RDWR)   = 19

So the open call is succeeding, not failing as I'd expected from the error message.

Please try this:

SANE_DEBUG_PLUSTEK=35 scanimage >output 2>&1

and attach the 'output' file.  Thanks.

Comment 12 Jonathan Eskritt 2004-11-24 16:09:57 UTC
Created attachment 107400 [details]
output from "SANE_DEBUG_PLUSTEK=35 scanimage >output 2>&1"

Comment 13 Need Real Name 2004-11-27 02:16:37 UTC
FWIW, i see the exact same behavior with my epson perfection
1260/photo scanner and reproduced all of the tests given here. 

Comment 14 Tim Waugh 2004-11-29 16:39:09 UTC
What does '/sbin/lsmod' say?  I'm wondering if the kernel loads a scanner module
and prevents us using libusb for that device.

Comment 15 Jonathan Eskritt 2004-11-29 17:19:48 UTC
# lsmod
Module                  Size  Used by
ppdev                   8901  0
nls_utf8                1985  1
parport_pc             24705  1
lp                     11565  0
parport                41737  3 ppdev,parport_pc,lp
autofs4                24005  0
asb100                 20061  0
i2c_sensor              3521  1 asb100
i2c_viapro              6989  0
i2c_dev                10433  0
i2c_core               22081  4 asb100,i2c_sensor,i2c_viapro,i2c_dev
ipt_REJECT              6465  1
ipt_state               1857  5
ip_conntrack           40693  1 ipt_state
iptable_filter          2753  1
ip_tables              16193  3 ipt_REJECT,ipt_state,iptable_filter
dm_mod                 54741  0
button                  6481  0
battery                 8517  0
ac                      4805  0
nvidia               3474076  12
sd_mod                 16961  2
md5                     4033  1
ipv6                  232705  10
usb_storage            61321  1
scsi_mod              118417  2 sd_mod,usb_storage
joydev                  8705  0
legousbtower           16197  0
ehci_hcd               31685  0
uhci_hcd               31449  0
snd_cmipci             35173  3
snd_pcm_oss            47608  0
snd_mixer_oss          17217  3 snd_pcm_oss
snd_pcm                97993  2 snd_cmipci,snd_pcm_oss
snd_page_alloc          9673  1 snd_pcm
snd_opl3_lib           11201  1 snd_cmipci
snd_timer              29765  2 snd_pcm,snd_opl3_lib
snd_hwdep               9413  1 snd_opl3_lib
gameport                4801  1 snd_cmipci
snd_mpu401_uart         8769  1 snd_cmipci
snd_rawmidi            26725  1 snd_mpu401_uart
snd_seq_device          8137  2 snd_opl3_lib,snd_rawmidi
snd                    54053  12
snd_cmipci,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_opl3_lib,snd_timer,snd_hwdep,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore               9889  3 snd
tulip                  43745  0
floppy                 58609  0
ext3                  116809  5
jbd                    74969  1 ext3


Comment 16 Tim Waugh 2004-11-29 17:43:01 UTC
Could you try this now please?

SANE_DEBUG_SANEI_USB=128 scanimage >output 2>&1

Comment 17 Jonathan Eskritt 2004-11-29 18:55:36 UTC
Created attachment 107563 [details]
output from "SANE_DEBUG_SANEI_USB=128 scanimage >output 2>&1"

Comment 18 Tim Waugh 2004-11-30 11:39:15 UTC
Please try sane-backends-1.0.15 from Fedora development:

ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS

There have been several plustek changes since 1.0.14, and it would be useful to
know if they fix the problem or not.

Comment 19 Jonathan Eskritt 2004-11-30 16:40:46 UTC
So I updated to sane-backends-1.0.15-6 and hotplug-2004_04_01-10 (required
dependancy) and I still get the same result:

$ scanimage -L
device `plustek:libusb:003:003' is a Epson Perfection 1250/Photo USB flatbed scanner

$ scanimage > /dev/null
scanimage: sane_start: Device busy

Comment 20 Tim Waugh 2004-11-30 17:01:25 UTC
I've reported this on the sane-devel mailing list.  We'll see what the
upstream developers say.

Comment 21 Tim Waugh 2004-12-01 13:25:56 UTC
If you replace the line "epson" with "#epson" in /etc/sane.d/dll.conf, does
scanning work?

Comment 22 Jonathan Eskritt 2004-12-01 16:24:50 UTC
That seems to have done the trick. Thanks.

BTW the scan now makes some strange noises at the end of the scan that it didn't
before.

Comment 23 Tim Waugh 2004-12-01 16:53:02 UTC
Are you still running 1.0.15-6?  1.0.15 was meant to fix this problem, by
preventing the epson backend from trying to handle the device:

https://alioth.debian.org/tracker/?group_id=30186&atid=410366&func=detail&aid=300751

Indeed, the source code for 1.0.15 does not list 0x4b8/0x10f as being handled by
epson_usb.c, so it's a bit of a puzzle that commenting out the epson backend
makes a difference.

Comment 24 Jonathan Eskritt 2004-12-01 17:50:54 UTC
yeah I'm still using 1.0.15-6. 

The strange thing was that in all the debug stuff I ran, it properly detected it
was a plustek scanner, and in the "SANE_DEBUG_SANEI_USB=128 scanimage >output
2>&1" test it could write and read data from the scanner. But when it came to
actually scanning the epson driver cased some conflict.

Comment 25 Tim Waugh 2004-12-03 10:52:24 UTC
Let's see what the epson backend is up to.  Please try this:

export SANE_DEBUG_DLL=1
export SANE_DEBUG_PLUSTEK=20
export SANE_DEBUG_EPSON=5
scanimage >output 2>&1

Thanks.

Comment 26 Jonathan Eskritt 2004-12-03 14:46:15 UTC
Created attachment 107830 [details]
output from "export SANE_DEBUG_DLL=1 ; export SANE_DEBUG_PLUSTEK=20 ; export SANE_DEBUG_EPSON=5 ; scanimage >output 2>&1"

Comment 27 Tim Waugh 2004-12-03 15:29:23 UTC
Does your /etc/sane.d/epson.conf have a line like this?:

usb 0x04b8 0x010f

If so, did you put that there or did it come like that?

Comment 28 Jonathan Eskritt 2004-12-03 19:14:15 UTC
I does. I may have done it before submitting the bug report, I tried a bunch of
stuff before submitting to bugzilla. But, I upgraded to sane-backends-1.0.15-6,
shouldn't that either over write the changed file, or have made a
epson.conf.rpmnew? I did get an /etc/sane.d/dll.conf.rpmnew when I upgraded, and
I moved it to /etc/sane.d/dll.conf (after saving the old conf to
/etc/sane.d/dll.conf.old)


Should I comment out the usb 0x04b8 0x010f line in the /etc/sane.d/epson.conf
file and try again?



Comment 29 Tim Waugh 2004-12-06 12:00:50 UTC
Since it is a configuration file, it is not overwritten.

Please remove that line and try again.  Thanks.

Comment 30 Jonathan Eskritt 2004-12-06 17:08:02 UTC
I commented out the line "usb 0x04b8 0x010f"  in the /etc/sane.d/epson.conf, and
uncommented the epson in the /etc/sane.d/dll.conf file. Everything still works.
I was getting the device busy errors before I made any changes, so it must have
been the upgrade to sane-backends-1.0.15-6 that fixed the problem.

Thanks for all your help.


Comment 31 Tim Waugh 2004-12-06 17:34:14 UTC
Great, thanks for testing.