Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 2013 14:20:13 +0200
From:      =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= <dumbbell@FreeBSD.org>
To:        Vitaly Magerya <vmagerya@gmail.com>
Cc:        x11@FreeBSD.org
Subject:   Re: X.Org devd backend for input devices
Message-ID:  <52399A7D.6070106@FreeBSD.org>
In-Reply-To: <5238EF64.8080602@gmail.com>
References:  <522DC3EB.4060607@freebsd.org> <522DE093.9080504@freebsd.org> <5236C259.3020100@gmail.com> <20130916090354.GW33103@ithaqua.etoilebsd.net> <5236F136.5030905@gmail.com> <5238B133.70707@FreeBSD.org> <5238EF64.8080602@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2PTQTJDKNUKTOUDITPKKV
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 18.09.2013 02:10, Vitaly Magerya wrote:
> In short no, as far as I know, if you want your mice and keyboard
> to work in both the console and X, X will have to work with
> sysmouse/syscons aggregators, and not try to grab each device
> separately. That is not good enough in your use case, right?

I'm not talking about my particular case; I only have a laptop with
builtin keyboard and USB mouse. For any user, that would be nice to
finally be able to plug multiple keyboards and mices with a specific
configuration for each of them.

> And just to clarify: HAL doesn't have any magic to fix that
> either, correct? I.e. if you're running moused, X will only see
> one combined mouse device (syscons), not separate ones.

Yes. Same for keyboards. In fact, hal doesn't do much on FreeBSD. When
it "adds" a device in Xorg, it doesn't give the path to the device,
therefore, X.Org doesn't even try to open it. It gives the illusion
everything works without declaring any inputs in xorg.conf, because the
muxers behind (kbdmux and moused) do open the devices.

>> We could achieve a similar behavior by detaching keyboards from kbdmux=
=20
>> and stopping all moused when Xorg starts (eg. do it from=20
>> config_devd_init()) and reattaching keyboards and starting moused agai=
n=20
>> when Xorg exits (config_devd_fini()).
>=20
> That seems prone to failure; if Xorg segfaults, will moused stay down?
> This needs further investigation.

You're right, that's not good. We would need an event sent when a
vt-switch occurs, which we can use to make the console grab/release
input devices. I don't know if we have something like that currently.

>> Regarding the restart of devd, I don't think there's an issue here,=20
>> because backends should check if an input device is already present in=
=20
>> X.Org before adding it again. There's no need to maintain a regular fi=
le.
>=20
> I'm not sure we're on the same page here, but this point can be
> discussed later.

You mean you would prefer to not check against duplicate input devices
in X.Org and that the script never sends an "add" event if an identical
event was previouly delivered?

>>>> The open problems here are:
>>>> 1) what should happen if multiple X instances are running?
>> The problem is the same than with X+console. If X #1 closes the device=
s=20
>> when vt-switching and X #2 reopens them, then it's fine. [...]
>> This too needs more research and study of udev backend.

What I suppose is that when two X.Org servers are running, both receive
all add/remove events and the udev backends both add/remove the device.
However, just like when vt-switching, only the master tries to open it.
The non-master servers will wait to become master again before
(re)opening devices. Again, that's just a supposition, I can't verify
that at the moment but will do that, once at home.

--=20
Jean-S=C3=A9bastien P=C3=A9dron


------enig2PTQTJDKNUKTOUDITPKKV
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.21 (FreeBSD)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlI5mocACgkQa+xGJsFYOlPlgwCfUlBYPDO0RiJWfPkBIZqE7TQQ
2D4AoIAWlKBMrtPoOld9oM/2Tfvr+qvZ
=RYuc
-----END PGP SIGNATURE-----

------enig2PTQTJDKNUKTOUDITPKKV--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52399A7D.6070106>