Bug 483232

Summary: autorepeating or dead keyboard
Product: [openSUSE] openSUSE 11.1 Reporter: macias - <bluedzins>
Component: X.OrgAssignee: Matthias Hopf <mhopf>
Status: RESOLVED WONTFIX QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Critical    
Priority: P4 - Low CC: jkosina, mjambor, msvec, nordhaus, sndirsch, spiffytech, tiwai
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: dmidecode
devices
log.txt
evtest with dead keyboard: Pressed "x" multiple times in the GUI
ps -ax

Description macias - 2009-03-08 11:05:53 UTC
First I thought this problem is just continuation of:
https://bugzilla.novell.com/show_bug.cgi?id=334676

But it is not, it is very similar but since there are some other symptoms I believe it is not a duplicate.

E6500, opensuse 11.1 64 bit. I worked with it for about two month without this issue till update of kernel or update of alsa-driver-kmp-default. I believe one of them is the culprit:
alsa-driver-kmp-default-1.0.19.20090306_2.6.27.19_3.2-1.1
kernel-default-2.6.27.19-3.2.1

Symptoms:
a) after a while keyboard is dead, none of the keys responds, to activate keyboard again I have to logout, and log in again (start new session), because if I start a new session without logging out, and then switch back, the keyboard is still dead
b) from time to time each keystroke is counted as 5, 10, or 30 (random value)

There is no way to tell when it occurs and that is why (b) is critical -- I just lost around 40 mails, just because I hit del once and it was counted as 40.

Note: this is not about hardware malfunctioning or stuck (physical) keys in pressed state.
Comment 1 macias - 2009-03-08 11:12:05 UTC
ad.a) ... in the older session, in the newly created keyboard works. It happened to me that it died three times in a row.
Comment 2 Stefan Dirsch 2009-03-08 11:19:57 UTC
Looks like a sound driver issue to me.
Comment 3 macias - 2009-03-08 12:35:27 UTC
Small correction, sorry, I _updated_ kernel but _installed_ this alsa driver (it wasn't installed through those two months at all).
Comment 4 Takashi Iwai 2009-03-09 15:25:40 UTC
You can check the influence of alsa-driver-kmp simply by uninstalling the package.  Check whether the problem still persists.
Comment 5 macias - 2009-03-09 15:35:13 UTC
It is not that easy, because I would need information what to downgrade in order to get sound just like after installation. As you know with the latest updates to get sound this package is required -- and the problem with keys happen but not that often that I could have no sound in the system.

I hope you understand my concern.
Comment 6 Takashi Iwai 2009-03-09 15:46:52 UTC
I understand, but the sound isn't basically unnecessary to reproduce the keyboard problem, right?  Just use without sound for a while to check whether the keyboard problem appears...

Or, you can try the latest kernel from
    ftp://ftp.suse.com/pub/people/tiwai/sled11-post-gmc/
This includes many pending sound fixes, and should work with your machine without alsa-driver-kmp.  Give it a try.
Comment 7 macias - 2009-03-09 19:30:12 UTC
> Just use without sound for a while 

The issue is -- a while :-). Positive test can take a second, but negative has no limit (by definition). And I need sound for notifications. I give it a try to Wednesday, I hope it is sufficient for you?
Comment 8 macias - 2009-03-11 13:40:44 UTC
Ok, I don't have alsa driver now installed and I encountered this problem again.
Comment 9 macias - 2009-03-11 16:30:08 UTC
I think this issue with keyboards are two problem, because what I wrote in #8 it was autorepeating -- and it happened with alsa drive not installed.

BUT -- the dead keyboard occurred _only_ with alsa driver. For example, I was testing system without this driver for 2 days, nothing happened, I installed it, and after restart in 10 minutes keyboard died twice. I doubt it is just coincidence. Very similar thing happend after I tried alsa driver for the same time, 3 times in a row just after installation. 

Should I open another report, or would it be better to fix the dead keyboard and see then if autorepeating will occur?
Comment 10 macias - 2009-03-13 18:35:17 UTC
I am using this new kernel for a few days, thank you Takashi, no problem with dead keyboard but autorepeating still occurs.
Comment 11 macias - 2009-03-14 07:23:01 UTC
Update: with kernel from #6, the disabling keyboard also happens.
Comment 12 macias - 2009-04-15 14:46:32 UTC
linux-kernel-headers-2.6.27-2.28
kernel-default-extra-2.6.27.21-0.1.2
kernel-source-2.6.27.21-0.1.1
kernel-default-base-2.6.27.21-0.1.2
kernel-default-2.6.27.21-0.1.2

still happens.
Comment 13 Takashi Iwai 2009-04-16 10:08:54 UTC
Hmm, weird.

Jiri, could you take a look?  I suspect it's rather the problem of input stuff...
Comment 14 Jiri Kosina 2009-04-21 13:47:14 UTC
Is this USB or PS/2 connected keyboard?

Could you please

