[sane-devel] New magicolor backend for inclusion in git

Reinhold Kainhofer reinhold at kainhofer.com
Fri Jan 14 21:32:21 UTC 2011


Am Freitag, 7. Januar 2011, um 02:34:20 schrieb m. allan noah:
> I took a quick look at the code, and only see a few minor issues at
> first glance.
> 
> 1. MC_AutoDetectionTimeout is not configurable at runtime
> 2. the code only calls sanei_usb_init during sane_init. This prevents
> long-running programs like button press daemons from finding
> hotplugged scanners. This was discussed recently on the list.
> 3. Some of your Option Groups could get their names from saneopts.h
> (SANE_NAME_GEOMETRY, TITLE, DESC, etc)
> 
> Other than those things, it looks fine to me.

Okay, here are updated patches (amended, so the whole backend is in one 
patch):
http://www.fam.tuwien.ac.at/~reinhold/sane/magicolor_backend_patches/

-) Patches 0001 and 0002 are the USB patches you already reviewed (with 
copyright notices added as you wanted), so they are ready to be applied.

-) Patch 0003 fixes a compiler warning that macros like htobe16 (byteorder.h) 
etc. are already defined. In that case, don't overwrite the existing 
definitions. (Chris Bagwell okay'ed it)

-) Patch 0004 is the actual backend

-) Patch 0005 is an alternative to running autoreconf (No manual changes done 
by me!). This patch should probably not be applied to git master, but someone 
(Chris Bagwell already volunteered) should run autoreconf with the recommended 
auto(conf|make|...) versions for sane installed.



Changes to patch 0003 are in detail (compared to the last version you looked 
at):
-) All three timeouts (SNMP detection, scan data read, other scanner 
responses) are configurable in the magicolor.conf file
-) Cleaned up the options, reused pre-defined values as much as possible
-) Call sanei_usb_init also in get_devices
-) get_devices does not erase the list of scanners any more, but keeps still-
existing scanners untouched, just removes removed and adds new scanners.


There is, however, one issue that needs to be discussed in principle: 
How shall network auto-detection work in a sane way, once several backends 
support auto-detecting network-connected scanners? AFAICS, all backends are 
loaded sequentially, and the network auto-detection of each backend needs to 
wait for a certain time before timing out (even if one response was received, 
you have to wait the whole timeout, as there might be another device on the 
network). 
So, if 10 backends support auto-detection, and each uses a 2 second timeout, 
sane would have a startup time of >20 seconds... Clearly, that's not 
desirable.

On Windows, that's not an issue, as the user only installs drivers for the 
scanners he really owns. However, sane provides all backends by default and 
runs each backend's initialization (get_devices), so here it is a problem.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



More information about the sane-devel mailing list