[sane-devel] SANE and switching off the scanner lamp.
Adrian Perez Jorge
Mon, 10 May 2004 11:17:10 +0100
Is there any proposal or standard way in SANE to check for scanner
inactivity to switch off the scanner lamp? I have read some scanner
backends source code and some of them have an option to switch off the
scanner lamp after scanning; others have a little prog (look into SANE
`tools/' directory) that polls the scanner and switch off the lamp after
a period of inactivity.
I belive the interest to switch off the lamp is a matter of power
savings and lamp lifetime. But switching off the lamp after each
scanning slows down the scanning process of a few bunch of pages,
because there should be a warm up period in wich the backend should
wait. (It's easier to program if the warm up period is supposed to be
constant, but a big constant will make that period longer than just the
necessary; but if not constant, is there a safe way to detect when the
lamp is ready to scan? maybe during coarse calibration?)
It will be more adecuate to switch off the lamp after some period of
inactivity, so there is no pause between page scannings due to lamp
management. Just inactivity period needs to be tuned for economy and
A polling daemon could be a sollution but the SANE API should be aware
to detect a scanner in use and a standard way to switch off the lamp
needs to exist. A broadcaster/observer pattern could also be used here
(somewhere :-)), so just backends instances that needs to manage the
lamp are notified.
Scanner button management also needs a similar solution (some posts
exists in the mailing list about that subject). Is D-BUS
(http://www.freedesktop.org/Software/dbus) useful for all this?