- post a dmidecode output from the machine
- capture both evtest and xev output on the keyboard device from the situation when the key is stuck, to see if it is X or kernel who loses the release event
Comment 15 macias - 2009-04-21 14:00:01 UTC
It is internal laptop keyboard.

> - capture both evtest and xev output on the keyboard device from
> the situation when the key is stuck, to see if it is X or kernel
> who loses the release event

I don't think we understand each other. First of all what does "when" means here?

Second -- by "stuck" I guess you mean autorepeating case. Such case looks like this, I press a, b, c keys. I get

abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc

And for next several hours everything can be fine. So in practice I can do only tests _after_ autorepeating occurs. And after additional keys pressed -- because I cannot predict when it happens, and since I am fast typist I type faster than I track the output.
Comment 16 Jiri Kosina 2009-04-21 14:14:22 UTC
(In reply to comment #15)
> It is internal laptop keyboard.

So probably conntected through PS/2, right? (you can find out from dmesg or hwinfo --keyboard, for example).

> > - capture both evtest and xev output on the keyboard device from
> > the situation when the key is stuck, to see if it is X or kernel
> > who loses the release event
> 
> I don't think we understand each other. First of all what does "when" means
> here?
> 
> Second -- by "stuck" I guess you mean autorepeating case. Such case looks like
> this, I press a, b, c keys. I get
> 
> abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc
> 
> And for next several hours everything can be fine. So in practice I can do only
> tests _after_ autorepeating occurs. And after additional keys pressed --
> because I cannot predict when it happens, and since I am fast typist I type
> faster than I track the output.

Would id be possible to keep capturing evtest traffic all the time, and when you experience this loss of release event (i.e. wrong autorepeat of the key), extract the relevant part from the saved evtest output and attach it to this bug? Thanks.
Comment 17 macias - 2009-04-21 14:15:39 UTC
Created attachment 287139 [details]
dmidecode
Comment 18 macias - 2009-04-21 14:25:59 UTC
> So probably conntected through PS/2, right? (you can find out from
> dmesg or hwinfo --keyboard, for example).

I see a lot of "usb" occurrences so it is rather USB.

> Would id be possible to keep capturing evtest traffic all the time,
> and when you experience this loss of release event (i.e. wrong
> autorepeat of the key), extract the relevant part from the saved
> evtest output and attach it to this bug? Thanks.

No problem, but this program does not output anything dynamic.

evtest /dev/input/by-id/usb-413c_8157-event-kbd

And I get just a list of recognized events.
Comment 19 Jiri Kosina 2009-04-21 14:35:22 UTC
(In reply to comment #18)
> > Would id be possible to keep capturing evtest traffic all the time,
> > and when you experience this loss of release event (i.e. wrong
> > autorepeat of the key), extract the relevant part from the saved
> > evtest output and attach it to this bug? Thanks.
> No problem, but this program does not output anything dynamic.
> evtest /dev/input/by-id/usb-413c_8157-event-kbd
> And I get just a list of recognized events.

Could you please attach output of

cat /proc/bus/input/devices
ls -l /dev/input/by-id/
ls -l /dev/input/by-path
Comment 20 macias - 2009-04-21 15:09:34 UTC
ls -l /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 2009-04-19 18:07 usb-413c_8157-event-kbd -> ../event3


ls -l /dev/input/by-path
total 0
lrwxrwxrwx 1 root root  9 2009-04-19 18:07 pci-0000:00:1a.0-usb-0:1.1:1.0-event-kbd -> ../event3
lrwxrwxrwx 1 root root 10 2009-04-19 18:07 pci-0000:00:1a.7-usb-0:6:1.0-event- -> ../event11
lrwxrwxrwx 1 root root 10 2009-04-19 18:07 pci-0000:00:1b.0-event- -> ../event12
lrwxrwxrwx 1 root root  9 2009-04-19 18:07 platform-i8042-serio-0-event-kbd -> ../event0
lrwxrwxrwx 1 root root  9 2009-04-19 18:07 platform-i8042-serio-1-event-mouse -> ../event1
lrwxrwxrwx 1 root root  9 2009-04-19 18:07 platform-i8042-serio-1-mouse -> ../mouse1
lrwxrwxrwx 1 root root  9 2009-04-19 18:07 platform-pcspkr-event-spkr -> ../event9
Comment 21 macias - 2009-04-21 15:11:03 UTC
Created attachment 287173 [details]
devices
Comment 22 Jiri Kosina 2009-04-21 15:17:46 UTC
You have some USB HID device under event3, but it is probably not the integrated keyboard. When you run evtest on /dev/input/event0, do you see they keypress/key release events?
Comment 23 macias - 2009-04-21 15:53:45 UTC
Yes I see them, ok so I will try to run it all the time.
Comment 24 Jiri Kosina 2009-04-21 15:56:43 UTC
Thanks. Then please provide only the relevant part with the key that got autorepeated incorrectly, plus a few surrounding keys, not the whole dump (it will be too big, and I would also be able to see everything you have typed).
Comment 25 macias - 2009-04-24 09:55:18 UTC
Ok, I got one nice -- one keystroke, several characters "typed". But I need a little help -- I pressed those keys:
p
d
f
<space>
<ctrl+c> <--- ending logging

How do I read them from the log so I could cut out only the important stuff and delete the rest?
Comment 26 Jiri Kosina 2009-05-06 09:26:17 UTC
(In reply to comment #25)
> Ok, I got one nice -- one keystroke, several characters "typed". But I need a
> little help -- I pressed those keys:
> p
> d
> f
> <space>
> <ctrl+c> <--- ending logging
> 
> How do I read them from the log so I could cut out only the important stuff and
> delete the rest?

They should be at the very end of the log. Sequence "pdf<space>" should look similarly to

type 4 (Misc), code 4 (ScanCode), value 70013
type 1 (Key), code 25 (P), value 1
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 70013
type 1 (Key), code 25 (P), value 0
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 70007
type 1 (Key), code 32 (D), value 1
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 70007
type 1 (Key), code 32 (D), value 0
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 70009
type 1 (Key), code 33 (F), value 1
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 70009
type 1 (Key), code 33 (F), value 0
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 7002c
type 1 (Key), code 57 (Space), value 1
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 7002c
type 1 (Key), code 57 (Space), value 0
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 700e0
type 1 (Key), code 29 (LeftControl), value 1
-------------- Report Sync ------------
type 4 (Misc), code 4 (ScanCode), value 70006
type 1 (Key), code 46 (C), value 1
-------------- Report Sync ------------
Comment 27 macias - 2009-05-06 11:20:05 UTC
Ah, I see now where the problem is. Look, I turned on logging, right, so every key I press is logged in. The problem is that the whole sequence was

forall<space>pdf<space><ctrl+c>

but in log I only see this:

foral

even the second "l" is missing. So how to perform logging, that saving keys would be instant, without caching anything. Or, another approach -- that on ctrl+c buffer will be flushed.
Comment 28 Jiri Kosina 2009-05-06 11:27:58 UTC
Might be autorepeat triggering in. Please attach the log.
Comment 29 macias - 2009-05-06 12:15:59 UTC
Created attachment 290391 [details]
log.txt
Comment 30 macias - 2009-05-16 06:29:46 UTC
Adding some info about dead keyboard -- if keyboard dies, it is possible to log out, and log in again, for some time the keyboard is functional (and then dies again). I noticed that no matter how many times you log out and log in it is impossible to "escape" from dying keyboard. It looks like entire start of the system is somehow flawed, so the only way to be able to do the work, is to shutdown the entire system, start it again and hope this time keyboard won't be dying.
Comment 31 Jiri Kosina 2009-05-20 14:11:31 UTC
Does the problem also appear or console, or does it happen solely inside X session?
Comment 32 macias - 2009-05-20 15:31:29 UTC
I cannot tell because I don't use console at all.

I don't want to point in the wrong direction but I think there is correlation between win+tab which I use for app switch and dead keyboard. Usually I found out the keyboard died when trying to switch app.
Comment 33 Jiri Kosina 2009-06-08 15:21:08 UTC
Do you have the possibility to ssh into that machine when the keyboard in X dies? If so, are you able to run evtest to /dev/input/event? to see whether kernel is providing the keyboard data, only X loses them? Thanks.
Comment 34 macias - 2009-06-08 15:54:37 UTC
Could you please check the steps:

1) open another X session
2) run ssh server (in new X keyboard works)
3) switch back to the X session with dead keyboard
4) login via ssh
5) run evtest via ssh 
6) get back to my machine, and press keys
7) check the output on remote machine

