We had this issue for a while, where in lightdm characters would appear in the password input (hidden, so you can't see which ones it actually produces), making it a lot harder to input your password.
Today when trying an older pyra (2gb model), i finally managed to find out which device was causing it (it doesn't happen all the time, and of course when you're looking for it, it doesn't do it).
It seems the pyra-lid-wakeup device causes them, which, after some digging, seem to be connected to wwan_wakeup (line 753+ in pyra-mainboard-v5.0.dtsi)
Why does this device need to produce key events ?
The weird thing is that it only happens when lightdm is running. Running evtest on the device when you're in Xorg, or with lightdm shut down produces no output.
Starting evtest with xorg running shows no events, but after logging out , back the the lightdm login screen, it immediately starts producing these events again.
It seems to happen more on this older 2gb unit than the newer ones, but it still happens occasionally.
evtest output:
Available devices: /dev/input/event0: user-button /dev/input/event1: pyra-game-buttons /dev/input/event2: pyra-lid-wakeup /dev/input/event3: palmas_pwron /dev/input/event4: tca8418 /dev/input/event5: TSC2007 Touchscreen /dev/input/event6: nub0 /dev/input/event7: nub1 /dev/input/event8: accelerometer-iio-input-bridge /dev/input/event9: twl6040:vibrator /dev/input/event10: pyraInput keyboard /dev/input/event11: pyraInput Gamepad /dev/input/event12: pyraInput Mouse Select the device event number [0-12]: 2 Input driver version is 1.0.1 Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100 Input device name: "pyra-lid-wakeup" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 240 (KEY_UNKNOWN) Event type 5 (EV_SW) Event code 0 (SW_LID) state 1 Properties: Testing ... (interrupt to exit) Event: time 1578938630.370481, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938630.370481, -------------- SYN_REPORT ------------ Event: time 1578938630.382319, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938630.382319, -------------- SYN_REPORT ------------ Event: time 1578938631.212161, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.212161, -------------- SYN_REPORT ------------ Event: time 1578938631.249966, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.249966, -------------- SYN_REPORT ------------ Event: time 1578938631.601427, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.601427, -------------- SYN_REPORT ------------ Event: time 1578938631.617213, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.617213, -------------- SYN_REPORT ------------ Event: time 1578938631.732300, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.732300, -------------- SYN_REPORT ------------ Event: time 1578938631.776326, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.776326, -------------- SYN_REPORT ------------ Event: time 1578938631.851883, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.851883, -------------- SYN_REPORT ------------ Event: time 1578938631.859011, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.859011, -------------- SYN_REPORT ------------ Event: time 1578938632.130892, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938632.130892, -------------- SYN_REPORT ------------ Event: time 1578938632.154042, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938632.154042, -------------- SYN_REPORT ------------ Event: time 1578938633.093952, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1
Hi and sorry for the late answer.
Am 13.01.2020 um 23:06 schrieb aTc atc@k-n-p.org:
We had this issue for a while, where in lightdm characters would appear in the password input (hidden, so you can't see which ones it actually produces), making it a lot harder to input your password.
Today when trying an older pyra (2gb model), i finally managed to find out which device was causing it (it doesn't happen all the time, and of course when you're looking for it, it doesn't do it).
It seems the pyra-lid-wakeup device causes them, which, after some digging, seem to be connected to wwan_wakeup (line 753+ in pyra-mainboard-v5.0.dtsi)
Why does this device need to produce key events ?
This is a signal from the LTE modem to indicate that it needs attention after incoming SMS or an incoming call. Having it connected as a key event is useful for some simple Phone UI software. Otherwise it is difficult to tell the application that such an event occurs. AFAIK there is no alternative or otherwise standardized way of handling such events in the kernel and sending them to user-space than making it an evdev key. Having it as a wakeup device is to be able to suspend the processor and wake up on incoming SMS/call and suspend again if processed (stored, ignored etc.). The same should happen for some important physical buttons and the lid switch. So in summary it is a feature to make the Pyra useable as a phone with long standby time and still handle incoming calls/SMS while in standby. GTA04 has a similar mechanism and some Phone GUI (QtMoko, SimpleGSMGUI, Replicant relies on such a function).
The weird thing is that it only happens when lightdm is running. Running evtest on the device when you're in Xorg, or with lightdm shut down produces no output.
Starting evtest with xorg running shows no events, but after logging out , back the the lightdm login screen, it immediately starts producing these events again.
It seems to happen more on this older 2gb unit than the newer ones, but it still happens occasionally.
Maybe we are missing a pullup-definition for the pinmux so that the omap5 gpio is floating and sometimes picks up noise. This is especially critical on the boards where no LTE modem is installed.
AFAIR there is also a PCB layout issue in the older mainboard so that this may even be completely broken. This is fixed for the version going to mass production.
evtest output:
Available devices: /dev/input/event0: user-button /dev/input/event1: pyra-game-buttons /dev/input/event2: pyra-lid-wakeup /dev/input/event3: palmas_pwron /dev/input/event4: tca8418 /dev/input/event5: TSC2007 Touchscreen /dev/input/event6: nub0 /dev/input/event7: nub1 /dev/input/event8: accelerometer-iio-input-bridge /dev/input/event9: twl6040:vibrator /dev/input/event10: pyraInput keyboard /dev/input/event11: pyraInput Gamepad /dev/input/event12: pyraInput Mouse Select the device event number [0-12]: 2 Input driver version is 1.0.1 Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100 Input device name: "pyra-lid-wakeup" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 240 (KEY_UNKNOWN) Event type 5 (EV_SW) Event code 0 (SW_LID) state 1 Properties: Testing ... (interrupt to exit) Event: time 1578938630.370481, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938630.370481, -------------- SYN_REPORT ------------ Event: time 1578938630.382319, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938630.382319, -------------- SYN_REPORT ------------ Event: time 1578938631.212161, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.212161, -------------- SYN_REPORT ------------ Event: time 1578938631.249966, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.249966, -------------- SYN_REPORT ------------ Event: time 1578938631.601427, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.601427, -------------- SYN_REPORT ------------ Event: time 1578938631.617213, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.617213, -------------- SYN_REPORT ------------ Event: time 1578938631.732300, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.732300, -------------- SYN_REPORT ------------ Event: time 1578938631.776326, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.776326, -------------- SYN_REPORT ------------ Event: time 1578938631.851883, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938631.851883, -------------- SYN_REPORT ------------ Event: time 1578938631.859011, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938631.859011, -------------- SYN_REPORT ------------ Event: time 1578938632.130892, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 Event: time 1578938632.130892, -------------- SYN_REPORT ------------ Event: time 1578938632.154042, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0 Event: time 1578938632.154042, -------------- SYN_REPORT ------------ Event: time 1578938633.093952, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1
On 1/17/20 7:27 PM, H. Nikolaus Schaller wrote:
Input device name: "pyra-lid-wakeup" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 240 (KEY_UNKNOWN) Event type 5 (EV_SW) Event code 0 (SW_LID) state 1
Wouldn't KEY_WAKEUP make more sense here instead of KEY_UNKNOWN ? Or is that reserved for some specific feature.
Am 18.01.2020 um 03:40 schrieb aTc atc@k-n-p.org:
On 1/17/20 7:27 PM, H. Nikolaus Schaller wrote:
Input device name: "pyra-lid-wakeup" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 240 (KEY_UNKNOWN) Event type 5 (EV_SW) Event code 0 (SW_LID) state 1
Wouldn't KEY_WAKEUP make more sense here instead of KEY_UNKNOWN ? Or is that reserved for some specific feature.
Hm. Good question.
I do not remember why code 240 was chosen many years ago, but I could trace it back to pre-device-tree ages:
commit fa858e5cab7e65235af4526d031f1a6e7f5adf7a Author: NeilBrown neilb@suse.de Date: Mon Jul 23 11:04:51 2012 +1000
Configure 3G interrupt as a key-press
This ensures correct wakeup handling and make it easy to integrate with existing code.
Signed-off-by: NeilBrown neilb@suse.de
[...]
diff --git a/arch/arm/mach-omap2/board-omap3gta04.c b/arch/arm/mach-omap2/board-omap3gta04.c index 9f862341e189..320f7d3bb2d9 100644 --- a/arch/arm/mach-omap2/board-omap3gta04.c +++ b/arch/arm/mach-omap2/board-omap3gta04.c @@ -1094,19 +1094,38 @@ static struct gpio_keys_button gpio_buttons[] = { .wakeup = 1, }, }; +static struct gpio_keys_button gpio_3G_buttons[] = { + { + .code = KEY_UNKNOWN, + .gpio = -1/*WO3G_GPIO*/, + .desc = "Option", + .wakeup = 1, + }, +};
[...]
I also found a temporary switch to KEY_WAKEUP in 2013 but it was restored after 14 days. Maybe it triggered some user-space incompatibility. So there was some reason to use KEY_UNKNOWN. Using KEY_WWAN could also be a choice, but may also interfere with something else. I think it is reserved for a physical button to turn on/off WWAN through rfkill.
There is also an announcement by Neil Brown (back then he was Linux maintainer for the RAID subsystem):
http://lists.goldelico.com/pipermail/gta04-owner/2012-July/002660.html
IMHO the right solution is to check why it triggers without modem activity in the wrong moment. And make it ignored by the xmodmap or keymap or the application that gets into trouble.
Generally changing to a different event code than GTA04 would make the Pyra more incompatible with GTA04 and existing phone software and introduce problems with applications making assumptions about the different event code.