# My keyboard lives!

## trollo

I'm not sure if this is the right forum since I don't know the problem's origin, so feel free to move me if it isn't.

So, I just installed Gentoo on my new Dell Vostro 3550. Everything went fine until I rebooted the 2nd or 3rd time into my new system. Suddenly my root password was wrong and when I managed to login, I discovered there were magically appearing the characters ^@ at the prompt, repeatedly every few seconds:

 *Quote:*   

> # ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@

 

I rebooted and the problem was gone, had a several-hours-session without problems. That was on thursday. Yesterday, two sessions, no problems. Booted today, the keyboard lived again. Booted into Windows7, no problem. Rebooted to Gentoo, no problem. This is now.

This just seems too random to me to find a good starting point for debugging, I have no idea what's happening here. Is there any kernel (mis)configuration that could cause this? Any other configuration problem? Is it likely a hardware problem and I should return the laptop?

demsg: http://paste.pocoo.org/show/522191/

kernel .config: http://paste.pocoo.org/show/522099/

----------

## Quincy

You use only the internal keyboard of your laptop? Nothing externally connected, perhaps via wireless?

I sometimes have a similar problem, when the batteries of my wireless keyboard are nearly empty....

----------

## trollo

Yes, only the internal keyboard. Right now I have only connected Ethernet and an USB mouse.

Just saw something (possibly) interesting: I booted the laptop (first time today) and went afk for a few minutes. When I came back to login, everything was ok, but as soon as I was typing my password, those characters came up again and ruined it and then also appeared at the following login prompt. I waiting and, surprisingly, after the login timed out, the next one was clean and I could login without problems.

FWIW, my screen looks like this now: http://img507.imageshack.us/img507/443/20111218115208.jpg

This is so fucking odd. Help please.

----------

## Quincy

Normally I would guess that there is a stuck key somewhere on the keyboard, but why should the login timeout or reboot (without any key press) solve the problem?   :Confused: 

Are the characters appearing evenly spaced every few seconds (like some polling mechanism) or is the time between two characters random?

----------

## trollo

It seemed pretty random to me, definitely not evenly spaced. Also I had the impression that they were faster today, more like 2 chars per second, but it may very well be that I didn't watch closely enough before. In any case, they always appear as a pair, i.e. ^@ show up at once.

----------

## WvR

You mention it is a new laptop, and it is possible that there is some hardware problem. Even the best factory produces a faulty product every once in a while. I assume it had Windows pre-installed? If so, then assuming that you have not erased Windows for your Gentoo installation, boot into Windows, and see if the same problem appears. If so, it is a hardware problem. If not, then I wouldn't know. You could try and check the kernel configuration. There are several sets of "extras" for several families of laptops.

----------

## trollo

The problem never occured on Windows, although I've admittedly only booted it a handful of times. But that and the fact that the problem seems to disappear when I let the login timeout makes me pretty positive that it's not a hardware problem.

I'm now testing a kernel with CONFIG_DCDBAS=y and CONFIG_DELL_LAPTOP=y, let's see if that helps.

----------

## Etal

Seems to me like one of the "special" keys might be a bit stuck (such as volume, brightness, etc.). Try pressing them to see if it helps.

----------

## trollo

Ok, after the holidays I've now had some time to get into this again and I found the problem seems indeed to be related to the function keys somehow (thanks for the hint): When I do

```
cat /dev/input/eventX
```

and press any (valid) function key combination, ^@ appears on the output.

But it's not just a stuck key... I activated Event debugging (CONFIG_INPUT_EVBUG) in the kernel and found that no key or key combinations produces the same code as this mysterious... thing.

This is what

```
tail -f /var/log/kernel/current
```

looks like while I don't press or move anything:

```
(...)

Jan 02 17:33:07 [kernel] [  967.743119] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  967.743122] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:07 [kernel] [  967.743125] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  967.807360] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:07 [kernel] [  967.807365] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  967.807369] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:07 [kernel] [  967.807372] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  968.321313] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:07 [kernel] [  968.321318] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  968.321322] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:07 [kernel] [  968.321325] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  968.385556] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:07 [kernel] [  968.385561] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:07 [kernel] [  968.385565] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:07 [kernel] [  968.385568] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:16 [kernel] [  977.400143] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:16 [kernel] [  977.400149] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:16 [kernel] [  977.400152] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:16 [kernel] [  977.400156] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:17 [kernel] [  977.464367] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:17 [kernel] [  977.464373] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:17 [kernel] [  977.464377] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:17 [kernel] [  977.464380] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:18 [kernel] [  979.241574] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:18 [kernel] [  979.241579] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:18 [kernel] [  979.241582] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:18 [kernel] [  979.241585] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:18 [kernel] [  979.305813] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:18 [kernel] [  979.305818] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:18 [kernel] [  979.305822] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:18 [kernel] [  979.305825] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:20 [kernel] [  980.997448] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

Jan 02 17:33:20 [kernel] [  980.997453] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:20 [kernel] [  980.997457] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 0

Jan 02 17:33:20 [kernel] [  980.997460] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

Jan 02 17:33:20 [kernel] [  981.061695] evbug: Event. Dev: input4, Type: 1, Code: 227, Value: 1

(...)
```

When I press a Fn key combination it looks something like:

```
Jan 02 18:04:46 [kernel] [ 2865.320375] evbug: Event. Dev: input6, Type: 4, Code: 4, Value: 158

Jan 02 18:04:46 [kernel] [ 2865.320390] evbug: Event. Dev: input6, Type: 1, Code: 192, Value: 1

Jan 02 18:04:46 [kernel] [ 2865.320402] evbug: Event. Dev: input6, Type: 0, Code: 0, Value: 0

Jan 02 18:04:46 [kernel] [ 2865.326665] evbug: Event. Dev: input6, Type: 4, Code: 4, Value: 158

Jan 02 18:04:46 [kernel] [ 2865.326677] evbug: Event. Dev: input6, Type: 1, Code: 192, Value: 0

Jan 02 18:04:46 [kernel] [ 2865.326688] evbug: Event. Dev: input6, Type: 0, Code: 0, Value: 0
```

Activating those two Dell-related options in the kernel didn't help.

Any help still appreciated!

----------

## Quincy

I never tried to debug things like that, but if the kernel annouces your keyboard as "input6"...the codes coming from "input4" are not keyboard related.

Is there any serial console, infrared device or anything that might be an input device connected?

What is "input4"? Try: 

```
dmesg | grep input
```

----------

## trollo

Ah, interesting:

```

# dmesg | grep input

[    0.539752] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0

[    0.541392] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input1

[    0.541593] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input2

[    0.541794] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3

[    1.585534] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/LNXVIDEO:00/input/input4

[    1.586735] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:01/input/input5

[    1.728327] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input6

[    2.687971] input: DualPoint Stick as /devices/platform/i8042/serio1/input/input7

[    2.702316] input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input8

```

Ok, what do I do with that? For all I know, my video devices (Intel GMA and Radeon HD 6630M) are configured correctly, at least they're both working with Xorg.

Why are video buses registered as input devices anyway?

----------

## Quincy

I'm sorry, but I have no idea why a video device is registered as input device.   :Sad: 

I just can tell that it is the same on my system (Intel GMA 4500MHD) using the i915 kernel driver.

----------

## trollo

Ok, maybe you can do me a favor: Could you check if you get any output from

```
cat /dev/input/eventX
```

with X being the input # of your video bus(es) (4 and 5 in my case)? Please check once directly after a cold boot and then when the system is running for a while, as for me the problem seems to only occur for some time after a cold boot.

For me, that prints weird characters on the screen(without touching anything), kind of like when I do 'cat /dev/input/mice' and move the mouse/touchpad. And it does so when I boot from a LiveDVD as well, but I don't have the ^@-problem in that case.

----------

## Quincy

In my case its only one video bus because my laptop only has the Intel graphics and no additional 3D card like yours:

```
input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A03:00/LNXVIDEO:01/input/input3
```

Neither directly after booting nor while running for hours any character appeared. Only after resuming from hibernate there have been a few characters being displayed, but that stopped directly after resuming had finished.

Is there any possibility to switch between the two graphic cards (perhaps even a hardware one)? This could be one reason for having graphic cards registered as input devices. Perhaps you can (temporarily) disable one card and see if the problem vanishes.

The LiveDVD thing is interesting, because the problem then is not having some output at all, but this output getting redirected to the terminal?!

----------

## smartass

so as it appears, that "function key" has a keycode of 227, right?

the command 

```
xmodmap -pk
```

 will print a keymap table which could give you an idea of which key it may be that could be stuck.

On my setup the keysym is XF86Finance, not really sure what key that is (maybe one of the $ or Euro symbol keys,dunno)

----------