Is this correct?
Comment 35 Stefan Nordhausen 2009-06-10 13:01:58 UTC
Hi!

I have the same problems, also with openSuse 11.1 on 64 bit hardware. Patches are up to date, I am using KDE 3.5.

Concerning comment 32: I also think that the dead keyboard is related to app switching. I was just able to reproduce it by massive app switching (~50 times, I use ALT+TAB, though).

I am pretty sure that the kernel is not at fault here, but it must be some GUI problem because when the keyboard is dead
- I cannot set a cursor into any text box (e.g. the browser's address bar), I also cannot select text with the mouse.
- I can switch to console with CTRL+ALT+F1.
- Most weird: If I try to close Firefox it asks me if I am sure, because I have many open tabs. After that, keyboard works again!!!

Particularly the last point is very interesting IMHO. I will attach the output of "evtest /dev/input/even0" as requested in comment 33. This was started in a console shell after I reproduced the problem. I switched back to X and pressed the "x" key multiple times, then back to console to terminate evtest.
Comment 36 Stefan Nordhausen 2009-06-10 13:03:28 UTC
Created attachment 297186 [details]
evtest with dead keyboard: Pressed "x" multiple times in the GUI
Comment 37 macias - 2009-06-10 15:01:39 UTC
Stefan, I will try to reproduce the effects you see, but one observation from my computer. I run amule which uses wxGTK toolkit. I noticed correlation with dead keyboard and RMB in amule. 

When the keyboard is dead RMB does not work in amule. When keyboard is not dead, and RMB does not work in amule, it means keyboard will die soon. Odd...
Comment 38 Brian Cottingham 2009-06-15 17:23:14 UTC
I'm having these same symptoms. The keyboard dying seems to be tied to the Alt key. If I hold down the Alt key and mash on the left side of the keyboard for a while, the problem fixes itself.
Comment 39 macias - 2009-06-15 19:16:59 UTC
@Stefan, I tried the trick with FF, it does not work for me.

@Brian, alt in sense of task-switch? If yes, it is not alt in general, I use win+tab, and alt only rarely. I'll try the fix anyway. What DE do you use? Me -- KDE3.5.10 + some KDE4 applications.
Comment 40 Brian Cottingham 2009-06-15 19:26:12 UTC
@Maciej, I'm using KDE 4.2, and yes, the keyboard issue is usually in conjunction with alt+tab.
Comment 41 macias - 2009-06-23 09:39:14 UTC
@Brian, I cannot unlock the keyboard using your method.

@Brain and @Stefan -- when keyboard dies, at this moment, do you have any Gtk based application running? (note, that wxGtk uses Gtk as its "native" toolkit, so count such apps too). Me -- yes.

And for autorepeating -- I noticed that when doing have CPU computation and copying large amount of data, this happens all the time. So maybe this autorepeating has something to do with some I/O glitch inside kernel?
Comment 42 Jiri Kosina 2009-06-23 09:51:39 UTC
X.org implement the auto-repeat themselves and do not rely on kernel autorepeat mechanism. If they are not scheduled frequently enough, their autorepeat mechanism gets mad.

I am really suspecting that this is some X/KDE/Gnome bug rather than kernel bug. 
The log from comment #29 clearly shows that kernel properly emits all press and release events. Also the keyboard works properly in other newly started sessions, and restart of X server fixes the problem.

Reassigning to X folks.
Comment 43 Stefan Nordhausen 2009-06-23 10:29:13 UTC
According to rpm, MozillaFirefox requires mozilla-xulrunner190, which in turn requires gtk2. So everyone running Firefox has a GTK app running, right? In this case: Yes, I do have a GTK app running.
If so, even TWM + Firefox should show this behaviour. I will try the I/O stress test (after work).

Talking about load: I must say that either the kernel or the sound system are not doing a good job under load. Sound tends to get choppy when I put a little stress on the system (which should not happen with 4GB RAM, 2.5Ghz dual core). Maybe some component of X was written under the (implicit) assumption that it gets scheduled very regularly, and gets messed up because of poor kernel scheduling.
Comment 44 Stefan Dirsch 2009-06-25 03:52:47 UTC
Sounds like Bug #506494, for which fixed packages are available for testing. If it isn't fixed feel free to reopen this bug, not Bug #506494!

*** This bug has been marked as a duplicate of bug 506494 ***
Comment 45 macias - 2009-07-10 08:44:40 UTC
* dead keyboard occurred
* under I/O stress autorepeating occurred in modest ratio (instead of 1:20, it was 1:3 -- meaning, one keystroke translated into N characters)

Reopening then.

Btw. I didn't test it before, when the keyboard was dead (now), the caps lock led was still switchable using keyboard.
Comment 46 Stefan Dirsch 2009-07-12 20:09:10 UTC
Sure you did install the fixed packages for Bug #506494?
Comment 47 macias - 2009-07-12 20:42:05 UTC
I added the mentioned repo (sle, in the other report) and now I have:
xorg-x11-server-7.4-41.3

It was the newest one available when I was installing it, shortly after your #44 post.
Comment 48 Stefan Dirsch 2009-07-12 20:54:50 UTC
So what's the output of 'rpm --changelog -q xorg-x11-server | head -n 10' ?
Comment 49 macias - 2009-07-13 05:07:49 UTC
* Fri Jun 05 2009 sndirsch@suse.de
- keyrelease-1.5.2.diff
  * xkb: Don't press+release keys on key events. Fixes submission
    of F7 to apps on switch from console for drivers that switch
    fast enough (bnc #141443).

* Tue Jun 02 2009 sndirsch@suse.de
- Frederico's patches to support reprobing of connected displays
  on EnterVT and fixes to set event timestamps properly.
  (bnc #507190)
  * Re-probe RANDR outputs on laptop unsuspend.
  * Make RANDR 'set' timestamps follow client specified time.
  * Add missing fields to SRR*NotifyEvent().

* Fri May 22 2009 sndirsch@suse.de
- commit-525aa17-xkb.diff
  * Bug #6428, #16458, #21464: Fix crash due to uninitialized
    VModMap fields. In ProcXkbGetKbdByName, mrep.firstVModMapKey,
    .nVModMapKeys and .totalVModMapKeys were not initialized,
    contained random values and caused accesses to unallocated and
    later modified memory, causing XkbSizeVirtualModMap and
    XkbWriteVirtualModMap to see different number of nonzero
    values, resulting in writes past the end of an array in
    XkbSendMap. This patch initializes those values sensibly
    and reverts commits 5c0a2088 and 6dd4fc46, which have been
    plain non-sense.
- obsoletes commit-ddb8d89-xkb.diff

More lines, to get the bottom entry.

Today just after starting computer keyboard died again. This time I was running Firefox -- it is hard for me to test if keyboard will die _not_ using any Gtk app because I need them for work.
Comment 50 Stefan Dirsch 2009-07-13 06:46:11 UTC
Can you ssh to the machine, then run 'chvt 1' to switch to Linux console. Does the keyboard work in that Linux console. Does the keyboard work with a new Xsession after killing the X process?
Comment 51 Stefan Dirsch 2009-07-13 06:49:42 UTC
(In reply to comment #49)
> * Fri May 22 2009 sndirsch@suse.de
> - commit-525aa17-xkb.diff
>   * Bug #6428, #16458, #21464: Fix crash due to uninitialized
>     VModMap fields. In ProcXkbGetKbdByName, mrep.firstVModMapKey,
>     .nVModMapKeys and .totalVModMapKeys were not initialized,
>     contained random values and caused accesses to unallocated and
>     later modified memory, causing XkbSizeVirtualModMap and
>     XkbWriteVirtualModMap to see different number of nonzero
>     values, resulting in writes past the end of an array in
>     XkbSendMap. This patch initializes those values sensibly
>     and reverts commits 5c0a2088 and 6dd4fc46, which have been
>     plain non-sense.
> - obsoletes commit-ddb8d89-xkb.diff

Ok. So the fix is in.
Comment 52 macias - 2009-07-13 09:03:30 UTC
Stefan,

a) ssh -- is there a way I can exec command which will switch me to console without using ssh? I tried "chvt 1" from KDE level, it says:
Couldnt get a file descriptor referring to the console

It would be much simpler for me. 


b) X -- what do you mean? I can log out (from KDE) --> KDM --> log in (new session, KDE), keyboard will work. Or I can start new session --> KDM --> log in (KDE), and keyboard will work. IOW: dead keyboard is per X session issue.
Comment 53 Stefan Dirsch 2009-07-13 09:17:08 UTC
(In reply to comment #52)
> a) ssh -- is there a way I can exec command which will switch me to console
> without using ssh? I tried "chvt 1" from KDE level, it says:
> Couldnt get a file descriptor referring to the console
> 
> It would be much simpler for me. 

Didn't you tell me your keyboard is dead. How do you want to type "chvt 1" then?
Confused. BTW, you need to be root to run chvt.

> b) X -- what do you mean? I can log out (from KDE) --> KDM --> log in (new
> session, KDE), keyboard will work. Or I can start new session --> KDM --> log
> in (KDE), and keyboard will work. IOW: dead keyboard is per X session issue.

Just kill the 'X' process in process table. The displaymanager will start a new Xserver.
Comment 54 macias - 2009-07-14 14:01:33 UTC
> Didn't you tell me your keyboard is dead. How do you want to type "chvt 1"
> then?

Why "then"? Bash script, saved now and executed then (using mouse) :-) 

