Discussion:
Sane doesn't create a scanner device
(too old to reply)
d***@gmx.net
2005-10-24 22:40:58 UTC
Permalink
I'm using an Epson Stylus Photo RX 420 (scanner-printer-combo) on a
Gentoo machine (Kernel 2.6.13).

Sane is version 1.0.15 (back- and frontend).

My problem is the following:

sane-find-scanner detects my scanner correctly:

found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004

But I don't find a device for the scanner anywhere. I even created a
/dev/usb/scanner0 by hand, but that didn't help me, either.

I also tried iscan, but it only says that it can't connect to the
scanner and that I should make sure the scanner is on.

I've also received some strange error messages when attempting to start
saned by hand:

saned[7350]: saned (AF-indep+IPv6) from sane-backends 1.0.15 ready
saned[7350]: check_host: getpeername failed: Socket operation on non-socket
saned[7350]: init: access by host [error] denied
saned[7350]: quit: exiting

I tried both automatic product/vendor discovery and fixed IDs in
/etc/sane.d/epson.conf

sane-find-scanner -vv gives me the following output (I skipped the SCSI
part):


searching for USB scanners:
checking /dev/usb/scanner... failed to open (Invalid argument)
checking /dev/usb/scanner0... failed to open (Invalid argument)
checking /dev/usb/scanner1... failed to open (Invalid argument)
checking /dev/usb/scanner2... failed to open (Invalid argument)
checking /dev/usb/scanner3... failed to open (Invalid argument)
checking /dev/usb/scanner4... failed to open (Invalid argument)
checking /dev/usb/scanner5... failed to open (Invalid argument)
checking /dev/usb/scanner5... failed to open (Invalid argument)
checking /dev/usb/scanner7... failed to open (Invalid argument)
checking /dev/usb/scanner8... failed to open (Invalid argument)
checking /dev/usb/scanner9... failed to open (Invalid argument)
checking /dev/usb/scanner10... failed to open (Invalid argument)
checking /dev/usb/scanner11... failed to open (Invalid argument)
checking /dev/usb/scanner12... failed to open (Invalid argument)
checking /dev/usb/scanner13... failed to open (Invalid argument)
checking /dev/usb/scanner14... failed to open (Invalid argument)
checking /dev/usb/scanner15... failed to open (Invalid argument)
checking /dev/usbscanner... failed to open (Invalid argument)
checking /dev/usbscanner0... failed to open (Invalid argument)
checking /dev/usbscanner1... failed to open (Invalid argument)
checking /dev/usbscanner2... failed to open (Invalid argument)
checking /dev/usbscanner3... failed to open (Invalid argument)
checking /dev/usbscanner4... failed to open (Invalid argument)
checking /dev/usbscanner5... failed to open (Invalid argument)
checking /dev/usbscanner6... failed to open (Invalid argument)
checking /dev/usbscanner7... failed to open (Invalid argument)
checking /dev/usbscanner8... failed to open (Invalid argument)
checking /dev/usbscanner9... failed to open (Invalid argument)
checking /dev/usbscanner10... failed to open (Invalid argument)
checking /dev/usbscanner11... failed to open (Invalid argument)
checking /dev/usbscanner12... failed to open (Invalid argument)
checking /dev/usbscanner13... failed to open (Invalid argument)
checking /dev/usbscanner14... failed to open (Invalid argument)
checking /dev/usbscanner15... failed to open (Invalid argument)
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004


Could anybody give me a hand with this?

The printer part works well with cups, and the kernel even seems to have
found the built-in card-readers:


ohci_hcd 0000:00:02.2: wakeup
usb 1-1: new full speed USB device using ohci_hcd and address 5
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 5 if 1
alt 0 proto 2 vid 0x04B8 pid 0x080F
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning

