Getting involved in XInput hotplug development?
Magnus.Vigerlof at home.se
Sat Feb 17 03:05:27 PST 2007
Some time ago Enleth wrote:
> As someone might be interested in that, there are two little pieces of code
> I wrote, primarily for my personal use (yes, I do really need this hotplug
> that much), and some thoughts:
I think we all will 'need' true hotplugging once we've got a taste of it...
Anyway, it's great to hear that you have a personal interest in this, just as
I have. I want a better hot-plugging support for my tablet as well since I'm
running on a laptop and doesn't have it connected all the time. I do have a
temporary solution at the moment that works well, but true hotplugging would
simplify it for everybody...
I've just started to look into how the linuxwacom driver should be changed to
support hotplugging (I've been more or less challenged by Ping to do
something in this area) so I haven't got as far as you have in getting a
testing environment up and running.
But I do know that the uninit-code in the wacom driver needs to be worked on
if we should be able to remove the devices when the hardware is removed. I
wouldn't be surprised if the X-server goes down in a cloud of 1's and 0's if
you try at the moment even with the latest version, but there's no problem
with static configurations (and I'm partly the reason for that, so I think I
should do something about it...).
> 2. A simple Python script that relays HAL DeviceAdded events to Xserver,
> currently supporting mice and Wacom tablets (I had to adapt the
> linuxwacom.sf.net driver to the new XInput code, the patch will be on its
> way to their mailing list shortly). I know it's ugly because it uses
> evdev's Device option, but works. It takes the display number as an
> argument, e.g. python inputadd.py 0. The identifier string should probably
> be generated in a smarter way to avoid messing things up when two identical
> devices get plugged in at the same time, but that's something to do later.
We would probably want to keep track of the names that are used for a specific
tablet model as well. I know that Gimp uses the name of the device for saving
specific information attached to it and if a user has two different models it
would be nice if the names were persistent between the different hotplug
events. And since these names are visible for the user we should come up with
good names as well for the different tools.
And just to complicate things even more; We've had requests from users with
12x12 tablets which are using a wide screen display, and to be able to use
the whole tablet (without very funny aspect ratios) it is now possible to
divide the tablet into different areas which are translated into separate
input devices.. So we can have quite a few input devices that need to be
added to the server when we receive a hotplug event.. This is mostly a
configuration issue even if the program adding devices must handle this
situation as well..
> Still, there is one thing that concerned me while writing the script,
> namely removing the devices. The server expects numerical device
> identifier, the script as it is now has no way of knowing it. There could
> be a few different ways to get around this, but I didn't try to implement
> any of them, as I'd like, even in something I write for myself, to do that
> the way X.org developers see it, so it's either useful for everyone, or
> just easy for me to switch to something more "official" later on.
I wouldn't try to remove a wacom input device just yet.. Even if it's only in
a test-environment. There are some dependencies between different structs
that must be sorted out before I can see it is possible to safely remove a
wacom device from a running X-server. This is one of the first things I put
up on my todo list for hotplugging support..
Questions for you guys who made all this possible:
Do we want a daemon/tray-app/whatever running for each kind of device? I.e.
should the linuxwacom tar include a separate application that will handle
hotplug events for all wacom tablets? A tray app in KDE/Gnome/... should be
better than a daemon as there are configuration options that should be made
easily available for the user, but we need to start somewhere..
At the login prompt for xdm/kdm/gdm/.. there should be some support for the
tablet (and hotplugging) so it can be used there too. My initial thought was
to use the default settings for the attached tablet, and when the user logs
in reload all wacom input devices so they will get the correct names and
options set. When the user logs out these settings should be reverted.
More information about the xorg