I send info as soon as keyboard will die.
Comment 55 Stefan Dirsch 2009-07-20 00:20:54 UTC
So the issue still didn't occur after a week?
Comment 56 macias - 2009-07-20 05:52:44 UTC
Yes, but I would not expect otherwise -- I started my computer ~4 times, and it didn't happen before as often as once in 4 tries.
Comment 57 Stefan Dirsch 2009-07-21 19:36:16 UTC
Don't get me wrong, but issues you even cannot reproduce yourself easily either, really make no sense for us trying to investigate. Thus closing as WORKSFORME.
Comment 59 macias - 2009-07-21 20:31:53 UTC
Stefan, actually it is hard to not get you wrong :-).

This is difficult case, because it is not obvious for me how to trigger it -- quite contrary with buggy udf mounting or buggy camera mounting, which happens every time. But on the other hand what would you except -- release of opensuse which disables keyboard on every boot? Such bug is actually a theoretical, because (I hope) such "release" would never be released.

This bug appears once per boot -- my computer works long hours and I don't have time (*) to restart it every 15 minutes to trigger the bug, and see if it is this or that driver, this or that app, this or that gtk version. Nowadays systems are complex beasts and it is hard to nail the problem (why bluetooth works on 2 computers, and on the third does not -- go figure, magic).

