[sane-devel] HAL and scanners.

Étienne Bersac bersace03 at gmail.com
Mon Mar 17 18:36:50 UTC 2008


Hi,

> you may have a chain of backend names. the udi is only useful if each
> backend can use it to get enough info from hal to indentify the
> scanner. i dont know what hal can provide in that case.

Here is an example of HAL device properties (stripped), you will notify
the scanner namespace added by Abel Deuring fdi and the
scanner.sane.name property added by hald-addon-scanner.

bersace at thilivren:~$ lshal --show /org/freedesktop/Hal/devices/usb_device_a53_1000_noserial_if0
udi = '/org/freedesktop/Hal/devices/usb_device_a53_1000_noserial_if0'
  info.addons = {'hald-addon-scanner'} (string list)
  info.bus = 'usb'  (string)
  info.capabilities = {'scanner', 'scanner', 'access_control'} (string list)
  info.linux.driver = 'usbfs'  (string)
  info.parent = '/org/freedesktop/Hal/devices/usb_device_a53_1000_noserial'  (string)
  info.subsystem = 'usb'  (string)
  info.udi = '/org/freedesktop/Hal/devices/usb_device_a53_1000_noserial_if0'  (string)
  scanner.access_method = 'proprietary'  (string)
  scanner.api = {'sane'} (string list)
  scanner.is_supported = true  (bool)
  scanner.sane.backend = {'plustek', 'plustek'} (string list)
  scanner.sane.name = 'plustek:libusb:001:005'  (string)
  scanner.sane.supportstatus = {'complete'} (string list)
  usb.bus_number = 1  (0x1)  (int)
  usb.can_wake_up = true  (bool)
  usb.device_class = 0  (0x0)  (int)
  usb.device_protocol = 0  (0x0)  (int)
  usb.device_revision_bcd = 256  (0x100)  (int)
  usb.device_subclass = 0  (0x0)  (int)
  usb.interface.class = 255  (0xff)  (int)
  usb.is_self_powered = false  (bool)
  usb.linux.device_number = 5  (0x5)  (int)
  usb.max_power = 0  (0x0)  (int)
  usb.num_configurations = 1  (0x1)  (int)
  usb.num_ports = 0  (0x0)  (int)
  usb.product = 'USB Vendor Specific Interface'  (string)
  usb.product_id = 4096  (0x1000)  (int)
  usb.speed = 12.0 (12) (double)
  usb.speed_bcd = 4608  (0x1200)  (int)
  usb.vendor = 'Portable Peripheral Co., Ltd'  (string)
  usb.vendor_id = 2643  (0xa53)  (int)
  usb.version = 1.0 (1) (double)
  usb.version_bcd = 256  (0x100)  (int)

Backend can access almost all those info, especially usb.bus_number and
usb.linux.device_number.

> now, we dont have to solve
> all the problems at once, but i dont think i see what problem hal
> integration is trying to solve. can you help me understand?

HAL easy hotplug while running sane_get_devices() several times is
suboptimal. Also, UDI are universal accross the desktop (not only Gnome
or KDE) and allow to easily pass a device as argument (think
gnome-volume-manager handle scanner button and launch gnome-scan passing
the emitting device for preselection in the device selector), etc. There
is much much other possibilities given with HAL.

Also, frontend can mix sane_get_device for probe and HAL for hotplug,
etc.

See also hald-addon-scanner which is an elegent solution for propagating
device event (paper-in, button pushed, etc.) since it is launched only
if scanner is plugged, has no redundant code for probing, is cross
desktop (not GNOME or KDE specific), etc.

Anyway, having HAL support does not collide with existing behaviour.

Regards,
Étienne.




More information about the sane-devel mailing list