[sane-devel] HAL and scanners.

Étienne Bersac bersace03 at gmail.com
Mon Mar 17 13:58:05 UTC 2008


In order to have hotplug, quicker probe, more information about device
and better integration with the desktop, i want to use HAL to detect

Quick HAL intro. HAL means hardware abstraction layer. It's a piece of
code running on Linux and *BSD providing high level features over device
plugged to the system. HAL provide a system wide API for listing
devices, receiving signals (new device, device property changed, unplug,
etc.). For each device, HAL provide a lots of informations : vendor,
product, capabilities (think all-in-one devices), etc.

Discussion for HAL and SANE integration from 2006 leds to the key point
of linking SANE device name and HAL UDI. SANE device name and HAL UDI
are defined at runtime and thus can't be stored in the FDI.

A HAL aware frontend use HAL to detect scanners and receive plug and
unplug event. Once it has a scanner UDI, it open it with SANE. It then
need the SANE device name. Where to find the SANE device name ? I found
two possible solutions.

      * HAL device has a scanner.sane.name string property allowing the
        frontend to simply read that property and pass it to
      * SANE handle device name like "hal:<udi>".
      * SANE provide an extra function to translation hal udi to SANE
        device name. e.g. char* sane_hal_udi_to_device_name(halctx, udi)

For the first solution, SANE must document device naming in order to
allow external implementation of device naming computation.

For the latters, this will not break the API since neither the behaviour
nor the function prototype will change. I personnally vote for the last

So, how can SANE help fixing this ?


More information about the sane-devel mailing list