Vendor: EPSON Model: Stylus Storage Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi3, channel 0, id 0, lun 0
usb-storage: device scan complete
scsi.agent[8244]: disk at
/devices/pci0000:00/0000:00:02.2/usb1/1-1/1-1:1.2/host3/target3:0:0/3:0:0:0
Karl Heinz Kremer
2005-10-24 23:14:44 UTC
Permalink
You need to configure your hotplug system - this will then create the
scanner device for you once the scanner is connected to the system.
I'm not familiar with Gentoo, so I don't know how this is done with
your system.
Post by d***@gmx.net
I'm using an Epson Stylus Photo RX 420 (scanner-printer-combo) on a
Gentoo machine (Kernel 2.6.13).
Sane is version 1.0.15 (back- and frontend).
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004
But I don't find a device for the scanner anywhere. I even created a
/dev/usb/scanner0 by hand, but that didn't help me, either.
I also tried iscan, but it only says that it can't connect to the
scanner and that I should make sure the scanner is on.
I've also received some strange error messages when attempting to start
saned[7350]: saned (AF-indep+IPv6) from sane-backends 1.0.15 ready
saned[7350]: check_host: getpeername failed: Socket operation on non-socket
saned[7350]: init: access by host [error] denied
saned[7350]: quit: exiting
I tried both automatic product/vendor discovery and fixed IDs in
/etc/sane.d/epson.conf
sane-find-scanner -vv gives me the following output (I skipped the SCSI
checking /dev/usb/scanner... failed to open (Invalid argument)
checking /dev/usb/scanner0... failed to open (Invalid argument)
checking /dev/usb/scanner1... failed to open (Invalid argument)
checking /dev/usb/scanner2... failed to open (Invalid argument)
checking /dev/usb/scanner3... failed to open (Invalid argument)
checking /dev/usb/scanner4... failed to open (Invalid argument)
checking /dev/usb/scanner5... failed to open (Invalid argument)
checking /dev/usb/scanner5... failed to open (Invalid argument)
checking /dev/usb/scanner7... failed to open (Invalid argument)
checking /dev/usb/scanner8... failed to open (Invalid argument)
checking /dev/usb/scanner9... failed to open (Invalid argument)
checking /dev/usb/scanner10... failed to open (Invalid argument)
checking /dev/usb/scanner11... failed to open (Invalid argument)
checking /dev/usb/scanner12... failed to open (Invalid argument)
checking /dev/usb/scanner13... failed to open (Invalid argument)
checking /dev/usb/scanner14... failed to open (Invalid argument)
checking /dev/usb/scanner15... failed to open (Invalid argument)
checking /dev/usbscanner... failed to open (Invalid argument)
checking /dev/usbscanner0... failed to open (Invalid argument)
checking /dev/usbscanner1... failed to open (Invalid argument)
checking /dev/usbscanner2... failed to open (Invalid argument)
checking /dev/usbscanner3... failed to open (Invalid argument)
checking /dev/usbscanner4... failed to open (Invalid argument)
checking /dev/usbscanner5... failed to open (Invalid argument)
checking /dev/usbscanner6... failed to open (Invalid argument)
checking /dev/usbscanner7... failed to open (Invalid argument)
checking /dev/usbscanner8... failed to open (Invalid argument)
checking /dev/usbscanner9... failed to open (Invalid argument)
checking /dev/usbscanner10... failed to open (Invalid argument)
checking /dev/usbscanner11... failed to open (Invalid argument)
checking /dev/usbscanner12... failed to open (Invalid argument)
checking /dev/usbscanner13... failed to open (Invalid argument)
checking /dev/usbscanner14... failed to open (Invalid argument)
checking /dev/usbscanner15... failed to open (Invalid argument)
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004
Could anybody give me a hand with this?
The printer part works well with cups, and the kernel even seems to have
ohci_hcd 0000:00:02.2: wakeup
usb 1-1: new full speed USB device using ohci_hcd and address 5
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 5 if 1
alt 0 proto 2 vid 0x04B8 pid 0x080F
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
Vendor: EPSON Model: Stylus Storage Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi3, channel 0, id 0, lun 0
usb-storage: device scan complete
scsi.agent[8244]: disk at
/devices/pci0000:00/0000:00:02.2/usb1/1-1/1-1:1.2/host3/
target3:0:0/3:0:0:0
--
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
Olaf Meeuwissen
2005-10-25 11:15:34 UTC
Permalink
Post by Karl Heinz Kremer
You need to configure your hotplug system - this will then create the
scanner device for you once the scanner is connected to the system.
I'm not familiar with Gentoo, so I don't know how this is done with
your system.
There most likely will be a dynamically created device by the name of

/proc/bus/usb/001/004

but it may not have the correct permissions. You need read and write
permissions for the user that wants to use the scanner.

Note that when you re-plug or power cycle the device it will change
"names" (probably to /proc/bus/usb/001/005, 006 and so on). Unless
you set up hotplug (or udev, which I still have to look into myself)
to do this for you, you will need to do this manually every time you
re-plug, power cycle the device or reboot.

For USB scanners with a recent enough libusb (>= 0.1.6) and kernel (>=
2.4.12-ish. IIRC) there is no real need to muck with /dev/usb/scanner*
anymore. For 2.6.x kernels /dev/usb/scanner* is not an option, really.
Post by Karl Heinz Kremer
Post by d***@gmx.net
I'm using an Epson Stylus Photo RX 420 (scanner-printer-combo) on a
Gentoo machine (Kernel 2.6.13).
Sane is version 1.0.15 (back- and frontend).
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004
But I don't find a device for the scanner anywhere. I even created a
/dev/usb/scanner0 by hand, but that didn't help me, either.
I also tried iscan, but it only says that it can't connect to the
scanner and that I should make sure the scanner is on.
What version? If you take care of the hotplug support it provides,
most of the EPSON scanners should work out-of-the-box (unless your
system has already switched to udev in favour of hotplug).
Post by Karl Heinz Kremer
Post by d***@gmx.net
[snip]
Hope this helps,
--
Olaf Meeuwissen
FSF Associate Member #1962 sign up at http://member.fsf.org/
GnuPG key: 30EF893A/2774 815B DE83 06C8 D733 6B5B 033C C857 30EF 893A
Penguin's lib! -- I hack, therefore I am -- LPIC-2
Olaf Meeuwissen
2005-10-26 12:11:41 UTC
Permalink
CC:ing sane-devel for the benefit of archival purposes.
Actually, I already have switched to udev. So gathering from your
answer I guess iscan and udev don't work together.
Let me put it this way, iscan does not have any udev support so when
you plug in your device udev may not recognise it as a scanner. The
upshot of that is that the device node may not get the permissions
needed iscan and other SANE frontends to access it. You will need
read and write access to the device for it to work.

Just to make sure, check that the /proc/bus/usb/###/### entry that
corresponds to your RX420 has read/write access for everyone. If it
doesn't, then, as root, do

# chmod 0666 /proc/bus/usb/###/###

and give it another try.

# For the security conscious boys and girls out there, I know that
# this is not a good idea in general, but we're just trying to get
# the damn thing to work here first.
I tried again to make the scanner work, without result. It makes no
difference if I'm a normal user or root, neither the with epson- nor
with the iscan-backend I get it to work.
Now, if it also doesn't work when you are root, then there may be
something else that is getting in your way because root normally can
do anything to the device. i say normally, because SELinux and the
like may throw a spanner in the works here. For now I'm assuming you
are using the good old Unix ACL mechanism.
The node at /proc/bus/usb/001/ is there, but I can't use it in any way.
Creating a link from the respective node to something in /dev/ didn't
help me, either.
With /proc being a virtual file system, I'm surprised you managed to
make it a symlink to anywhere else to begin with.
But I can't believe I'm the only one not able to make it work!
Actually, there is another thread going on (started by russbucket,
IIRC) that just may be related to this (at least as far as iscan is
concerned).
What do you think: Is udev the reason? Is it something else? Is it me?
Nah, it's probably the weather or the phase of the moon ;-)

Seriously, sane-backends should have reasonably working udev support,
but I vaguely recall seeing some udev related commits recently. You
may want to check CVS for the latest scoop on this.
I have updated my sane-backend to version 1.0.16, didn't help.
That version introduced a locking mechanism which may or may not be
enabled by default on Gentoo. I don't know the details (yet). Any
one else care to jump in? Henning?

BTW, the epson backend in that version should support your scanner out
of the box. In 1.0.15 it did not, but you could force support for it
by adding

usb 0x04b8 0x080f

to your /etc/sane.d/epson.conf.
I even installed iscan from rpm (which normally isn't a good idea when
you use portage for all other packages).
I'm close to despair!
I can tell from your installation from RPM ;-)
Post by Olaf Meeuwissen
Post by Karl Heinz Kremer
You need to configure your hotplug system - this will then create the
scanner device for you once the scanner is connected to the system.
I'm not familiar with Gentoo, so I don't know how this is done with
your system.
There most likely will be a dynamically created device by the name of
/proc/bus/usb/001/004
but it may not have the correct permissions. You need read and write
permissions for the user that wants to use the scanner.
Note that when you re-plug or power cycle the device it will change
"names" (probably to /proc/bus/usb/001/005, 006 and so on). Unless
you set up hotplug (or udev, which I still have to look into myself)
to do this for you, you will need to do this manually every time you
re-plug, power cycle the device or reboot.
For USB scanners with a recent enough libusb (>= 0.1.6) and kernel (>=
2.4.12-ish. IIRC) there is no real need to muck with /dev/usb/scanner*
anymore. For 2.6.x kernels /dev/usb/scanner* is not an option, really.
Post by Karl Heinz Kremer
Post by d***@gmx.net
I'm using an Epson Stylus Photo RX 420 (scanner-printer-combo) on a
Gentoo machine (Kernel 2.6.13).
Sane is version 1.0.15 (back- and frontend).
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004
But I don't find a device for the scanner anywhere. I even created a
/dev/usb/scanner0 by hand, but that didn't help me, either.
I also tried iscan, but it only says that it can't connect to the
scanner and that I should make sure the scanner is on.
What version? If you take care of the hotplug support it provides,
most of the EPSON scanners should work out-of-the-box (unless your
system has already switched to udev in favour of hotplug).
Post by Karl Heinz Kremer
Post by d***@gmx.net
[snip]
Hope this helps,
--
Olaf Meeuwissen
FSF Associate Member #1962 sign up at http://member.fsf.org/
GnuPG key: 30EF893A/2774 815B DE83 06C8 D733 6B5B 033C C857 30EF 893A
Penguin's lib! -- I hack, therefore I am -- LPIC-2
d***@gmx.net
2005-10-26 15:14:43 UTC
Permalink
I think I gathered some new information:

when on debug level 255, scanimage -L gave me the following output (twice):

[sanei_debug] Setting debug level of sanei_usb to 255.
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_busses: Skipping non bus directory devices
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
[sanei_usb] sanei_usb_init: device 0x0000/0x0000 looks like a root hub
[sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x080f)
interface 0 at
libusb:001:002
[sanei_usb] sanei_usb_init: device 0x0000/0x0000 looks like a root hub
[sanei_usb] sanei_usb_init: found 1 devices
[sanei_usb] sanei_usb_find_devices: vendor=0x04b8, product=0x080f
[sanei_usb] sanei_usb_open: trying to open device `libusb:001:002'
USB error: could not set config 1: Device or resource busy
[sanei_usb] sanei_usb_open: libusb complained: could not set config 1:
Device or resource busy
[sanei_usb] Maybe the kernel scanner driver claims the scanner's interface?

This happened with the permissions on all files in /proc/bus/usb/001 set
to 0666.

And when trying iscan, it writes me the following to /var/log/messages
(also twice):

usb 1-1: usbfs: interface 1 claimed by usblp while 'iscan' sets config #1

Is this a lock problem or some strange permission issue?

Anyway, I'll try the CVS version as soon as I find enough time to mess
around with it ...

Thanks for your advices! :)
Post by Olaf Meeuwissen
CC:ing sane-devel for the benefit of archival purposes.
Actually, I already have switched to udev. So gathering from your
answer I guess iscan and udev don't work together.
Let me put it this way, iscan does not have any udev support so when
you plug in your device udev may not recognise it as a scanner. The
upshot of that is that the device node may not get the permissions
needed iscan and other SANE frontends to access it. You will need
read and write access to the device for it to work.
Just to make sure, check that the /proc/bus/usb/###/### entry that
corresponds to your RX420 has read/write access for everyone. If it
doesn't, then, as root, do
# chmod 0666 /proc/bus/usb/###/###
and give it another try.
# For the security conscious boys and girls out there, I know that
# this is not a good idea in general, but we're just trying to get
# the damn thing to work here first.
I tried again to make the scanner work, without result. It makes no
difference if I'm a normal user or root, neither the with epson- nor
with the iscan-backend I get it to work.
Now, if it also doesn't work when you are root, then there may be
something else that is getting in your way because root normally can
do anything to the device. i say normally, because SELinux and the
like may throw a spanner in the works here. For now I'm assuming you
are using the good old Unix ACL mechanism.
The node at /proc/bus/usb/001/ is there, but I can't use it in any way.
Creating a link from the respective node to something in /dev/ didn't
help me, either.
With /proc being a virtual file system, I'm surprised you managed to
make it a symlink to anywhere else to begin with.
But I can't believe I'm the only one not able to make it work!
Actually, there is another thread going on (started by russbucket,
IIRC) that just may be related to this (at least as far as iscan is
concerned).
What do you think: Is udev the reason? Is it something else? Is it me?
Nah, it's probably the weather or the phase of the moon ;-)
Seriously, sane-backends should have reasonably working udev support,
but I vaguely recall seeing some udev related commits recently. You
may want to check CVS for the latest scoop on this.
I have updated my sane-backend to version 1.0.16, didn't help.
That version introduced a locking mechanism which may or may not be
enabled by default on Gentoo. I don't know the details (yet). Any
one else care to jump in? Henning?
BTW, the epson backend in that version should support your scanner out
of the box. In 1.0.15 it did not, but you could force support for it
by adding
usb 0x04b8 0x080f
to your /etc/sane.d/epson.conf.
I even installed iscan from rpm (which normally isn't a good idea when
you use portage for all other packages).
I'm close to despair!
I can tell from your installation from RPM ;-)
Post by Olaf Meeuwissen
Post by Karl Heinz Kremer
You need to configure your hotplug system - this will then create the
scanner device for you once the scanner is connected to the system.
I'm not familiar with Gentoo, so I don't know how this is done with
your system.
There most likely will be a dynamically created device by the name of
/proc/bus/usb/001/004
but it may not have the correct permissions. You need read and write
permissions for the user that wants to use the scanner.
Note that when you re-plug or power cycle the device it will change
"names" (probably to /proc/bus/usb/001/005, 006 and so on). Unless
you set up hotplug (or udev, which I still have to look into myself)
to do this for you, you will need to do this manually every time you
re-plug, power cycle the device or reboot.
For USB scanners with a recent enough libusb (>= 0.1.6) and kernel (>=
2.4.12-ish. IIRC) there is no real need to muck with /dev/usb/scanner*
anymore. For 2.6.x kernels /dev/usb/scanner* is not an option, really.
Post by Karl Heinz Kremer
Post by d***@gmx.net
I'm using an Epson Stylus Photo RX 420 (scanner-printer-combo) on a
Gentoo machine (Kernel 2.6.13).
Sane is version 1.0.15 (back- and frontend).
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004
But I don't find a device for the scanner anywhere. I even created a
/dev/usb/scanner0 by hand, but that didn't help me, either.
I also tried iscan, but it only says that it can't connect to the
scanner and that I should make sure the scanner is on.
What version? If you take care of the hotplug support it provides,
most of the EPSON scanners should work out-of-the-box (unless your
system has already switched to udev in favour of hotplug).
Post by Karl Heinz Kremer
Post by d***@gmx.net
[snip]
Hope this helps,
Henning Meier-Geinitz
2005-10-26 16:38:31 UTC
Permalink
Hi,
Post by d***@gmx.net
[sanei_usb] sanei_usb_open: trying to open device `libusb:001:002'
USB error: could not set config 1: Device or resource busy
Device or resource busy
[sanei_usb] Maybe the kernel scanner driver claims the scanner's interface?
See bug report #302207:
https://alioth.debian.org/tracker/index.php?func=detail&aid=302207&group_id=30186&atid=410366