(*) because I am doing long computations, and I can't stop them randomly to restart computer

So, I am willing to help, but I don't sacrifice my job just for booting all day long. Also hiding bugs under the carpet does not help at all -- even without it OS has problems with quality, but if you add "when I don't look there is no bug" solution, things will get worse.

This bug exists, you know it, and I know it. The fact I can spot if from time to time does not mean it is rare, but it means I boot up computer not too often (i.e. 3 days uptime is a standard now for me).

Enough of late-evening rant :-) I hope you don't read it as offensive or something like that.
Comment 60 macias - 2009-07-25 06:23:37 UTC
Once I noticed in amule I cannot get context menu (RMB does not work) I knew in a second keyboard will be dead. And it was.

I cannot still figure out if amule (wxGTK) is the cause of keyboard dying or the side effect (another input device is not working).

Anyway, after switching to console keyboard works (in console), after restarting X keyboard works. So keyboard dying (as previously said) is per X session issue. You could have (theoretically) sessions
1, 2, 3, 4, 5

with keyboard still working for 1 and 2, and dead for sessions 3-5.

Now I work on X session which was auto-restarted after killing previous one. "Normally" when I just logoff, login (new session) keyboard was dead in 15 minutes again. I will see if this is an issue with total X restart.
Comment 61 macias - 2009-07-25 06:54:54 UTC
I died again, as "usual". Another observation -- amule does not quit cleanly when this bug occurs (I started it again after keyboard died, to see if RMB worked -- it didn't).
Comment 62 Stefan Dirsch 2009-07-25 08:22:39 UTC
amule appears to be a packman package, you compiled it yourself or you found a package on a different source. SUSE/Novell doesn't ship such a package nor could I find it on our buildservice.

==> MINOR/P4
Comment 63 macias - 2009-07-25 08:36:54 UTC
Stefan, is my English really that bad? Comment above I stated I _didn't_ run amule while waiting for keyboard to die -- and keyboard died. So amule is not the cause for sure, it is affected, but it not the cause.

Please, don't try to diminish the importance or relevance of this report. It is not good nor polite behaviour -- you wanted the details, I am giving all the details I can find, but to _solve_ this issue.

I am able to reproduce this bug (not for long) what should I do now?
Comment 64 Stefan Dirsch 2009-07-25 09:42:02 UTC
The way you stated above I needed to misunderstand you:

> Once I noticed in amule I cannot get context menu (RMB does not work) I knew in
> a second keyboard will be dead. And it was.

Run amule --> try to use context menu ==> keyboard dead!

Since we can't reproduce the issue, and you obviously never accept WORKSFORME
for such situations, this issue will remain open until it gets fixed upstream (by accident).
Comment 65 macias - 2009-07-25 12:14:02 UTC
> The way you stated above I needed to misunderstand you:
> > Once I noticed in amule I cannot get context menu (RMB does not
> > work) I knew in a second keyboard will be dead. And it was.
>
> Run amule --> try to use context menu ==> keyboard dead!

No, you got _this_ right. 

After this comment, I added another one.

keyboard is dead --> check if RMB in amule is dead too -> yes it is dead.


> Since we can't reproduce the issue, and you obviously never accept
> WORKSFORME

Bug (by definition) is not guaranteed to show for everybody. I would like to know how to trigger it for myself, but with no help I cannot do this, because I don't have kernel/X knowledge.

Closing this report does not help at all, I hope you agree with me.

> for such situations, this issue will remain open until 
> it gets fixed upstream (by accident).

Upstream = X or kernel here?

Btw. today keyboard died 4 times already, so it is repeating, and I could investigate it further, I can deliver any information that would be helpful, but I need to know where to look.
Comment 66 Stefan Dirsch 2009-07-25 13:43:06 UTC
Upstream can be everything: application, toolkit, desktop, X. We don't know. Probably it's not the kernel. If I would have a clue how to investigate that issue, I would have told you earlier.
Comment 67 macias - 2009-08-25 05:12:18 UTC
The dead keyboard occurs for me recently more often -- ~every second day. Today I got the proof for 110% amule is not the cause. I started the fresh system (so it was not even new X session, but first boot of computer), I executed my program in C#, Konsole, Kmail, Konq., Knode and at this point keyboard died.

Now I will try to figure out, what keys could be the cause, but from what I see recently it looks like the more nervous I launch/switch apps the more often the keyboard dies. And launch/switch is all about win key.
Switch - win+tab
konsole win+h
kmail win+m
konq win+b
knode win+u

So when I launched today those, it was something like this
win h m b u tab

Another wild guess is, the autoreaping (the bug, not the feature) is killing the keyboard. It could be like this, I hold win pressed, but at some point the buggy autorepeating is triggered on, and millions of they key event is sent, which breaks the receiving part.

More questions than answers ;-)
Comment 68 macias - 2009-10-02 15:43:21 UTC
Almost a month without this bug and I started to believe the latest kernel fixed this by accident. Unfortunately not -- and it is odd, that when it starts happening it happens in a series -- I am writing it after 4 occurrence in 2 days.
Comment 69 Brian Cottingham 2009-10-02 17:37:28 UTC
I've noticed the same thing- I can go weeks without seeing this problem, then suddenly it will occur several times a day. 

