From owner-freebsd-x11@FreeBSD.ORG Fri Jun 20 11:30:23 2014 Return-Path: Delivered-To: x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A786E9E for ; Fri, 20 Jun 2014 11:30:23 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85B8024F7 for ; Fri, 20 Jun 2014 11:30:22 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id bs8so625134wib.3 for ; Fri, 20 Jun 2014 04:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=JdYwxzcI29sDeHM7ezJiiPZbHQ4jIPtwZPtaWfzLMPQ=; b=sirUc33JIJ4w3uJue58+DaFTicBlUPhJyiSIQxn3EuIMjYo1wHWUIKbqUKuRtEbhnr /KwXu6F9UAsnR3rr+o0W0u8fTFjOkiijRO9LAj0gve8+ai1br7r3YxtzOiOT+CzW4M86 0el53f1aUOBxDVxfufRjXtByKTFjHEi7qZs8uSRBIA+uepLfkBg2c6Bztd3Eytz112hc iPqHdabS7M+HaS5OrccGCw3HdwxA5+k73uE9RXaOj6jJfHmKDjxe2hUXneVrFZuB04Ix uwiarH+ZCEz7/liG+q46neVGxi0Ge7sRWZ+7uWM+Uo9RvsdEEA9hPCtIg+lUqpeXeZar wK2g== X-Received: by 10.194.23.135 with SMTP id m7mr3723625wjf.2.1403263820561; Fri, 20 Jun 2014 04:30:20 -0700 (PDT) Received: from [192.168.1.197] (xdsl-205-163.nblnetworks.fi. [83.145.205.163]) by mx.google.com with ESMTPSA id m1sm3906881wib.20.2014.06.20.04.30.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Jun 2014 04:30:19 -0700 (PDT) Message-ID: <53A41B08.1080304@gmail.com> Date: Fri, 20 Jun 2014 14:29:12 +0300 From: Jukka Ukkonen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Kevin Oberman Subject: Re: Xorg 7.7 suddenly lost the keyboard References: <53A03A3F.9000503@gmail.com> <53A15FD1.6040206@gmail.com> <53A4013A.2090904@gmail.com> In-Reply-To: <53A4013A.2090904@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "freebsd-x11@freebsd.org" X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jun 2014 11:30:23 -0000 On 2014-06-20 12:39, Jukka Ukkonen wrote: > On 2014-06-19 23:26, Kevin Oberman wrote: >> On Wed, Jun 18, 2014 at 2:45 AM, Jukka Ukkonen > > wrote: >> >> >> Hi all, >> I sent the following issue to questions@freebsd.org >> , but it seems there are no ideas >> available there. >> So, in the hope that someone on the list x11@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 > >> To: questions@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@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 > Wow... When I then changed the code snippet above to this... pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); if (pInfo->fd == -1) { xf86Msg(X_ERROR, "%s: cannot open \"%s\" (%s)\n", pInfo->name, s, strerror (errno)); free(s); return FALSE; } what did I find in the Xorg.0.log... [ 1708.047] (II) Using input driver 'kbd' for 'Keyboard0' [ 1708.047] (**) Option "CoreKeyboard" [ 1708.047] (**) Keyboard0: always reports core events [ 1708.047] (**) Keyboard0: always reports core events [ 1708.047] (**) Option "Protocol" "standard" [ 1708.047] (**) Option "Device" "/dev/kbdmux0" [ 1708.047] (EE) Keyboard0: cannot open "/dev/kbdmux0" (*Device busy*) [ 1708.047] (EE) PreInit returned 8 for "Keyboard0" [ 1708.047] (II) UnloadModule: "kbd" After terminating the X session and returning to plain vt command line I tried running lsof to figure out whether some program was holding any kbd devices open. Nope! This is obviously some sort of timing issue / race condition such that something else opens /dev/kbdmux0 slightly before X tries to open it and while holding the handle open for a while manages to block X from opening kbdmux. At the moment I already know that neither hald nor dbus are likely culprits because disabling them did not make the keyboard available to X. Could gnome-settings-daemon try to do something to the keyboard? --jau