WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] acpid does not recognize Thinkpad's sleep button  (Read 16683 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #15 on: September 16, 2020, 12:42:59 PM »
Thanks, Rich. These files are identical across the two systems:

Code: [Select]
TCL:/sys/devices/platform/thinkpad_acpi$ for file in hotkey_bios_mask hotkey_all_mask hotkey_adaptive_all_mask hotkey_mask hotkey_recommended_mask hotkey_source_mask hotkey_bios_enabled hotkey_poll_freq hotkey_enable; do cat $file; done
0x0000080c
0x07ffffff
0x00000000
0x078c7fff
0x078c7fff
0x00000000
0
10
cat: hotkey_enable: Input/output error

Devuan:/sys/devices/platform/thinkpad_acpi$ for file in hotkey_bios_mask hotkey_all_mask hotkey_adaptive_all_mask hotkey_mask hotkey_recommended_mask hotkey_source_mask hotkey_bios_enabled hotkey_poll_freq hotkey_enable; do cat $file; done
0x0000080c
0x07ffffff
0x00000000
0x078c7fff
0x078c7fff
0x00000000
0
10
cat: hotkey_enable: Input/output error

Besides, I don't think the  thinkpad_acpi  module has anything to do with making the sleep key work in Devuan--doing "sudo modprobe -r thinkpad_acpi" causes the entire /sys/devices/platform/thinkpad_acpi directory to disappear but, even after that, pressing the sleep button in Devuan still produces output in xev.
« Last Edit: September 16, 2020, 12:48:35 PM by GNUser »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: acpid does not recognize Thinkpad's sleep button
« Reply #16 on: September 16, 2020, 12:52:22 PM »
HI GNUser
... Besides, I don't think the  thinkpad_acpi  module has anything to do with making the sleep key work in Devuan--doing "sudo modprobe -r thinkpad_acpi" causes the entire /sys/devices/platform/thinkpad_acpi directory to disappear but, even after that, pressing the sleep button in Devuan still produces output in xev.
Now don't I feel stupid. I read your post that stated that  thinkpad_acpi  was not needed, then went right ahead and
ask for the contents in the  /sys/devices/platform/thinkpad_acpi  subdirectory. :-[

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #17 on: September 16, 2020, 12:54:28 PM »
Oh, please don't. I have no idea what to do at this point. Any idea is better than no idea.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #18 on: September 16, 2020, 01:03:05 PM »
Strange--it says here that  thinkpad-acpi  is what supports the Fn+F4 key (see the very first table, in the Overview section):
https://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work

Maybe the information is outdated? Whatever the case, in Devuan ASCII support for the Fn+F4 key is clearly coming from elsewhere. Where the support is coming from is the million-dollar question. At this point I have no idea.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: acpid does not recognize Thinkpad's sleep button
« Reply #19 on: September 16, 2020, 01:24:17 PM »
Hi, guys!

Here is citation from showkey man:
"The raw scan codes are available only on AT and PS/2 keyboards, and even then they are disabled unless the atkbd.softraw=0 kernel parameter is used."
At least it seems easy to test...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: acpid does not recognize Thinkpad's sleep button
« Reply #20 on: September 16, 2020, 01:25:07 PM »
HI GNUser
Yeah, I saw that too. The x86 repo has  udev-keymap.tcz  and  xkeyboard-config.tcz.  Does Devuan  have similar
packages installed?


Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: acpid does not recognize Thinkpad's sleep button
« Reply #21 on: September 16, 2020, 01:35:16 PM »
By the way, what dmesg says about keyboard hardware?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #22 on: September 16, 2020, 01:50:26 PM »
Hi, jazzbiker. I repeated the  xev  and  showkey  experiments after booting TCL with the  atkbd.softraw=0  kernel boot paramter. Alas, no difference. Here is what  dmesg  says about my keyboard:
Code: [Select]
TCL$ dmesg | grep keyboard
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input3

Rich, no exact matches among the packages installed on Devuan:
Code: [Select]
Devuan$ apt list --installed | grep -E 'key|map|input|udev|device'

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

debian-archive-keyring/stable,now 2017.5 all [installed]
devuan-keyring/stable,now 2017.10.03 all [installed]
eudev/stable,now 3.2.2-13 amd64 [installed]
gir1.2-gnomekeyring-1.0/stable,now 3.12.0-1+b2 amd64 [installed,automatic]
gir1.2-gudev-1.0/stable,now 230-3 amd64 [installed,automatic]
gnome-keyring/stable,now 3.20.0-3 amd64 [installed]
keyboard-configuration/stable,now 1.164 all [installed]
keyutils/stable,now 1.5.9-9 amd64 [installed,automatic]
libavdevice-dev/stable,now 7:3.2.10-1~deb9u1 amd64 [installed]
libavdevice57/stable,now 7:3.2.10-1~deb9u1 amd64 [installed,automatic]
libchromaprint1/stable,now 1.4.2-1 amd64 [installed,automatic]
libdevmapper1.02.1/stable,now 2:1.02.137-2 amd64 [installed,automatic]
libdmapsharing-3.0-2/stable,now 2.9.37-1 amd64 [installed,automatic]
libeudev-dev/stable,now 3.2.2-13 amd64 [installed,automatic]
libeudev1/stable,now 3.2.2-13 amd64 [installed,automatic]
libgnome-keyring-common/stable,now 3.12.0-1 all [installed,automatic]
libgnome-keyring0/stable,now 3.12.0-1+b2 amd64 [installed,automatic]
libgudev-1.0-0/stable,now 230-3 amd64 [installed,automatic]
libgudev-1.0-dev/stable,now 230-3 amd64 [installed]
libimobiledevice6/stable,now 1.2.0+dfsg-3.1 amd64 [installed,automatic]
libinput-bin/stable,now 1.6.3-1 amd64 [installed,automatic]
libinput10/stable,now 1.6.3-1 amd64 [installed,automatic]
libkeyutils1/stable,now 1.5.9-9 amd64 [installed,automatic]
libnfsidmap2/stable,now 0.25-5.1 amd64 [installed,automatic]
libpam-gnome-keyring/stable,now 3.20.0-3 amd64 [installed,automatic]
libudev-dev/stable,now 1:3.2.2+devuan2.11 amd64 [installed,automatic]
libudev1/stable,now 1:3.2.2+devuan2.11 amd64 [installed]
libwinpr-input0.1/stable,now 1.1.0~git20140921.1.440916e+dfsg1-13+deb9u2 amd64 [installed,automatic]
libxcb-keysyms1/stable,now 0.4.0-1+b2 amd64 [installed,automatic]
nmap/stable,now 7.40-1 amd64 [installed]
python-keyring/stable,now 10.1-1 all [installed,automatic]
python-keyrings.alt/stable,now 1.3-1 all [installed,automatic]
python3-keyring/stable,now 10.1-1 all [installed,automatic]
python3-keyrings.alt/stable,now 1.3-1 all [installed,automatic]
system-config-printer-udev/stable,now 1.5.7-3+b1 amd64 [installed,automatic]
udev/stable,now 1:3.2.2+devuan2.11 amd64 [installed]
x11proto-input-dev/stable,now 2.3.2-1 all [installed,automatic]
xbitmaps/stable,now 1.1.1-2 all [installed,automatic]
xinput/stable,now 1.6.2-1+b1 amd64 [installed]
xserver-xorg-input-all/stable,now 1:7.7+19 amd64 [installed,automatic]
xserver-xorg-input-libinput/stable,now 0.23.0-2 amd64 [installed,automatic]
xserver-xorg-input-synaptics/stable,now 1.9.0-1+b1 amd64 [installed]
xserver-xorg-input-void/stable,now 1:1.4.1-1+b2 amd64 [installed,automatic]
xserver-xorg-input-wacom/stable,now 0.34.0-1 amd64 [installed,automatic]
The xserver-* packages are probably unrelated, since the Fn+F4 key works just fine in console when X is not running.







Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: acpid does not recognize Thinkpad's sleep button
« Reply #23 on: September 16, 2020, 02:30:19 PM »
The next silly question: have You tried TC 10 or earlier?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #24 on: September 16, 2020, 02:39:55 PM »
No, that's a good thought. I just tried TCL10 64bit. Same result as with TCL11: thinkpad-acpi-KERNEL.tcz enables a bunch of the special keys to produce output in  xev  (including the battery key on Fn+F3). However, pressing sleep (Fn+F4) produces no output whatsoever.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: acpid does not recognize Thinkpad's sleep button
« Reply #25 on: September 16, 2020, 02:46:06 PM »
Of course, the existence of dedicated thinkpad-acpi-x.xx.xx-KERNEL modules marks, that some untransparent hardware is lurking in ThinkPads besides i8042. Can we unveil what hardware is driven by this modules? My opinion is, that poor Fn-F4 is eaten by some motherboard habitant.
GNUser, there are no EFI, right? Naked BIOS?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #26 on: September 16, 2020, 02:51:21 PM »
No EFI. It's BIOS (well, sort of--I use Libreboot).
Note that no Libreboot-specific adjustments were made to either Devuan or TCL. Therefore, Devuan is detecting Fn+F4 "out of the box".

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: acpid does not recognize Thinkpad's sleep button
« Reply #27 on: September 16, 2020, 02:56:12 PM »
Maybe smthg interesting will give
Code: [Select]
dmesg | grep thinkpad ?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: acpid does not recognize Thinkpad's sleep button
« Reply #28 on: September 16, 2020, 03:30:23 PM »
Wow, some very interesting results:

Code: [Select]
Devuan$ dmesg | grep -i thinkpad
               BIOS vendor: coreboot; Ver: CBET4000 3774c98; Product Version: ThinkPad X200
[    4.275734] thinkpad_acpi: ThinkPad ACPI Extras v0.25
[    4.275736] thinkpad_acpi: http://ibm-acpi.sf.net/
[    4.275737] thinkpad_acpi: ThinkPad BIOS CBET4000 3774c98, EC 7XHT22WW-3.6
[    4.275738] thinkpad_acpi: Lenovo ThinkPad X200, model 7458CU2
[    4.280371] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
[    4.280373] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
[    4.285557] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[    4.286952] thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
[    4.288999] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input7
[    7.244446] elogind[2044]: Watching system buttons on /dev/input/event6 (ThinkPad Extra Buttons)

Code: [Select]
TCL$ dmesg | grep -i thinkpad
BIOS vendor: coreboot; Ver: CBET4000 3774c98; Product Version: ThinkPad X200
thinkpad_acpi: ThinkPad ACPI Extras v0.26
thinkpad_acpi: http://ibm-acpi.sf.net/
thinkpad_acpi: ThinkPad BIOS CBET4000 3774c98, EC 7XHT22WW-3.6
thinkpad_acpi: Lenovo ThinkPad X200, model 7458CU2
thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
thinkpad_acpi: Console audio control enabled, mode: monitor (read only)
thinkpad_acpi: battery 1 registered (start 0, stop 0)
battery: new extension: ThinkPad Battery Extension
input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input7

I did a little experiment and killed  elogind  after I was at my desktop in Devuan. Then opened a terminal and watched output of xev. Well, Fn+F3 (among others) consistently produces output, but Fn+F4 produces output only the first time I press it. So maybe elogind has something to do with consistent detection of Fn+F4 on Devuan.

It seems we are no closer to making Fn+F4 work in TCL :-\ Oh, well. Thank you Rich and jazzbiker. If you guys have any more ideas, I'd be happy to try them. But if you are tired of this pesky issue, I understand and would be happy to just let it be.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: acpid does not recognize Thinkpad's sleep button
« Reply #29 on: September 16, 2020, 03:43:30 PM »
HI GNUser
...  but Fn+F4 produces output only the first time I press it. ...
I bet that's related to this:


tc@E310:~$ grep -A 15 'FN+F4' kernel64/linux-4.19.10/Documentation/laptops/thinkpad-acpi.txt 
0x1004  0x03    FN+F4           Sleep button (ACPI sleep button
                                semantics, i.e. sleep-to-RAM).
                                It always generates some kind
                                of event, either the hot key
                                event or an ACPI sleep button
                                event. The firmware may
                                refuse to generate further FN+F4
                                key presses until a S3 or S4 ACPI
                                sleep cycle is performed or some
                                time passes.


« Last Edit: September 16, 2020, 04:04:42 PM by Rich »