Bye,
Henning
d***@gmx.net
2005-10-26 18:40:13 UTC
Permalink
I installed the CVS version, and IT WORKS!

Almost ... :-(

The backend works fine as long as I install it into its default location.

I put the sources into /var/cvsroot/sane-backends, it's installed into
/usr/local/.

But this way the configure script of the sane-frontend doesn't find the
sane-backend, and I don't know how to tell the frontend where the
backend is. I tried to set a custom prefix, set a config location, a
library location, without success.

And when I let the backend install into /, it doesn't work anymore,
makres the same troubles as the gentoo package.

As I'm rather satisfied with the present location of the sane-backend, I
just want to ask how I can make the frontend find the backend, as it is
somewhat unintuitive and tedious to scan by using scanimage.

Any ideas?
Post by Henning Meier-Geinitz
Hi,
Post by d***@gmx.net
[sanei_usb] sanei_usb_open: trying to open device `libusb:001:002'
USB error: could not set config 1: Device or resource busy
Device or resource busy
[sanei_usb] Maybe the kernel scanner driver claims the scanner's interface?
https://alioth.debian.org/tracker/index.php?func=detail&aid=302207&group_id=30186&atid=410366
Bye,
Henning
Johannes Meixner
2005-10-27 07:05:02 UTC
Permalink
Hello,
Post by Henning Meier-Geinitz
Post by d***@gmx.net
[sanei_usb] sanei_usb_open: trying to open device `libusb:001:002'
USB error: could not set config 1: Device or resource busy
Device or resource busy
[sanei_usb] Maybe the kernel scanner driver claims the scanner's interface?
https://alioth.debian.org/tracker/index.php?func=detail&aid=302207&group_id=30186&atid=410366
I would like to have you informed about what I found out, see
https://bugzilla.novell.com/show_bug.cgi?id=127524#c17

For some all-in-one devices (like the Epson Stylus Photo RX420)
which have also a cardreader unit included there is additionally
the "usb_storage" kernel module which gets in conflict with SANE.

In particular for me the "ignoring EBUSY from USB" in SANE
didn't work when both "usblp" and "usb_storage" are loaded
but it works when only "usblp" is loaded.
At least for me for printing and scanning "ignoring EBUSY from USB"
is a good workaround but it seems to be not the final solution.
Henning Meier-Geinitz
2005-10-28 16:25:46 UTC
Permalink
Hi,
Post by Johannes Meixner
For some all-in-one devices (like the Epson Stylus Photo RX420)
which have also a cardreader unit included there is additionally
the "usb_storage" kernel module which gets in conflict with SANE.
I don't see any difference compared to usblp. If usb_storage (or
whatever other kernel module) claims an interface different from the
scanner interface used by SANE, there should be no problem. If there
still is a problem (e.g. i/o errors), I suspect some kind of kernel bug.
Post by Johannes Meixner
In particular for me the "ignoring EBUSY from USB" in SANE
didn't work when both "usblp" and "usb_storage" are loaded
but it works when only "usblp" is loaded.
What happens with usb_storage loaded? Same symptom, i.e. SANE can't
open the scanner?
Post by Johannes Meixner
At least for me for printing and scanning "ignoring EBUSY from USB"
is a good workaround but it seems to be not the final solution.
I think the only annoyance is the error message in syslog. On the
other hand, the kernel may be just a bit too verbose. Trying to change
the configuration while something else calims an interface is not such
a big problem which would warrant a warning message.

