You are not logged in.

#1 2022-01-22 13:51:28

hxss
Member
Registered: 2017-10-17
Posts: 34

How to wake up from suspend by laptop keyboard or lid open?

I want to wake up system from suspend(to RAM) by any key press or by lid open.

$ sudo libinput debug-events
...
-event2   DEVICE_ADDED            Lid Switch                        seat0 default group4  cap:S
-event1   DEVICE_ADDED            Sleep Button                      seat0 default group5  cap:k # I dont know what it is, the laptop dont has sleep button
...
-event9   DEVICE_ADDED            AT Translated Set 2 keyboard      seat0 default group10 cap:k
$ udevadm info -q path -n /dev/input/event9
/devices/platform/i8042/serio0/input/input16/event9
$ udevadm info -q path -n /dev/input/event2
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input2/event2
$ cat /sys/devices/platform/i8042/serio0/power/wakeup
enabled
$ cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/power/wakeup
enabled
$ cat /proc/acpi/wakeup
Device	S-state	  Status   Sysfs node
BUSA	  S4	*enabled   pci:0000:00:08.1
HDAU	  S0	*disabled  pci:0000:04:00.1
XHC0	  S0	*enabled   pci:0000:04:00.3
XHC1	  S0	*enabled   pci:0000:04:00.4
ACP	  S0	*disabled  pci:0000:04:00.5
HDEF	  S0	*disabled  pci:0000:04:00.6
HST1	  S5	*disabled

So wakeup enabled for both devices in sysfs by default(I have not written any udev rules for the moment). And some devices disabled in /proc/acpi/wakeup. I dont know which and how to match codes from /proc/acpi/wakeup with devices in sysfs.

Last edited by hxss (2022-01-22 13:53:30)

Offline

#2 2022-01-22 14:08:20

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: How to wake up from suspend by laptop keyboard or lid open?

The "Sleep Button" for laptops is usually the power button. Does that work for you?

If opening the lid isn't resuming from suspend then you should probably explain exactly how you are initiating the suspend process and also check

systemd-inhibit

It looks like the /proc/acpi/wakeup content has been cropped. Do you have a line for "LID"?


Jin, Jîyan, Azadî

Offline

#3 2022-01-22 14:31:48

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

This is HP ProBook x360 435 G8.
Yes, power button is the only for now to wake up.
I usually just close the lid for suspend, this event handles by logind. I also tested suspend from xfce's power menu or by `systemctl suspend` - all this works similar.
The whole `/proc/acpi/wakeup` in first post. This exactly how it look like, with no sysfs column for HST1.
Just now I activated all devices wakeup:

$ sudo sh -c 'echo enabled > /sys/devices/pci0000:00/0000:00:08.1/0000:04:00.1/power/wakeup'
$ sudo sh -c 'echo enabled > /sys/devices/pci0000:00/0000:00:08.1/0000:04:00.5/power/wakeup'
$ sudo sh -c 'echo enabled > /sys/devices/pci0000:00/0000:00:08.1/0000:04:00.6/power/wakeup'
$ cat /proc/acpi/wakeup
Device	S-state	  Status   Sysfs node
BUSA	  S4	*enabled   pci:0000:00:08.1
HDAU	  S0	*enabled   pci:0000:04:00.1
XHC0	  S0	*enabled   pci:0000:04:00.3
XHC1	  S0	*enabled   pci:0000:04:00.4
ACP	  S0	*enabled   pci:0000:04:00.5
HDEF	  S0	*enabled   pci:0000:04:00.6
HST1	  S5	*disabled

Nothing changed. As I understand, I need to activate S3 wake up.

$ systemd-inhibit
WHO                 UID  USER PID COMM            WHAT                                                     WHY                                   >
NetworkManager      0    root 516 NetworkManager  sleep                                                    NetworkManager needs to turn off netwo>
Screen Locker       1000 hxss 905 light-locker    sleep                                                    Lock the screen on suspend/resume     >
xfce4-power-manager 1000 hxss 955 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key xfce4-power-manager handles these even>

3 inhibitors listed.

Offline

#4 2022-01-22 16:01:02

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: How to wake up from suspend by laptop keyboard or lid open?

hxss wrote:

The whole `/proc/acpi/wakeup` in first post.

So there's no listing for LID? Perhaps the DSDT is faulty then. See https://wiki.archlinux.org/title/DSDT for more on this.


Jin, Jîyan, Azadî

Offline

#5 2022-01-22 18:25:57

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

I also have this warning messages at every boot:

2022-01-22T16:22:49+0300 hp kernel: Expanded resource Reserved due to conflict with PCI Bus 0000:00
2022-01-22T16:22:49+0300 hp kernel: pci 0000:00:00.2: can't derive routing for PCI INT A
2022-01-22T16:22:49+0300 hp kernel: pci 0000:00:00.2: PCI INT A: not connected
2022-01-22T16:22:50+0300 hp kernel: acpi PNP0C14:01: duplicate WMI GUID 05901221-D566-11D1-B2F0-00A0C9062910 (first instance was on PNP0C14:00)

Could this be related with the issue?

Offline

#6 2022-01-22 19:02:32

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

# dmesg
[    0.374876] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
[    0.374887] ACPI: button: Power Button [PWRB]
[    0.374903] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input1
[    0.374910] ACPI: button: Sleep Button [SLPB]
[    0.374921] input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input2
[    0.374928] ACPI: button: Lid Switch [LID]
[    0.374942] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
[    0.374958] ACPI: button: Power Button [PWRF]
--
[ 4277.171676] ACPI: button: The lid device is not compliant to SW_LID.
[ 4277.172882] ACPI: EC: interrupt unblocked
[ 4277.205939] pci 0000:00:00.2: can't derive routing for PCI INT A
[ 4277.205943] pci 0000:00:00.2: PCI INT A: no GSI

