hotplug, input and XFree86
Hi,
is there a project to handle hotpluging of X11 input devices?
For example, I have a Wacom USB tablet. Hotplug works well except that the input subsystem is not yet integrated so I have to guess which input device number is use by the tablet.
Even with a proper input subsystem, the X server would have to be stopped and restarted when a new device is plugged in :-(
A first approach could be to change XFree86 but I have the feeling that I could take months or years.
So I propose to develop an 'input' daemon responsible of connecting hot-plugable devices to custom devices.
When the daemon is started, it creates a virtual device for each physical device that may be plugged in the system.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Humm... Stupid mailer :-)
Here is the complete mail:
Hi,
is there a project to handle hotpluging of X11 input devices?
For example, I have a Wacom USB tablet. Hotplug works well except that the input subsystem is not yet integrated so I have to guess which input device number is use by the tablet.
Even with a proper input subsystem, the X server will have to be stopped and restarted when a new device is plugged in :-(
A first approach could be to change XFree86 but I have the feeling that I could take months or years.
So I propose to develop a generic 'input' driver for XFree86. This input driver will only understand a subset of the kernel-input events corresponding more or less to the native X11 events (motions in n-dimensions, n-buttons press/release and key press/release).
Those events will not be provided directly by the kernel drivers by a daemon started before the X server.
The daemon will be responsible for
- Creating one or more devices (daemon device) for each physical device that could be plugged in the system Those file devices can be opened by the XFree86 generic 'input' driver even if the physical device is yet not plugged in.
- respond to hotplug requests by mapping those demon daemon devices to the kernel input devices.
- translate kernel input events to XFree86 input events and redirect them to the appropriate daemon device.
Example: For my wacom, the daemon would load a wacom.o driver and create 3 devices.
/dev/daemon-input/wacom-stylus/dev/daemon-input/wacom-eraser/dev/daemon-input/wacom-mouse
consider that the wacom is plugged in /dev/input/event0.
the daemon driver has to interpret the wacom specific event ABS_PRESSURE, BTN_TOOL_STYLUS, BTN_TOOL_ERASER, ABS_TILTX, and map them to more standard event. In the XFree wacom driver, the pressure is on the Z axis so all ABS_PRESSURE events will be transformed into ABS_Z events.
The BTN_TOOL_??? events will be used to select the output device to use.
From an XFree point of view, all devices have to be configured in the XF86Config file.
Example: for the wacom stylus
Section "InputDevice"
Identifier "gstylus"
Driver "generic-input"
Option "Device" "/dev/daemon-input/wacom-stylus"
# my wacom supports only 3 dimensions: X, Y and Pressure Option "Dimensions" "3"
Option "Mode0" "absolute"
Option "Max0" "10206"
Option "Mode1" "absolute"
Option "Max1" "7422"
Option "Mode2" "absolute"
Option "Max2" "511"
# and 3 buttons
Option "Buttons" "3"
EndSection
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines · you
For example, I have a Wacom USB tablet. Hotplug works well except that the input subsystem is not yet integrated so I have to guess which input device number is use by the tablet.
A nice work-around for mice is to use /dev/input/mice instead of the pointer's device node, but it does not work with other input devices.
Quoted 5 lines
So I propose to develop a generic 'input' driver for XFree86. This input driver will only understand a subset of the kernel-input events corresponding more or less to the native X11 events (motions in n-dimensions, n-buttons press/release and key press/release).
There is a input driver, using the event interface. It has to be ported to XFree 4.0 though.
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/linuxconsole/ruby/xfree86/
http://sourceforge.net/projects/linuxconsole/
Quoted 9 lines
The daemon will be responsible for
- Creating one or more devices (daemon device) for each physical device that could be plugged in the system Those file devices can be opened by the XFree86 generic 'input' driver even if the physical device is yet not plugged in.
- respond to hotplug requests by mapping those demon daemon devices to the kernel input devices.
- translate kernel input events to XFree86 input events and redirect them to the appropriate daemon device.
Why don't you implement the ability to deal with disappearing devices in the input driver itself?
bye...
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 8 lines · On 2001.10.05 18:43 Tim Jansen wrote:
There is a input driver, using the event interface. It has to be ported to
XFree 4.0 though.http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/linuxconsole/ruby/xfree86/
http://sourceforge.net/projects/linuxconsole/
Interesting. Is the project still alive? Nothing has been updated for almost a year. Anyway, I will have a look to it.
Quoted 11 lines
Quoted 10 lines
The daemon will be responsible for
- Creating one or more devices (daemon device) for each physical device that could be plugged in the system Those file devices can be opened by the XFree86 generic 'input' driver even if the physical device is yet not plugged in.
- respond to hotplug requests by mapping those demon daemon devices to the kernel input devices.
- translate kernel input events to XFree86 input events and redirect them to the appropriate daemon device.
Quoted 3 lines
Why don't you implement the ability to deal with disappearing devices in the
input driver itself?
I have not investigated a lot but I believe that there is a major problem with the XInput protocol and with the way XFree86 is designed.
They both seem to assume that the list of devices is static. For example, XInput does not provide any events to inform the clients that a device has been added or removed.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 6 lines · Stephane Chauveau
Quoted 5 lines · On 2001.10.05 18:43 Tim Jansen wrote:
There is a input driver, using the event interface. It has to be ported to
XFree 4.0 though.
Quoted 6 lines
Quoted 3 lines
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/linuxconsole/ruby/xfree86/
http://sourceforge.net/projects/linuxconsole/Interesting. Is the project still alive? Nothing has been updated for almost a year. Anyway, I will have a look to it.
It should be back alive now. Dan Skarda told me he's resuming the work on it.
Quoted 15 lines
Quoted 10 lines
Quoted 9 lines
The daemon will be responsible for
- Creating one or more devices (daemon device) for each physical device that could be plugged in the system Those file devices can be opened by the XFree86 generic 'input' driver even if the physical device is yet not plugged in.
- respond to hotplug requests by mapping those demon daemon devices to the kernel input devices.
- translate kernel input events to XFree86 input events and redirect them to the appropriate daemon device.Quoted 3 lines
Why don't you implement the ability to deal with disappearing devices in the
input driver itself?
Quoted 6 lines
I have not investigated a lot but I believe that there is a major problem with the XInput protocol and with the way XFree86 is designed.
They both seem to assume that the list of devices is static. For example, XInput does not provide any events to inform the clients that a device has been added or removed.
True. This, unfortunately, can't be fixed or worked around easily.
Signature · 7 lines
Vojtech Pavlik SuSE Labs _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel