From owner-freebsd-x11@freebsd.org Fri Oct 2 02:09:33 2015 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B8D1A0EC6A for ; Fri, 2 Oct 2015 02:09:33 +0000 (UTC) (envelope-from isoa@kapsi.fi) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5FAC31966 for ; Fri, 2 Oct 2015 02:09:33 +0000 (UTC) (envelope-from isoa@kapsi.fi) Received: by mailman.ysv.freebsd.org (Postfix) id 5CA47A0EC69; Fri, 2 Oct 2015 02:09:33 +0000 (UTC) Delivered-To: x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2F1A0EC68 for ; Fri, 2 Oct 2015 02:09:33 +0000 (UTC) (envelope-from isoa@kapsi.fi) Received: from mail.kapsi.fi (mx1.kapsi.fi [IPv6:2001:1bc8:1004::1:25]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19DFB1963 for ; Fri, 2 Oct 2015 02:09:32 +0000 (UTC) (envelope-from isoa@kapsi.fi) Received: from 91-159-15-56.elisa-laajakaista.fi ([91.159.15.56] helo=[192.168.255.112]) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Zhpmr-0006Ns-62; Fri, 02 Oct 2015 05:09:29 +0300 Subject: Re: X.org devd hotplug backend ignoring uhid devices, prevents using gamepads with X.org To: Jan Beich References: <560C3890.7020004@kapsi.fi> Cc: x11@freebsd.org From: Arto Pekkanen X-Enigmail-Draft-Status: N1110 Message-ID: <560DE74D.7020409@kapsi.fi> Date: Fri, 2 Oct 2015 05:09:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jJ8fSDWuN0vmrvoo6jkqXSboPF4GnOLeU" X-SA-Exim-Connect-IP: 91.159.15.56 X-SA-Exim-Mail-From: isoa@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2015 02:09:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jJ8fSDWuN0vmrvoo6jkqXSboPF4GnOLeU Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2.10.2015 2:02, Jan Beich wrote: > Arto Pekkanen writes: >=20 >> Section "InputClass" >> Identifier "Game Controller" >> Driver "joystick" >> Option "MatchIsJoystick" "on" >=20 > MatchIsJoystick only works on devices that are assigned ATTR_JOYSTICK. > config/devd currently only does so for joy(4) devices but not uhid(4) a= s > the latter isn't specific to joysticks. The proper detection may requir= e > teaching it to speak usbhid(3) but for now see inlined patch at the end= =2E >=20 > MatchIsJoystick is specified just like the following line. It isn't an > option passed to a X11 driver. Thank you very much for the reply! Okay, I had a minor malfunction there. MatchIsJoystick should not be an o= ption, true that. I will patch xorg-server and rebuild & install, see if it helps. Also, the patch you provided was really helpful for me to learn about whe= re all the important bits of code reside. I've not looked at the devd bac= kend code yet, but I suppose learning how it works would be for the bette= r. Well, supposing I have enough talent to understand the code. We shall = see. >> MatchDevicePath "/dev/uhid*" >=20 > config/devd is a bit too pessimistic. Any device not in hw_types table > seems to be ignored by default, so MatchDevicePath may not be applied. > For one, config/udev only ignores non-ID_INPUT devices which translates= > for USB into intclass=3D0x03 in devd(8). Hmm, so my conclusion was at least partially correct. Very well. >> EndSection > [...] >> 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. >=20 > FWIW, emulators/joytran maybe more useful for Wine unless all your game= s > have the same keybindings. Good for you to mention, I do know of emulators/joytran. I've used that i= n Linuxen to get emulators and similar software working properly. Some (a= ctually, too many) programs have horribly buggy or lacking hid subsystems= , and only keyboard input works properly. But in my case there are certain (Windows) games that have very specific = control schemes that practically require a game pad with two analog stick= s. So I shall try if I can get the game pad to attach into X input layer.= > Index: x11-servers/xorg-server/files/patch-config_devd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- x11-servers/xorg-server/files/patch-config_devd.c (revision 398150)= > +++ x11-servers/xorg-server/files/patch-config_devd.c (working copy) > @@ -1,6 +1,6 @@ > --- config/devd.c.orig 2015-05-19 19:41:49 UTC > +++ config/devd.c > -@@ -0,0 +1,531 @@ > +@@ -0,0 +1,533 @@ > +/* > + * Copyright (c) 2012 Baptiste Daroussin > + * Copyright (c) 2013, 2014 Alex Kozlov > @@ -80,9 +80,11 @@ > + { "ums", ATTR_POINTER, "mouse" }, > + { "psm", ATTR_POINTER, "mouse" }, > + { "vboxguest", ATTR_POINTER, "vboxmouse" }, > -+ { "joy", ATTR_JOYSTICK, NULL }, > -+ { "atp", ATTR_TOUCHPAD, NULL }, > -+ { "uep", ATTR_TOUCHSCREEN, NULL }, > ++ { "joy", ATTR_JOYSTICK, "void" }, > ++ /* XXX joystick is more useful than void by default */=20 > ++ { "uhid", ATTR_JOYSTICK, "joystick" }, > ++ { "atp", ATTR_TOUCHPAD, "mouse" }, > ++ { "uep", ATTR_TOUCHSCREEN, "egalax" }, > + { NULL, -1, NULL }, > +}; > + >=20 Thank you very much for the patch, I will try this as soon as I wake up f= rom sleep and get my brain functioning again. --jJ8fSDWuN0vmrvoo6jkqXSboPF4GnOLeU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (MingW32) iF4EAREIAAYFAlYN51QACgkQTBivhqtJa25F5gD+JbgmAEZ85W8H067ZYZyvyRxV 25jYhNCIjV6GjSodp3gBAMIfOQDrxF6oLT23JY25vU5SSacw9XmTmneaOAkwi1uE =j2Jr -----END PGP SIGNATURE----- --jJ8fSDWuN0vmrvoo6jkqXSboPF4GnOLeU--