As we had trouble with devices which need the set_configuration
command, I want to keep it.

Bye,
Henning
Johannes Meixner
2005-10-31 13:46:45 UTC
Permalink
Hello,
Post by Henning Meier-Geinitz
Post by Johannes Meixner
For some all-in-one devices (like the Epson Stylus Photo RX420)
which have also a cardreader unit included there is additionally
the "usb_storage" kernel module which gets in conflict with SANE.
I don't see any difference compared to usblp.
You are right, see
https://bugzilla.novell.com/show_bug.cgi?id=127524#c25
---------------------------------------------------------
... scanning failed on my RX420 when usblp was loaded
but usb-storage was not loaded.
=> Very unstable (at least for me).
=> Needs further investigation.
---------------------------------------------------------

Scanning (always via "scanimage") with my RX420 works for one
or a few attempts and then it hangs up (but I can abort it
with [Ctrl]+[C]).

After
rmmod usblp usb-storage ; modprobe usblp ; modprobe usb-storage
"scanimage -L" works again for one or a few attempts.

This are the last messages with "SANE_DEBUG_SANEI_USB=128":
-----------------------------------------------------------------
...
[sanei_usb] sanei_usb_find_devices: vendor=0x04b8, product=0x080f
[sanei_usb] sanei_usb_open: trying to open device `libusb:002:003'
USB error: could not set config 1: Device or resource busy
[sanei_usb] sanei_usb_open: libusb complained: could not set
config 1: Device or resource busy
[sanei_usb] Maybe the kernel scanner driver or usblp claims
the interface? Ignoring this error...
[sanei_usb] sanei_usb_open: configuration nr: 0
[sanei_usb] sanei_usb_open: interface nr: 0
[sanei_usb] sanei_usb_open: alt_setting nr: 0
[sanei_usb] sanei_usb_open:num: 0 endpoint: 0x8052708
[sanei_usb] sanei_usb_open: direction: 128)
[sanei_usb] sanei_usb_open: address: 1 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-in endpoint (address 0x01)
[sanei_usb] sanei_usb_open:num: 1 endpoint: 0x805271c
[sanei_usb] sanei_usb_open: direction: 0)
[sanei_usb] sanei_usb_open: address: 2 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-out endpoint (address 0x02)
[sanei_usb] sanei_usb_open: configuration nr: 0
[sanei_usb] sanei_usb_open: interface nr: 1
[sanei_usb] sanei_usb_open: alt_setting nr: 0
[sanei_usb] sanei_usb_open:num: 0 endpoint: 0x8052758
[sanei_usb] sanei_usb_open: direction: 128)
[sanei_usb] sanei_usb_open: address: 3 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-in endpoint (address 0x03)
[sanei_usb] sanei_usb_open: we already have a bulk-in endpoint
(address: 0x81), ignoring the new one
[sanei_usb] sanei_usb_open:num: 1 endpoint: 0x805276c
[sanei_usb] sanei_usb_open: direction: 0)
[sanei_usb] sanei_usb_open: address: 4 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-out endpoint (address 0x04)
[sanei_usb] sanei_usb_open: we already have a bulk-out endpoint
(address: 0x02), ignoring the new one
[sanei_usb] sanei_usb_open: configuration nr: 0
[sanei_usb] sanei_usb_open: interface nr: 2
[sanei_usb] sanei_usb_open: alt_setting nr: 0
[sanei_usb] sanei_usb_open:num: 0 endpoint: 0x80527a8
[sanei_usb] sanei_usb_open: direction: 128)
[sanei_usb] sanei_usb_open: address: 5 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-in endpoint (address 0x05)
[sanei_usb] sanei_usb_open: we already have a bulk-in endpoint
(address: 0x81), ignoring the new one
[sanei_usb] sanei_usb_open:num: 1 endpoint: 0x80527bc
[sanei_usb] sanei_usb_open: direction: 0)
[sanei_usb] sanei_usb_open: address: 6 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-out endpoint (address 0x06)
[sanei_usb] sanei_usb_open: we already have a bulk-out endpoint
(address: 0x02), ignoring the new one
[sanei_usb] sanei_usb_open: opened usb device `libusb:002:003' (*dn=1)
[sanei_usb] sanei_usb_get_vendor_product: device 1:
vendorID: 0x04b8, productID: 0x080f
[sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
[sanei_usb] 0000: 1B 40
***@..............
[sanei_usb] sanei_usb_write_bulk: write failed:
Resource temporarily unavailable
[sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes
[sanei_usb] sanei_usb_read_bulk: read failed:
Resource temporarily unavailable
[sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
[sanei_usb] 0000: 1B 49
.I..............
[sanei_usb] sanei_usb_write_bulk: write failed:
Resource temporarily unavailable
[sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
[sanei_usb] 0000: 1B 49
.I..............
[sanei_usb] sanei_usb_write_bulk: write failed:
Resource temporarily unavailable

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
-----------------------------------------------------------------
and in dmesg there is either
"interface 1 claimed by usblp while 'scanimage' sets config #1"
or
"interface 2 claimed by usb-storage while 'scanimage' sets config #1"
depending which kernel module was loaded.
Post by Henning Meier-Geinitz
What happens with usb_storage loaded? Same symptom, i.e. SANE can't
open the scanner?
Yes, the symptoms are exactly the same for usblp and usb_storage.
Post by Henning Meier-Geinitz
I think the only annoyance is the error message in syslog. On the
other hand, the kernel may be just a bit too verbose. Trying to change
the configuration while something else calims an interface is not such
a big problem which would warrant a warning message.
I don't care about waring messages.
Post by Henning Meier-Geinitz
As we had trouble with devices which need the set_configuration
command, I want to keep it.
I am no USB expert but for me it seems SANE (i.e. sanei_usb.c)
calims the right interface (i.e. I think the conflict doesn't happen
because SANE calims the interface for the printer or cardreader).

For me it seems the conflict happens when SANE tries to set the
configuration while usblp and/or usb_storage are only loaded
(there was no real data transfer regarding the printer and/or
the cardreader - I neither printed nor was there a memory-card
plugged in).


Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5 Mail: ***@suse.de
90409 Nuernberg, Germany WWW: http://www.suse.de/
Henning Meier-Geinitz
2005-11-06 19:39:06 UTC
Permalink
Hi,
Post by Johannes Meixner
I am no USB expert but for me it seems SANE (i.e. sanei_usb.c)
calims the right interface (i.e. I think the conflict doesn't happen
because SANE calims the interface for the printer or cardreader).
Right.
Post by Johannes Meixner
For me it seems the conflict happens when SANE tries to set the
configuration while usblp and/or usb_storage are only loaded
(there was no real data transfer regarding the printer and/or
the cardreader - I neither printed nor was there a memory-card
plugged in).
The warning happens because SANE tries to the the configuration while
another program claims an interface in that configuration.

I think the write errors are not dierctly connected to this.

Bye,
Henning

russbucket
2005-10-26 23:10:25 UTC
Permalink
Post by Olaf Meeuwissen
CC:ing sane-devel for the benefit of archival purposes.
Actually, I already have switched to udev. So gathering from your
answer I guess iscan and udev don't work together.
Let me put it this way, iscan does not have any udev support so when
you plug in your device udev may not recognise it as a scanner. The
upshot of that is that the device node may not get the permissions
needed iscan and other SANE frontends to access it. You will need
read and write access to the device for it to work.
Just to make sure, check that the /proc/bus/usb/###/### entry that
corresponds to your RX420 has read/write access for everyone. If it
doesn't, then, as root, do
# chmod 0666 /proc/bus/usb/###/###
and give it another try.
# For the security conscious boys and girls out there, I know that
# this is not a good idea in general, but we're just trying to get
# the damn thing to work here first.
I tried again to make the scanner work, without result. It makes no
difference if I'm a normal user or root, neither the with epson- nor
with the iscan-backend I get it to work.
Now, if it also doesn't work when you are root, then there may be
something else that is getting in your way because root normally can
do anything to the device. i say normally, because SELinux and the
like may throw a spanner in the works here. For now I'm assuming you
are using the good old Unix ACL mechanism.
The node at /proc/bus/usb/001/ is there, but I can't use it in any way.
Creating a link from the respective node to something in /dev/ didn't
help me, either.
With /proc being a virtual file system, I'm surprised you managed to
make it a symlink to anywhere else to begin with.
But I can't believe I'm the only one not able to make it work!
Actually, there is another thread going on (started by russbucket,
IIRC) that just may be related to this (at least as far as iscan is
concerned).
What do you think: Is udev the reason? Is it something else? Is it me?
Nah, it's probably the weather or the phase of the moon ;-)
Seriously, sane-backends should have reasonably working udev support,
but I vaguely recall seeing some udev related commits recently. You
may want to check CVS for the latest scoop on this.
I have updated my sane-backend to version 1.0.16, didn't help.
That version introduced a locking mechanism which may or may not be
enabled by default on Gentoo. I don't know the details (yet). Any
one else care to jump in? Henning?
BTW, the epson backend in that version should support your scanner out
of the box. In 1.0.15 it did not, but you could force support for it
by adding
usb 0x04b8 0x080f
to your /etc/sane.d/epson.conf.
I even installed iscan from rpm (which normally isn't a good idea when
you use portage for all other packages).
I'm close to despair!
I can tell from your installation from RPM ;-)
Post by Olaf Meeuwissen
Post by Karl Heinz Kremer
You need to configure your hotplug system - this will then create the
scanner device for you once the scanner is connected to the system.
I'm not familiar with Gentoo, so I don't know how this is done with
your system.
There most likely will be a dynamically created device by the name of
/proc/bus/usb/001/004
but it may not have the correct permissions. You need read and write
permissions for the user that wants to use the scanner.
Note that when you re-plug or power cycle the device it will change
"names" (probably to /proc/bus/usb/001/005, 006 and so on). Unless
you set up hotplug (or udev, which I still have to look into myself)
to do this for you, you will need to do this manually every time you
re-plug, power cycle the device or reboot.
For USB scanners with a recent enough libusb (>= 0.1.6) and kernel (>=
2.4.12-ish. IIRC) there is no real need to muck with /dev/usb/scanner*
anymore. For 2.6.x kernels /dev/usb/scanner* is not an option, really.
Post by Karl Heinz Kremer
Post by d***@gmx.net
I'm using an Epson Stylus Photo RX 420 (scanner-printer-combo) on a
Gentoo machine (Kernel 2.6.13).
Sane is version 1.0.15 (back- and frontend).
found USB scanner (vendor=0x04b8 [EPSON], product=0x080f [USB MFP]) at
libusb:001:004
But I don't find a device for the scanner anywhere. I even created a
/dev/usb/scanner0 by hand, but that didn't help me, either.
I also tried iscan, but it only says that it can't connect to the
scanner and that I should make sure the scanner is on.
What version? If you take care of the hotplug support it provides,
most of the EPSON scanners should work out-of-the-box (unless your
system has already switched to udev in favour of hotplug).
Post by Karl Heinz Kremer
Post by d***@gmx.net
[snip]
Hope this helps,
--
Olaf Meeuwissen
FSF Associate Member #1962 sign up at http://member.fsf.org/
GnuPG key: 30EF893A/2774 815B DE83 06C8 D733 6B5B 033C C857 30EF 893A
Penguin's lib! -- I hack, therefore I am -- LPIC-2
I found an item on Novell that says SuSE 10.0 only uses udev not hotplug. When
I look at udev there are entries for a usbscanner in 50-udev.rules. I noticed
the permissions are 644 so I'm going to try changing them to 0666.

If I add my CX6600 (oxo4b8 0x0813 to the epson.conf and uninstall iscan do you
think it will work? is it better to run iscan-free? I don't care anymore if I
use Iscan and epkowa or what as long as I get something working. I tryed the
suggestion of disabling my usblp, but it did not help.

How do you switch to udev and disable hotplug when novell say hotplugs not
used?

I see no scanner created for my CX6600 but the printer and usb disks are.

Thanks for everyones continuing help.
d***@gmx.net
2005-10-26 20:59:56 UTC
Permalink
It finally works fully.

I had to export the /usr/local/bin path and put the sane-config script
there. Then it worked all well.

Finally it was worth all the effort ... :D
russbucket
2005-10-26 23:23:19 UTC
Permalink
Post by d***@gmx.net
It finally works fully.
I had to export the /usr/local/bin path and put the sane-config script
there. Then it worked all well.
Finally it was worth all the effort ... :D
which versions of sane and iscan or epson are you using. Which cvs and where
did you get it?
d***@gmx.net
2005-10-28 16:41:57 UTC
Permalink
I took the latest CVS version I could get. It is 1.0.16-cvs.

I still have iscan around somewhere (not removed completely yet), but
I'm not using it.

You get the CVS from
http://www.sane-project.org/cvs.html

But you'll have to compile the sources, so better read the README and
INSTALL files in the source directory.
Post by russbucket
Post by d***@gmx.net
It finally works fully.
I had to export the /usr/local/bin path and put the sane-config script
there. Then it worked all well.
Finally it was worth all the effort ... :D
which versions of sane and iscan or epson are you using. Which cvs and where
did you get it?
Continue reading on narkive:
Loading...