Should PWRB, SLPB, PWRF be mentioned in /proc/acpi/wakeup too?

Last edited by hxss (2022-01-22 19:05:13)

Offline

#7 2022-01-22 19:44:31

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: How to wake up from suspend by laptop keyboard or lid open?

I certainly have SLPB in that file. No sign of PWRB though. Suspend/resume is fine for me but only with lid opening & the power button. Any other keys do nothing but I wouldn't expect them to.

hxss wrote:
[ 4277.171676] ACPI: button: The lid device is not compliant to SW_LID.

It's often useful to enter error messages into a search engine:

https://unix.stackexchange.com/question … w-lid-mean

Perhaps try the methods listed on the DSDT page I linked earlier.


Jin, Jîyan, Azadî

Offline

#8 2022-01-22 22:59:39

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

I can definitely say that libinput and logind correctly detects lid events. SW_LID warning thrown after another suspend test, so I think it can be ignorant for now.

Offline

#9 2022-01-22 23:39:57

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

Tried this kernel parameters. Nothing happened. Not sure if this is correct values, found its in the microsoft article and "Windows 2017" mentioned in my DSDT.

acpi_os_name="Linux"
acpi_os_name="Windows 2017"
acpi_os_name="Windows 2019"
acpi_os_name="Windows 2020"
acpi_osi="Linux"
acpi_osi="Windows 2017"
acpi_osi="Windows 2019"
acpi_osi="Windows 2020"
#!/bin/sh

base="root=PARTUUID=50173cf6-3018-4924-8b91-a5e5d6e273ae rw i8042.nopnp=1 initrd=\amd-ucode.img"
resume="resume=UUID=ca30eb5c-6d2b-435e-a04b-df49c8954ad8"

efibootmgr \
	--label "Arch zen osi" \
	--disk /dev/nvme0n1 \
	--part 1 \
	--create \
	--loader /vmlinuz-linux-zen \
	--unicode "$base quiet initrd=\booster-linux-zen.img $resume booster.log=debug acpi_os_name=\"Windows 2020\"" \
	--verbose

Last edited by hxss (2022-01-23 00:25:39)

Offline

#10 2022-01-23 00:03:20

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

oh in case this is important - this errors throws in logs at every boot:

2022-01-23T02:48:19+0300 hp kernel: ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index (0x000000005) is beyond end of object (length 0x5) (20210930/exoparg2-393)
2022-01-23T02:48:19+0300 hp kernel: ACPI Error: Aborting method \_TZ.GTTP due to previous error (AE_AML_PACKAGE_LIMIT) (20210930/psparse-529)
2022-01-23T02:48:19+0300 hp kernel: ACPI Error: Aborting method \_TZ.CHGZ._TMP due to previous error (AE_AML_PACKAGE_LIMIT) (20210930/psparse-529)
2022-01-23T02:48:19+0300 hp kernel: ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index (0x000000005) is beyond end of object (length 0x5) (20210930/exoparg2-393)
2022-01-23T02:48:19+0300 hp kernel: ACPI Error: Aborting method \_TZ.GTTP due to previous error (AE_AML_PACKAGE_LIMIT) (20210930/psparse-529)
2022-01-23T02:48:19+0300 hp kernel: ACPI Error: Aborting method \_TZ.CHGZ._TMP due to previous error (AE_AML_PACKAGE_LIMIT) (20210930/psparse-529)

The only googled page advises to ignore it.

Offline

#11 2022-01-23 00:49:10

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

so I successfully recompiled dsdt up to dsdt.aml. But I missed, what should I fix in it? I dont have dsdt errors in logs, yet.

Last edited by hxss (2022-01-23 00:59:41)

Offline

#12 2022-01-23 11:42:43

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: How to wake up from suspend by laptop keyboard or lid open?

I don't have any experience with DSDT but if you post the exact steps you have taken so far then perhaps somebody who has experience will be able to guide you further.


Jin, Jîyan, Azadî

Offline

#13 2022-01-23 14:26:48

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

I just followed the wiki steps:

# dmesg | grep DSDT
# cat /sys/firmware/acpi/tables/DSDT > dsdt.dat
$ iasl -d dsdt.dat
$ iasl -tc dsdt.dsl

The case is I didnt get for what I need to do this and what to modify in the dsdt. I have neither dsdt errors in logs nor errors on decompiling/recompiling dsdt.

Offline

#14 2022-01-23 14:30:15

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

Also found the mailing list. Seems like ps2 keyboard wake up support was added in 2015. May be this is kernel bug?
In bios I dont see any option for keyboard wake up. Lid wake up activated in bios, but this manages switching on.

Offline

#15 2022-01-23 14:43:31

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

and there is no button module in

$ ls -l /usr/lib/modules/$(uname -r)/kernel/drivers/acpi

Tested on original, zen and lts kernels.

Last edited by hxss (2022-01-23 14:44:08)

Offline

#16 2022-02-09 17:33:46

hxss
Member
Registered: 2017-10-17
Posts: 34

Re: How to wake up from suspend by laptop keyboard or lid open?

seems like there is just no waking function by keyboard or lid(devices KBC0 and LID).

Can anyone help edit the dsdt?

Offline

Board footer

Powered by FluxBB