X.org devd hotplug backend ignoring uhid devices, prevents using gamepads with X.org

Arto Pekkanen isoa at kapsi.fi
Wed Sep 30 19:32:02 UTC 2015


I have an XBox 360 controller that is attached as /dev/uhid0 by the kernel. 

I have also declared a catch-all InputClass for hid devices in order to have X.org use gamepads automatically:
-- file: /usr/local/etc/X11/xorg.conf.d/30-joystick.conf
Section "InputClass"
	Identifier "Game Controller"
	Driver "joystick"
	Option "MatchIsJoystick" "on"
	MatchDevicePath "/dev/uhid*"
EndSection

The above was derived from the man page of joystick(4x). As I understood, here's how it works:
- when X.org get notified about a /dev/uhid* device, it would dispatch the device to joystick(4x) (package: x11-drivers/xf86-input-joystick)
- joystick(4x) would then test if the device is a hid joystick or not
- if the device was a joystick, joystick(4x) would attach it to X.org as input device, after which X11 applications could use it
- by default the joystick directional input would double as main pointer input, but that can be disabled with spesific options in InputClass

However, this simply doesn't work, because the X.org devd backend ignores all uhid devices. When I connect my gamepad, logfile Xorg.0.log outputs the following:
[(timestamp)] (II) config/devd: ignoring device uhid0

This means that my the InputClass definition is never matched, and joystick(4x) is never attached to uhid0. Thus I can't get the gamepad to work with X.org.

I would like to get my gamepad working as a genuine X11 input device, preferably hot pluggable. There are plenty applications that support the X11 input layer and can use gamepads and other widgets. One such application that comes to mind is Wine. 

And yes, I do know there is uhidd(8) installable via pkg, and I could use it as a replacement for X.org input layer. uhidd(8) enables specific per-device configuration, similarly to the X.org InputClass. And some applications (NOT all) can be forced to use the raw /dev/uhidX device. I know all that, and could do it. I just think that the correct way of using hid devices in X.org context would be to use then via X11 input layer.

Is there a way to force the X.org devd backend to not ignore uhid devices and have them configured as per InputClass definitions? If not, are there any plans to incorporate a reliable uhid configuration function to the devd backend?

And finally, how would I get my gamepad to work as X.org input device?

-- 
Arto Pekkanen, säätäjä
ksym at IRCnet

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-x11/attachments/20150930/ba2781b3/attachment.bin>


More information about the freebsd-x11 mailing list