[sane-devel] using scanners unable to USB_AUTOSUSPEND

Johannes Meixner jsmeix at suse.de
Thu Jan 10 16:29:54 UTC 2013


On Jan 10 16:58 Wilhelm wrote (excerpt):
> recently I had problems with my old EPSON 1670 Scanner, because it doesn't 
> support usb autosuspend that most distros enable by default in the linux 
> kernel. That causes scanimage or other applications (e.g. like scanner button 
> daemon scanbd) to freeze or even reading wrong values.

If I remember correctly a longer time ago the "usb autosuspend" issue
was discussed on this list.

As a consequence the sane-backends libsane.rules file for udev
(it is /etc/udev/rules.d/55-libsane.rules at least in openSUSE)
that is generated by tools/sane-desc.c in the sane-backends sources
# Epson Perfection 1670
ATTR{idVendor}=="04b8", ATTR{idProduct}=="011f", ... ENV{libsane_matched}="yes"
# The following rule will disable USB autosuspend for the device
ENV{libsane_matched}=="yes", RUN+="/bin/sh -c
  'if test -e /sys/$env{DEVPATH}/power/control;
   then echo on > /sys/$env{DEVPATH}/power/control;
   elif test -e /sys/$env{DEVPATH}/power/level;
   then echo on > /sys/$env{DEVPATH}/power/level; fi'"
(the actual udev rules are single long lines - only wrapped here)

Accordingly - if your "EPSON 1670" matches the idVendor/idProduct - it
should get ENV{libsane_matched}="yes" and USB autosuspend should get
disabled for it.

Unfortunately things in udev/sysfs are unstable by design (udev/sysfs is 
primarily meant as a helper tool to do kernel related stuff and not
a tool for application programs - sane-backends ia an application
from the kernel point of view) so that it depends on the kernel
and udev version whether or not udev rules actually work.

Kind Regards
Johannes Meixner
SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany
HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer

More information about the sane-devel mailing list