[RFC] XInput hotplugger daemon

Magnus Vigerlöf Magnus.Vigerlof at home.se
Thu Mar 13 13:53:37 PDT 2008


Hello,

Ever since the hotplugging code was merged into master I've really wanted to 
be able to just plug in my Wacom tablet to the computer and just have the 
needed InputDevices defined. For the mouse and keyboard HAL and some 
fdi-rules does the trick. But Wacom tablets has turned out to be something 
completely different, see also [1]. We've also had a pretty long discussion 
about this over at the linuxwacom list [2], and I think we agreed to disagree 
until we could actually show how it would work...

So I've realised that there is a need for another way of hotpluging the 
connected devices than through the internal HAL-support in the Xserver, an 
external hotplugger daemon. This has been mentioned as a possible way to 
solve hotplugging in some posts here, but my searches for someone making a 
program like this has turned up empty.

So following the argumentation I made in [2] I've written a little daemon that 
listens to HAL-signals and adds/removes InputDevices as they come and go. The 
first try was desiged to work in parallell with the internal HAL-support. But 
I couldn't figure out how to identify which devices had which driver in the 
Xserver, so the second try [3] takes complete control. i.e. turn off the 
HAL-code in the Xserver if you want to try this (the configuration option 
should be enough)...

Currently it does only what the internal HAL-support does today, nothing more. 
But my idea is to add loadable module support for additional types of 
devices, better D-Bus support so the connected devices can be managed via the 
session bus, .... More stuff will come, but I'd appreciate comments about the 
main concept. I hope the D-Bus interface can be an interface that can be used 
by other applications (configuration tools/tray apps/...) to monitor/manage 
the connected devices/defined InputDevices.

Some key concepts/...:
 - Uses dbus-glib-1 as library towards the system and session D-Bus
 - Has white/black-lists for HAL-paths to ignore and X devices to leave 
(statically defined devices in the xorg.conf)
 - Two layers, the physical devices and InputDevices are separated for those 
devices with a 1:n device:InputDevice mapping [1]
 - D-Bus interface to monitor/manage the connected devices and InputDevices.
 - Takes complete control of the configured InputDevices, unless an 
InputDevice is blacklisted it is removed at startup and added if HAL has an 
entry for the hardware (with appropriate parameters for it).
 - Should be started when [gkx]dm starts (without connection to a session 
bus), and restarted when the user log in (with connection to the session bus)


So what do you think? I need something that solves the hotplugging issue with 
my tablet, and I think this is one way to solve it.

Cheers
  Magnus

[1] http://lists.freedesktop.org/archives/xorg/2008-February/032659.html
[2] 
http://www.nabble.com/How-do-we-want-to-write-our-hotplug-demon--td13332217.html
[3] git://people.freedesktop.org/~wigge/xinputhotplugd



More information about the xorg mailing list