Note that this isn't a kernel problem, but an X problem, as evidenced by the fact that restarting X will reactivate the keyboard.
Comment 70 Matthias Hopf 2009-10-06 10:21:17 UTC
Another possible culprit: Accessibility (especially SlowKeys).

Please run http://www.suse.de/~mhopf/accessx_state (needs some time to sync) on your system and post the output.
Comment 71 macias - 2009-10-06 11:06:22 UTC
XkbGetControls: ret 0:
  enabled_ctrls:    0x00001121:
    XkbAccessXKeysMask:     Enable turning on AccessX by key sequences:  off
    XkbAccessXTimeoutMask:  Change to default values on timeout:         off
    XkbAccessXFeedbackMask: Audible feedback (see ax_options):           on
    XkbSlowKeysMask:        Delay keypress acceptance:                   off
    XkbBounceKeysMask:      Ignore keypress bounces after release:       off
    XkbStickyKeysMask:      Let modifiers stick to state:                off
  slow_keys_delay:  500
  debounce_delay:   500
  ax_options:       0x00000ce3
    XkbAX_TwoKeysMask
    XkbAX_LatchToLockMask
    XkbAX_SKPressFBMask
    XkbAX_SKAcceptFBMask
    XkbAX_BKRejectFBMask
    XkbAX_StickyKeysFBMask
  axt_opts_mask:    0x00000010
  axt_opts_values:  0x00000000
  axt_ctrls_mask:   0x0000001e
  axt_ctrls_values: 0x00000000
