Xorg 7.7 suddenly lost the keyboard

Jukka Ukkonen jau789 at gmail.com
Fri Jun 20 09:39:05 UTC 2014


On 2014-06-19 23:26, Kevin Oberman wrote:
> On Wed, Jun 18, 2014 at 2:45 AM, Jukka Ukkonen <jau789 at gmail.com 
> <mailto:jau789 at gmail.com>> wrote:
>
>
>     Hi all,
>     I sent the following issue to questions at freebsd.org
>     <mailto:questions at freebsd.org>, but it seems there are no ideas
>     available there.
>     So, in the hope that someone on the list x11 at freebsd.org
>     <mailto:x11 at freebsd.org> might have some idea what has happened,
>     I send the same issue to this mailing list as well.
>     It would be really nice to get my keyboard working with x11/xorg
>     again.
>
>     --jau
>
>
>
>     -------- Original Message --------
>     Subject:        Re: Xorg 7.7 suddenly lost the keyboard
>     Date:   Tue, 17 Jun 2014 15:53:19 +0300
>     From:   Jukka Ukkonen <jau789 at gmail.com <mailto:jau789 at gmail.com>>
>     To: questions at freebsd.org <mailto:questions at freebsd.org>
>
>
>
>     After digging a bit deeper in the issue the most revealing symptom is
>     this error in /var/log/Xorg.0.log...
>
>     [   585.774] (II) Using input driver 'kbd' for 'Keyboard0'
>     [   585.774] (**) Option "CoreKeyboard"
>     [   585.774] (**) Keyboard0: always reports core events
>     [   585.774] (**) Keyboard0: always reports core events
>     [   585.774] (**) Option "Protocol" "standard"
>     [   585.774] (**) Option "Device" "/dev/kbdmux0"
>     [   585.774] (EE) Keyboard0: cannot open "/dev/kbdmux0"
>     [   585.774] (EE) PreInit returned 8 for "Keyboard0"
>     [   585.774] (II) UnloadModule: "kbd"
>
>     That "PreInit" is apparently kbdPreInit() and the returned code 8
>     stands
>     for BadMatch.
>
>     What should I make of this?
>
>     --jau
>
>
>     On 2014-06-15 17:32, Jukka Ukkonen wrote:
>
>
>         Hello everybody,
>
>         I recently had a very peculiar experience with Xorg 7.7 on an
>         amd64
>         system running FreeBSD 10-stable.
>         Suddenly any and all X11 applications lost the keyboard. When
>         using
>         vanilla vt only the same keyboard
>         works just fine.
>         I guess this happened after I had updated the ports tree using
>         svn and
>         run "portupgrade --batch -y -a".
>         Does anyone have any idea what might be the root cause and how
>         to get
>         around this.
>         Previously I have been using HAL configured devices with Xorg. Now
>         even explicitly forcing the automatic
>         device detection off did not bring the keyboard back. Rebuilding
>         xorg-server to use devd instead of HAL
>         did not help either. So, I am confused. Any ideas what to try?
>
>         Cheers,
>         --jau
>
>
> Just a few shots in the dark...
> Does /dev/kbdmux exist? Did it get dropped from your kernel? Did you 
> fail to load it? Did your /boot/loader.conf file change?
>
> How did you change Xorg.conf? Looks like it is trying the right thing 
> and jut not finding the device.
> -- 
> R. Kevin Oberman, Network Engineer, Retired
> E-mail: rkoberman at gmail.com <mailto:rkoberman at gmail.com>

Indeed it looks like X fails to open the device.
The device entries are there as expected, though.

crw-------  1 root  wheel  0x3d Jun 20 11:07 /dev/atkbd0
lrwxr-xr-x  1 root  wheel     6 Jun 20 11:07 /dev/kbd0 -> atkbd0
lrwxr-xr-x  1 root  wheel     7 Jun 20 11:07 /dev/kbd1 -> kbdmux0
lrwxr-xr-x  1 root  wheel     5 Jun 20 11:07 /dev/kbd2 -> ukbd0
crw-------  1 root  wheel  0x1b Jun 20 11:07 /dev/kbdmux0
crw-------  1 root  wheel  0x75 Jun 20 11:07 /dev/ukbd0

The only thing I have changed in xorg.conf has been AutoAddDevices
on and off, and even that only when the keyboard was already lost in
an attempt to test whether hald was somehow out of its mind.
Otherwise xorg.conf is as it was before the keyboard was lost.

It seems that BadMatch could only be triggered inside OpenKeyboard() in
x11-drivers/xf86-input-keyboard/work/xf86-input-keyboard-1.8.0/src/bsd_kbd.c

Apparently the message "cannot open ..." originates from this
code snippet...

     424         pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
     425         if (pInfo->fd == -1) {
     426            xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", 
pInfo->name, s);
     427            free(s);
     428            return FALSE;
     429         }

It would be useful to have those xf86Msg() calls also report
something like strerror(errno) when something goes wrong.
Without any further info one can only guess what might be
the true reason for failures. At the moment I can only imagine
there might be another program like hald holding the keyboard
device open still when X tries to open it.

--jau



More information about the freebsd-x11 mailing list