Bug 127524

Summary: no scanning for Epson all-in-one devices when usblp is loaded
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Joern Allmers <suse>
Component: OtherAssignee: Johannes Meixner <jsmeix>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: aj
Version: Final   
Target Milestone: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: My hardware

Description Joern Allmers 2005-10-11 11:08:34 UTC
Hi there,
in 9.3 the EPSON CX3650 (same as CX3600) printer / scanner was perfekt working
with the drivers from www.avasys.jp. In 10.0 the printer part is working with
the includet driver for the cx3200 (but not with the original from
epson/avasys), but the scanner is not working (not with cx3200 driver nor the orig.)

if I do rcsane-dev restart it says in /var/log/messages:
Oct 11 13:08:11 helios kernel: usb 5-1: usbfs: interface 1 claimed by usblp
while 'scanimage' sets config #1

Thanks 

Joern
Comment 1 Joern Allmers 2005-10-11 11:09:58 UTC
Created attachment 53615 [details]
My hardware
Comment 2 Michael Gross 2005-10-11 14:18:14 UTC
Are there more messaged related to this problem in the syslog? Could be a
problem with the USB-subsystem...

Christian: Can you help here?
Comment 3 Joern Allmers 2005-10-11 14:43:19 UTC
No there are no more message related in syslog. But:
if I do a 
helios:/home/joern # rmmod usblp
and 
helios:/home/joern # rcsane-dev restart
it works:
helios:/home/joern # scanimage -L
device `epson:libusb:005:002' is a Epson CX3600 flatbed scanner

-> I can scan.

But: I cannot print :-( (until I reload usblp and restart cups)

Comment 4 Joern Allmers 2005-10-11 14:50:59 UTC
The kernel guys say its a sane problem:
-> http://bugzilla.kernel.org/show_bug.cgi?id=5001
Comment 9 P Linnell 2005-10-21 10:48:54 UTC
Here is the bug in sane:
https://alioth.debian.org/tracker/?group_id=30186&atid=410366&func=detail&aid=302207

Note CX-3200 also is affected. removing usblp fixes the detection issue.
Comment 10 Christian Rauch 2005-10-23 09:19:59 UTC
I can see this behaviour on my system too with the mentioned CX3200.
(Added me to cc)
Comment 11 Marcus Meissner 2005-10-23 12:00:18 UTC
likely the sane driver needs to detach the kernel usb driver.

This can be done by: usb_detach_kernel_driver_np() (check usb.h).
Comment 12 William Witt 2005-10-23 21:51:49 UTC
I have the same problem with my epson CX5400.  (Worked under 9.3 but not under 10.0)
Comment 13 Cristian Rodríguez 2005-10-24 04:00:24 UTC
folks , this bug seems to be fixed.

http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/sane-backends/sanei/sanei_usb.c.diff?r1=1.42&r2=1.43&cvsroot=sane

Comment 14 Alois Levermann 2005-10-24 04:57:40 UTC
Same problem with EPSON Stylus Photo RX420. Will test Sane 1.43 asap.
Comment 15 William Witt 2005-10-25 02:27:56 UTC
This update allows me to print and will allow me to scan but only as root.  I've tried copying the file from ~/sane-backends/tools/hotplug to my /etc/hotplug/usb/ directory as mentioned in the readme, but have had no luck.
Comment 16 Johannes Meixner 2005-10-25 06:25:23 UTC
For what to do to scan as normal user see
http://portal.suse.com/sdb/en/2005/09/jsmeix_scanner-setup-100.html
Comment 17 Johannes Meixner 2005-10-26 15:28:50 UTC
Reproduced it with my Epson Stylus Photo RX420.

Both sane (for the epson backend) and iscan (for the epkowa backend)
are affected.

Both kernel modules "usblp" (automatically loaded for the printer unit)
and "usb_storage" (automatically loaded for the cardreader unit)
cause problems when scanning.

In /var/log/messages there are messages like
---------------------------------------------------------------------------
usbfs: interface 1 claimed by usblp while 'scanimage' sets config #1
usbfs: interface 2 claimed by usb-storage while 'scanimage' sets config #1
---------------------------------------------------------------------------

I made patched versions of the sane and iscan pacakge versions
which are included in Suse Linux 10.0 (at the moment no version updates)
for the 32-bit i386 architecture (at the moment not for 64-bit x86_64)
public available for testing here:

ftp://ftp.suse.com/pub/people/jsmeix/unsupported/sane/10.0/RPMS/
sane-1.0.15-20.1.i586.ignore-EBUSY-from-USB.rpm

ftp://ftp.suse.com/pub/people/jsmeix/unsupported/iscan/10.0/RPMS/
iscan-1.15.0.2-4.1.i586.ignore-EBUSY-from-USB.rpm

Note the README in the directories.

It should be available in a few hours.

Note that ftp.suse.com is often overloaded so that you may have
to use a mirror (but because of ftp.suse.com overload the
mirrors may be delayed).

My patch does the same (i.e. ignoring EBUSY from USB) as the patch
in comment #13 but a bit different because of the older versions.

Regardless of the patch I still have problems at least when
usblp and usb-storage are loaded: Scanning hangs for some time
and in the ned there is a IO error.
I.e. the patch is not yet a real solution but at least for me it seems
to be o.k. at least for printing and scanning at the same time.
At least for me it works well when usblp is loaded but usb-storage
is not loaded. Then I can print and scan even at the same time.

In the next days I will make patched versions of the other
sane and iscan and iscan-free package versions available
for further testing.

I appreciate your feedback.
Comment 19 Andreas Jaeger 2005-10-27 07:25:16 UTC
Let's test this a bit more and once we have a working version, do a recommended update via YOU for 10.0.

Here's already a SWAMP-ID: Maintenance-Tracker-2685
Comment 20 Joern Allmers 2005-10-27 09:40:00 UTC
I installed the RPMs from Johannes today. They seem to do what they should :-)
I can scan, print and (!) I had no errors scanning an watching a movie from my external usb-disk. 
The only errors I had were
>Oct 27 11:28:11 helios kernel: usb 3-1: usbfs: interface 1 claimed by usblp while 'scanimage' sets config #1

but it worked perfect :-)

Thanks

Joern

P.S. What is this SWAMP-ID? I found nothing about it in google...
Comment 21 Johannes Meixner 2005-10-27 09:56:46 UTC
The messages in /var/log/messges are still the same
because all what the patch does is that SANE simply ignores the error.
And this "simply ignoring the error" seems to be not a final soultion.

Nevertheless if "simply ignoring the error" helps now in most cases
and if it doesn't cause severe problems (e.g. a sudden system stop
because of a deadlock or crash in the kernel) I will provide the
patched packages as recommended YOU update.

Ignore "SWAMP-ID" - it is a Suse-internal ID for our process
when we are makeing an official package update (e.g. a YOU update).
As Suse Bugzilla is now open it may be searched by Google so that
you may find soon this entry about "SWAMP-ID" also in Google ;-)
Comment 22 Johannes Meixner 2005-10-27 10:08:48 UTC
Regarding comment #20
"no errors scanning an watching a movie from my external usb-disk":

I assume your CX3650 doesn't have a built-in cardreader (is this correct?)
so that in your case the usb-storage module will not claim
an interface of the EPSON CX3650 so that there is no conflict
with usb-storage and SANE in your case.

In contrast my RX420 does have a built-in cardreader so that
the usb-storage module claims an interface of the RX420
which leads to the conflict with usb-storage and SANE.


According to comment #17 the interfaces are different:
interface 1 seems to be associated with the printer-unit,
interface 2 seems to be associated with the cardreader unit.
Perhaps the scanner unit is accessible via another different interface
and perhaps it is possible to change SANE (or libusb?) to claim only
the interface which is associated with the scanner unit?
I am no USB expert but perhaps this may lead to a real solution?
Comment 23 Johannes Meixner 2005-10-27 11:50:11 UTC
More packages for testing:

ftp://ftp.suse.com/pub/people/jsmeix/unsupported/sane/10.0/RPMS/
sane-1.0.15-20.1.i586.ignore-EBUSY-from-USB.rpm
sane-1.0.15-20.1.x86_64.ignore-EBUSY-from-USB.rpm

ftp://ftp.suse.com/pub/people/jsmeix/unsupported/iscan/10.0/RPMS/
iscan-1.15.0.2-4.1.i586.ignore-EBUSY-from-USB.rpm
iscan-free-1.15.0.2-3.i586.ignore-EBUSY-from-USB.rpm
iscan-free-1.15.0.2-3.x86_64.ignore-EBUSY-from-USB.rpm
Comment 24 Johannes Meixner 2005-10-27 12:11:47 UTC
Follow-up for the last paragraph in comment #22:

It is really a different interface (interface 0) for the scanner unit:
sane-find-scanner -v -v
shows the following output for my RX420
--------------------------------------------------------------------------
<device descriptor of 0x04b8/0x080f at 002:003 (EPSON USB MFP)>
bLength               18
bDescriptorType       1
bcdUSB                1.10
bDeviceClass          0
bDeviceSubClass       0
bDeviceProtocol       0
bMaxPacketSize0       8
idVendor              0x04B8
idProduct             0x080F
bcdDevice             1.00
iManufacturer         1 (EPSON)
iProduct              2 (USB MFP)
iSerialNumber         3 (LJ4010410142027390)
bNumConfigurations    1
 <configuration 0>
 bLength              9
 bDescriptorType      2
 wTotalLength         78
 bNumInterfaces       3
 bConfigurationValue  1
 iConfiguration       4 (USB MFP)
 bmAttributes         192 (Self-powered)
 MaxPower             2 mA
  <interface 0>
   <altsetting 0>
   bLength            9
   bDescriptorType    4
   bInterfaceNumber   0
   bAlternateSetting  0
   bNumEndpoints      2
   bInterfaceClass    255
   bInterfaceSubClass 255
   bInterfaceProtocol 255
   iInterface         5 (EPSON Scanner)
    <endpoint 0>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x81 (in 0x01)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
    <endpoint 1>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x02 (out 0x02)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
  <interface 1>
   <altsetting 0>
   bLength            9
   bDescriptorType    4
   bInterfaceNumber   1
   bAlternateSetting  0
   bNumEndpoints      2
   bInterfaceClass    7
   bInterfaceSubClass 1
   bInterfaceProtocol 2
   iInterface         6 (USB Printer)
    <endpoint 0>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x83 (in 0x03)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
    <endpoint 1>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x04 (out 0x04)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
  <interface 2>
   <altsetting 0>
   bLength            9
   bDescriptorType    4
   bInterfaceNumber   2
   bAlternateSetting  0
   bNumEndpoints      2
   bInterfaceClass    8
   bInterfaceSubClass 6
   bInterfaceProtocol 80
   iInterface         7 (USB Mass Storage)
    <endpoint 0>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x85 (in 0x05)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
    <endpoint 1>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x06 (out 0x06)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
--------------------------------------------------------------------------

In contrast a normal Epson scanner looks like
--------------------------------------------------------------------------
<device descriptor of 0x04b8/0x010b at 002:002 (EPSON Perfection1240)>
bLength               18
bDescriptorType       1
bcdUSB                1.00
bDeviceClass          255
bDeviceSubClass       255
bDeviceProtocol       255
bMaxPacketSize0       64
idVendor              0x04B8
idProduct             0x010B
bcdDevice             1.04
iManufacturer         1 (EPSON)
iProduct              2 (Perfection1240)
iSerialNumber         0 ()
bNumConfigurations    1
 <configuration 0>
 bLength              9
 bDescriptorType      2
 wTotalLength         32
 bNumInterfaces       1
 bConfigurationValue  1
 iConfiguration       0 ()
 bmAttributes         64 (Self-powered)
 MaxPower             2 mA
  <interface 0>
   <altsetting 0>
   bLength            9
   bDescriptorType    4
   bInterfaceNumber   0
   bAlternateSetting  0
   bNumEndpoints      2
   bInterfaceClass    255
   bInterfaceSubClass 255
   bInterfaceProtocol 255
   iInterface         0 ()
    <endpoint 0>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x81 (in 0x01)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
    <endpoint 1>
    bLength           7
    bDescriptorType   5
    bEndpointAddress  0x02 (out 0x02)
    bmAttributes      2 (bulk)
    wMaxPacketSize    64
    bInterval         0 ms
    bRefresh          0
    bSynchAddress     0
--------------------------------------------------------------------------
Comment 25 Johannes Meixner 2005-10-27 15:13:09 UTC
Right now scanning failed on my RX420
when usblp was loaded but usb-storage was not loaded.
=> Very unstable (at least for me).
=> Needs further investigation.
Comment 26 Johannes Meixner 2005-11-09 14:54:39 UTC
After asking on the sane-devel@lists.alioth.debian.org list,
it seems the other errors which I had with my RX420
"are not dierctly connected to this", see
http://lists.alioth.debian.org/pipermail/sane-devel/2005-October/015249.html
and
http://lists.alioth.debian.org/pipermail/sane-devel/2005-November/015297.html

I never had any new problem (or got any such report)
when EBUSY is simply ignored.

Therefore I decided to make it public available as recommended YOU update.
Comment 27 Anja Stock 2005-11-17 13:21:05 UTC
released