Tuesday, December 2, 2008

evdev, xorg.conf, hal and other FUD

Sparked by this thread, here's a list of X input facts in random order.

  • The evdev driver is the preferred input driver. If you are not running Linux, then evdev is not available for you and you can keep using the mouse/kbd drivers.

  • If you are running Linux, you can keep using the mouse/kbd driver if you wish, but configuration adjustments need to be made. See below for details.

  • By default, the X server will expect a device list at runtime from HAL. You can turn this behaviour off by using Option "AutoAddDevices" "off" in the ServerLayout, or by disabling HAL at configure time. HAL is not required to use X.

  • If HAL is enabled, then the mouse/kbd drivers are disabled. Otherwise, you will get duplicate devices. If you want to use mouse/kbd, disable HAL.

  • Devices only get added if they have the input.x11_driver option set (check lshal). For mice and keyboards, evdev is the default, drivers such as linuxwacom or synaptics provide their own fdi.

  • Any other options need to be added with the key "input.x11_options.foobar" and must be of type string.

  • Devices specified in the xorg.conf will not be available after unplugging and replugging them, but will become available again after a VT switch or a resume.

  • XKB options are specified by HAL, not by the server.

  • The evdev driver will prevent you from adding the same event device twice. The synaptics driver does too. Evdev will not prevent you from adding /dev/input/mice and /dev/input/event1 at the same time.

  • HAL will prevent you from adding the same UDI.

  • AutoAddDevices specifies whether to add devices through HAL (default on).

  • AutoEnableDevices specifies whether to enable such devices immediately (default on).

  • AllowEmptyInput specifies if a mouse/kbd section if none is present is required (if AEI is on -> no mouse/kbd required, disables mouse/kbd if present in the xorg.conf). AllowEmptyInput defaults to (AutoAddDevices && AutoEnableDevices)

  • Synaptics SHM or other options can be enabled in the FDI file with the key "input.x11_options.SHMConfig" (or likewise). Options have to be type string.

  • Synaptics has improved a lot in regards to autoconfiguration and you probably won't need half of your options anymore.

  • For every default setting that annoys you there's at least one person that loves it. For every default setting that you find appropriate, there's at least one person hating it. Become an active contributor, then you get to decide on what the defaults are.

  • Storing configuration in HAL's fdi file is not the best solution but the best we have right now.

  • The old system worked, because you only ever had one mouse and one keyboard in X. Now you can have multiple of each, independently configured. This is why we switched to HAL for hotplugging and autoconfiguring.

  • Ranting and/or commenting on some blog won't get your issues fixed. Filing a bug may.


OasisGames said...

"Devices specified in the xorg.conf will not be available after unplugging and replugging them, but will become available again after a VT switch or a resume."

When is this going to be fixed?
I'd love to be able to pop my hand-configured Wacom tablet out and put it back in (or in my usual case, remove it from my desktop and then plug it into my laptop). I've also found that switching VTs doesn't always do the trick...

Dan Nicholson said...

Hey Peter,

I've been working on a patch the last couple days that adds a hook in config/hal to offload device add/enable to somewhere else (xf86Config). It can then check if there's an associated xorg.conf entry and handle it on its own. If not, it just returns to config/hal and things resume as they do now.

I haven't tested yet, but I think it'll work. Question is: would this be acceptable? I think it would be nice to allow configuration to continue in xorg.conf without borking hotplug.

Unknown said...

It can be fixed by porting your config to using hal as described in the article.
For every option in xorg.conf you add an input.x11_options in the proper fdi.
You can copy the distribution provided fdi (on fedora /usr/share/hal/fdi/policy/20thirdparty/10-linuxwacom.fdi) to /etc/hal/fdi/policy and make your cofigurations there.

(see an example for synaptics here: http://tkjacobsen.wordpress.com/2008/12/04/configuring-xorg-via-hal/)

Höchste Zeit said...

Thanks for the remark regarding several keyboards and mice. I share a multiseat setup at home with my wife and it saves us a lot of place, energy and configuration efforts (think: data shared).

BTW, I use bluetooth keyboards and mice.

Gtx, Mark

nobrowser said...

@krisztian: except that it is not true. i still have server 7.3, no hal and multiple mice and keyboards are there. It's not perfect because you can't have a separate xkb setup for each keyboard, but it is serviceable.