Comment 72 Stefan Dirsch 2009-10-06 11:19:30 UTC
Is this the output when the issue occurs?
Comment 73 Brian Cottingham 2009-10-06 11:53:27 UTC
I considered that the issue was due to accessibility functions and previously tested this theory by navigating to the Accessibility panel to see if any were enabled (they were not), and by holding down keys to see if they would work (as would be the case with SlowKeys). I also held down Shift, the normal shortcut for activating/deactivating SlowKeys. None of these actions produced any results.
Comment 74 Stefan Dirsch 2009-10-06 12:35:48 UTC
(In reply to comment #71)
> XkbGetControls: ret 0:
>   enabled_ctrls:    0x00001121:
>     XkbAccessXKeysMask:     Enable turning on AccessX by key sequences:  off
>     XkbSlowKeysMask:        Delay keypress acceptance:                   off

So Accessibility (especially slowkeys) appears not to be culprit here.
Comment 75 Matthias Hopf 2009-10-06 13:48:41 UTC
Please run it once again, when you stumble over this issue once more. This is really tricky, I'm not sure at all whether this is related to accessibility, but for now it's my best guess.

As long as we cannot reproduce this issue over here, we're stuck with guessing.
Comment 76 macias - 2009-10-10 07:37:34 UTC
Output with disabled keyboard.

XkbGetControls: ret 0:
  enabled_ctrls:    0x00001121:
    XkbAccessXKeysMask:     Enable turning on AccessX by key sequences:  off
    XkbAccessXTimeoutMask:  Change to default values on timeout:         off
    XkbAccessXFeedbackMask: Audible feedback (see ax_options):           on
    XkbSlowKeysMask:        Delay keypress acceptance:                   off
    XkbBounceKeysMask:      Ignore keypress bounces after release:       off
    XkbStickyKeysMask:      Let modifiers stick to state:                off
  slow_keys_delay:  500
  debounce_delay:   500
  ax_options:       0x00000ce3
    XkbAX_TwoKeysMask
    XkbAX_LatchToLockMask
    XkbAX_SKPressFBMask
    XkbAX_SKAcceptFBMask
    XkbAX_BKRejectFBMask
    XkbAX_StickyKeysFBMask
  axt_opts_mask:    0x00000010
  axt_opts_values:  0x00000000
  axt_ctrls_mask:   0x0000001e
  axt_ctrls_values: 0x00000000
Comment 77 Stefan Dirsch 2009-10-10 09:26:46 UTC
Same output, so it isn't related to Accessibility.
Comment 78 Michal Svec 2009-10-16 16:50:27 UTC
So this just happened to me again (Dell Latitude D630C notebook, 11.1).
It was possible to switch to console using C+A+Fx (*).

I ran xev, it did not reveal a single event from the keyboard.

Then I attached a USB keyboard and it did not change at all -- no events
in xev and it was still possible to switch to console and back.

Is there anything I can try to debug this further?
It's fairly annoying (try to quit vi without keyboard ;-).

(*) Sometimes this happens with shift locked - then it's even not possible
to close windows, switch tabs in konsole, etc.
Comment 79 macias - 2009-10-20 19:16:31 UTC
In a hurry I forgot to check Ctrl+Alt+Fx switch to console, sorry for that.

New fact from today -- "normally" keyboard is disabled max. after 2 hours. Till today I was sure, that after such period I have solid system and I can work without any problem. But today, keyboard died after 13 hours of work! Just after pressing win+tab without any doubt (i.e. last win+tab didn't work).

I attach list of processes working at the moment of this accident, maybe it will bring some light -- maybe some process died? I removed some entries like privoxy or kwallet, for clarity of the list.
Comment 80 Brian Cottingham 2009-10-20 19:18:25 UTC
Ctrl-Alt-Fx works while they bug is manifest. So does Ctrl-Alt-Bksp.
Comment 81 macias - 2009-10-20 19:18:51 UTC
Created attachment 323316 [details]
ps -ax
Comment 82 macias - 2009-10-30 10:23:30 UTC
I confirm ctrl+alt+Fx is working while keyboard is disabled. And it was another win+XX related, this time I pressed win+esc (close window), the event was sent, after that keyboard died.
Comment 83 Michal Svec 2009-12-02 00:07:01 UTC
So it happened to me twice today, on fully updated 11.2.
Is there _anything_ we can do debug this further? It's quite annoying.
Comment 84 Jiri Kosina 2009-12-02 08:22:24 UTC
One datapoint from my side -- it happened to me twice in the past several weeks, and I have found out that the keyboard is in fact not really dead, but just reeeeeally slow to handle the keypress (i.e. when keeping key pressed for several seconds, it reacted). i.e. SlowKeys feature has been activated somehow automagically.
Comment 85 Martin Jambor 2009-12-02 11:06:09 UTC
I have installed xkbset (from some repository in buildservice) and
when I manually turned "slowkeys" on, the keyboard started to behave
like when this bug manifested itself.  However, it has not happened to
me spontaneously so far and so I could not try to "fix" this problem
with xkbset.  Nevertheless, I am quite confident it will help.

I did a bit of googling and came across this Redhat bug which might be
about the same issue (I have not read all the comments thoroughly,
though):

https://bugzilla.redhat.com/show_bug.cgi?id=445898

However, they fixed the problem in gnome-settings-daemon and I don't
think that is ever run on my system... but I do have it installed for
some weird reason.
Comment 86 Michal Svec 2009-12-02 12:12:44 UTC
Two more possibly related links:

http://www.linuxhomenetworking.com/forums/showthread.php/17516-keyboard-not-working-in-KDE?p=139226

http://ubuntuforums.org/showthread.php?t=458036

I didn't have those options turned on, but I reinforced that settings
now, let's see if it helps or not.
Comment 87 Stefan Dirsch 2009-12-02 15:57:11 UTC
I believe we have seperate issues here. One is that slowkeys gets enabled not by (users's) intention, possibly already by gdm or later by some GNOME application. Not easy to reproduce. The other one is some weird bug deep in X, even more difficult to reproduce - not investigated yet. :-(
Comment 88 macias - 2009-12-26 13:55:50 UTC
Note about autorepeating -- I wanted to type:
.się

the space was autorepeated so I get the effect of
....................................się

I typed "się" just after ".", so I already finished hitting keys when I saw several first ".".

It is different when you do the repeating "." by hand, press and hold ".", and then type "się". The moment you hit "s" the effect of still pressed "." is canceled and you get "s". In other words, if the autorepeating was done at hardware level I would get
.się

as I intended. It has to be at software level then.
Comment 89 Martin Jambor 2010-01-05 13:30:08 UTC
(In reply to comment #85)
> I have installed xkbset (from some repository in buildservice) and
> when I manually turned "slowkeys" on, the keyboard started to behave
> like when this bug manifested itself.  However, it has not happened to
> me spontaneously so far and so I could not try to "fix" this problem
> with xkbset.  Nevertheless, I am quite confident it will help.

OK.  Now it happened spontaneously and running "xkbset -sl" did help
to get keyboard back to normal.  So this is still an annoyance but
rather less extreme now.
Comment 90 macias - 2010-01-05 17:15:46 UTC
Where did you get xkbset? It is not in any official 11.1 repo, so I would like to use the same version as you.
Comment 91 Martin Jambor 2010-01-06 11:13:55 UTC
(In reply to comment #90)
> Where did you get xkbset? It is not in any official 11.1 repo, so I would like
> to use the same version as you.

I searched for it in buildservice.  When I do the search now I get
only one result (below) so I suppose it must be the repository I use:

http://download.opensuse.org/repositories/home:/tiwai/openSUSE_11.1/

The package version certainly matches.
Comment 92 Michal Svec 2010-02-01 16:58:29 UTC
Just happened again, 11.2 incl. latest patches. The above advice
with xkbset -sl unfortunately didn't work.
Comment 93 Stefan Dirsch 2010-04-28 03:41:47 UTC
There are no plans to fix this still for opnSUSE 11.1, but please feel free to
reopen if you see the issue still/again with openSUSE 11.3.