[sane-devel] using scanners unable to USB_AUTOSUSPEND

Wilhelm wilhelm.meier at fh-kl.de
Fri Jan 11 07:42:51 UTC 2013


Am 10.01.2013 17:29, schrieb Johannes Meixner:
>
> Hello,
>
> 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
> contains:
> -------------------------------------------------------------------------------
>
> # 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.

Thanks for the hint! Must have missed the entry ...

But: I'm on ubuntu 12.04 and here I have the effect that after plugging 
in the scanner it remains for about 500ms in the state "on" and then 
falls back to "auto". So I moved 40-libsane.rules to 99-libsane.rules 
and it is ok. Well, now I have to figure out the offending rule(s) ...

>
> 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


-- 
Wilhelm




More information about the sane-devel mailing list