Xorg Input Hotplugging

Ben Gamari ben at mw0.ath.cx
Sun Oct 14 23:41:32 PDT 2007


Well, I caught the problem. It was that Gnome was resetting the keyboard
model to "Dell Latitude series" whereas it should be "Evdev managed
keyboard." A change of this and quick restart of X cleared up the
keyboard issues, without any inputdevice sections in xorg.conf (except
for the synaptics touchpad). I starting writing this message before I
knew what the issue was, so a lot of the latter is simply for reference
for others who experience this issue:

On Sun, 2007-10-14 at 23:59 -0400, Bernardo Innocenti wrote: 
> On 10/14/07 21:46, Ben Gamari wrote:
> 
> > Some investigation revealed that the evdev driver had taken the
liberty
> > of claiming my keyboard and track stick in addition to the newly
> > hotplugged usb mouse.
> 
> The mapping between HAL capabilities and X drivers is in the
> x11-input.fdi policy file (not installed by default).
> 
> On Linux, evdev is used by default because it's supposed to
> be more flexible and a better design than using the old mouse
> and keyboard drivers which rely on PS/2 protocol emulation.

Yeah, I caught on to x11-input.fdi not being installed and copied it
manually. Perhaps there should be another configure --enable- flag to
install this file to make this a little more explicit. I thought the
non-installation of this file was just an oversight.

> 
> > After deleting my old InputDevice section (using
> > the kbd driver), I restarted xorg and found that my keyboard issues
> > continued. Looking through the manpage of the evdev driver produced
that
> > most QWERTY keyboard users will need to pass "evBits," "keyBits",
and
> > "Pass" options to the evdev driver.
> 
> At this time, I'm afraid there's no way to pass configuration
> options to evdev through hal.  But I had no need to set any
> of these on the OLPC.
> 
> The documentation you've read is probably outdated.  These days,
> evdev_drv 1.2 is pretty good at autodetecting these things
> directly from the /dev/input/eventX device.

Probably, it seems to be remarkably difficult to find up to date and
accurate documentation about X input hotplug.

> 
> I believe we should strive to avoid hardcoding things such as
> the keyboard layout, repeat rate and in hal.  A simple solution
> would be to autoconfigure things with basic but mostly working
> defaults (pc105 us layout for the keyboard, medium mouse
> acceleration...).
> 
> At login time, the desktop will send Xi and XKB requests to
> override these defaults with per-user preferences.

Fair enough, this seems like a reasonable way to go about configuration.
Out of curiosity, does xdm/gdm presently do this?

> 
> 
> > After trying to add a new
> > InputDevice section using the evdev driver and the required options,
> > restarting xorg failed with:
> > 
> > expected keysym, got XF86KbdLightOnOff: line 70 of pc
> > expected keysym, got XF86KbdBrightnessDown: line 71 of pc
> > expected keysym, got XF86KbdBrightnessUp: line 72 of pc
> 
> I believe you have an outdated libX11.  They added a few
> new keysyms recently.

I'm running libX11-1.1.3 which appears to be the latest release. It
looks like libX11 with the new keysyms still hasn't been rolled into a
release (commit 7c996f78914c77fe17e9f4feede980d895d9df51). Ideally,
these xkbcomp errors shouldn't affect the functionality of the input
system as a whole, right?

> 
> 
> > (EE) AlpsPS/2 ALPS GlidePoint-isa0060/serio1/input0: Button: 74.
> > (EE) AlpsPS/2 ALPS GlidePoint-isa0060/serio1/input0: state->btn:
> 0x8322d10.
> > (EE) AT Translated Set 2 keyboard-isa0060/serio0/input0: Don't know
> how to use device.
> > (EE) PreInit failed for input device "AT Translated Set 2 keyboard"
> 
> This doesn't happen to me... could you please post the output
> of lshal? (just for the keyboard and tablet, not all of it!)

If you still care, here it is:

Keyboard:
udi =
'/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'
  info.addons = {'hald-addon-keyboard'} (string list)
  info.addons.singleton = {'hald-addon-input'} (string list)
  info.capabilities = {'input', 'input.keyboard', 'input.keypad',
'input.keys', 'button'} (string list)
  info.category = 'input'  (string)
  info.parent =
'/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  info.product = 'AT Translated Set 2 keyboard'  (string)
  info.udi =
'/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'  (string)
  input.device = '/dev/input/event3'  (string)
  input.originating_device =
'/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  input.physical_device =
'/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  input.product = 'AT Translated Set 2 keyboard'  (string)
  input.x11_driver = 'evdev'  (string)
  input.xkb.layout = 'us'  (string)
  input.xkb.model = 'evdev'  (string)
  input.xkb.rules = 'base'  (string)
  input.xkb.variant = ''  (string)
  linux.device_file = '/dev/input/event3'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string) 
  linux.sysfs_path = '/sys/class/input/input3/event3'  (string)


Touchstick: 
udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_2'
  info.capabilities = {'input', 'input.mouse'} (string list)
  info.category = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.product = 'PS/2 Mouse'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_2'  (string)
  input.device = '/dev/input/event4'  (string)
  input.product = 'PS/2 Mouse'  (string)
  input.x11_driver = 'evdev'  (string)
  linux.device_file = '/dev/input/event4'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.sysfs_path = '/sys/class/input/input4/event4'  (string)


Touchpad: 
udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port_logicaldev_input'
  info.capabilities = {'input', 'input.mouse', 'input.touchpad'} (string list)
  info.category = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port'  (string)
  info.product = 'AlpsPS/2 ALPS GlidePoint'  (string)
  info.udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port_logicaldev_input'  (string)
  input.device = '/dev/input/event5'  (string)
  input.originating_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port'  (string)
  input.physical_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port'  (string)
  input.product = 'AlpsPS/2 ALPS GlidePoint'  (string)
  input.x11_driver = 'evdev'  (string)
  linux.device_file = '/dev/input/event5'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.sysfs_path = '/sys/class/input/input5/event5'  (string)


> > Does xorg infer the evdev options when hal notifies it of a new
keyboard
> > device? Additionally, it looks like evdev attempts to take over my
> > synaptics touchpad as well. Should the driver be checking whether
> > devices are already in use before it claims them for itself? Thanks
a
> 
> evdev does not claim them.  It's hal telling the X server to do
> that.  Or so I believe...

Yeah, that's what I meant, my wording was a bit misleading.
If it helps at all, the machine is a Dell Latitude D820 that runs Gentoo
with recently updated Xorg 1.4. Thanks,

- Ben 



More information about the xorg mailing list