HAL and scanners

abel deuring adeuring at gmx.net
Wed Dec 27 14:48:46 PST 2006


Hi all,

I am a (though in the last time not-very-active) Sane developer.

During a recent discussion on the sane-devel mailing list about the
question, if/how the Sane team can/will be able to work on a new
version of the Sane API, Étienne Bersac and Martin Owens suggested
that Sane should somehow provide HAL support or integrate HAL or
whatever. Details on how this integration or support should look
like remained quite vague, so I thought to address this question
from a practical viewpoint. Starting with something that is quite
easy to implement, might lead to a better cooperation ;)

Obviously, an .fdi file with scanner information can be useful for
HAL, and the Sane source code contains files that describe supported
and some unsupported scanners, so I wrote a little converter script
that generates an .fdi file from these files. At present, Sane's
scanner description (*.desc) files contain only the USB vendor and
product IDs, but not things like SCSI vendor/model strings, so the
result is not really comprehensive. The fdi file generated by the
script describes nevertheless 325 supported USB-scanners nd some 200
unsupported USB scanners.

A single device description looks at present like this:

  <device>
    <match key="usb.vendor_id" int="0x05da">
      <match key="usb.product_id" int="0x009a">
        <merge key="info.capabilities"
               type="strlist">scanner</merge>
        <merge key="scanner.drivertype" type="string">sane</merge>
        <merge key="scanner.sane.backend"
               type="strlist">microtek2</merge>
        <merge key="scanner.vendor" type="string">Microtek</merge>
        <merge key="scanner.model" type="string">SlimScan C6</merge>
        <merge key="scanner.sane.supportstatus"
               type="string">complete</merge>
      </match>
    </match>
  </device>

A quick test with a USB scanner and a SCSI scanner (for the latter,
with a manually edited fdi file) showed that lshal lists the
scanners just fine.

I can't claim to know much about HAL and the things that might be
useful for projects like Gnome and KDE, so I am not sure, if the
entries for the "scanner" name space really make sense from the
viewpoint of an application developer. Comments for additions /
changes etc are welcome.

Problems/questions/remarks regarding my current approach:

1. For some USB vendor/product IDs, the Sane *desc files list more
than one supported scanner model. As I understand it, the last entry
 "wins", if these devices are described by <merge> tags. Can I
simply replace all affected <merge> tags with <append> tags? (The
word "append" suggests that a thingy must exist before another
thingy can be appended ;)

2. For some scanners, more than one Sane backend exists.

3. Scanners may have more than one host interface; some Fujitsu
scanners for example can connect to the SCSI and the USB bus. Do
these scanners need more than one <device>...</device> description,
or is there something like an "or expression" for the <match> tags?

4. Aside from backends for "usual" scanners, Sane has also backends
for a few cameras, and the *desc files provide information for
"non-devices" like the net backend. Does it make sense to include
data about some or all of these in an fdi file?

5. Does it make sense to list unsupported scanners in the fdi file?

6. What information would be needed for parallel port scanners, and
for the IEEE-1394 interface in order to identify them?

Abel


More information about the hal mailing list