Autosuspend not working but manual suspend works

OS: EndeavourOS Linux x86_64
Host: B850M AORUS ELITE WIFI6E ICE -CF-WCP-ADO
Kernel: 6.18.7-arch1-1
DE: Plasma 6.5.5
Wayland

I can run systemctl suspend and the system will go to sleep perfectly.

I have dim screen at 30 seconds. I have when inactive: sleep 1 minute.

If I wait 1 minute, I see the screen dim at 30 seconds, however at the 1 minute mark I get this in journalctl -b0 -f
Feb 03 10:47:30 endeavorOs systemd[1]: Started dbus-:1.2-org.kde.powerdevil.wakeupsourcehelper@1.service.
Feb 03 10:47:40 endeavorOs systemd[1]: dbus-:1.2-org.kde.powerdevil.wakeupsourcehelper@1.service: Deactivated successfully.

Yet nothing happens, there is no sleep.

Some more information:
$loginctl show-session “$XDG_SESSION_ID” -p IdleHint -p IdleSinceHint
IdleHint=no
IdleSinceHint=0

 systemd-inhibit --list
WHO            UID  USER PID   COMM            WHAT                                                                       WHY                                         MODE
NetworkManager 0    root 746   NetworkManager  sleep                                                                      NetworkManager needs to turn off networks   delay
Realtime Kit   0    root 1016  rtkit-daemon    sleep                                                                      Demote realtime scheduling and stop canary. delay
UPower         0    root 1101  upowerd         sleep                                                                      Pause device polling                        delay
PowerDevil     1000 alex 17610 org_kde_powerde handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch KDE handles power events                    block

4 inhibitors listed.

Hi, and welcome to the comunity :enos_flag:

It looks like your problem is similar to the issue(s) described here https://bugs.kde.org/show_bug.cgi?id=510992#c8

TLDR kernel bugs exposed via improved KDE functionality :laughing:

The proposed workaround is to remove the executable bit from wakeupsourcehelper

sudo chmod -x /usr/lib/kf6/kauth/wakeupsourcehelper

Unfortunately I already did that and the comments at the end of that thread are from me.

Removing x from wakeupsourcehelper ends up with these errors:

Feb 03 20:38:00 endeavorOs (wakeupsourcehelper)[2795]: dbus-:1.2-org.kde.powerdevil.wakeupsourcehelper@0.service: Unable to locate executable ‘/usr/lib/kf6/kauth/wakeupsourcehelper’: Permission denied
Feb 03 20:38:00 endeavorOs (wakeupsourcehelper)[2795]: dbus-:1.2-org.kde.powerdevil.wakeupsourcehelper@0.service: Failed at step EXEC spawning /usr/lib/kf6/kauth/wakeupsourcehelper: Permission denied
Feb 03 20:38:00 endeavorOs systemd[1]: dbus-:1.2-org.kde.powerdevil.wakeupsourcehelper@0.service: Main process exited, code=exited, status=203/EXEC
Feb 03 20:38:00 endeavorOs systemd[1]: dbus-:1.2-org.kde.powerdevil.wakeupsourcehelper@0.service: Failed with result ‘exit-code’.
Feb 03 20:38:00 endeavorOs org_kde_powerdevil[1409]: Failed to write wakeup_count: “DBus Backend error: service start org.kde.powerdevil.wakeupsourcehelper failed: Could not activate remote peer ‘org.kde.powerdevil.wakeupsourcehelper’: unit failed”

Oh, alright, I see. May I propose another workaround then.

You were saying that invoking systemctl suspend works fine, so in the Power Management settings in the Other Settings section, select run condition “When inactive” and enter systemctl suspend command with a a different timeout, say something like 55 seconds

It might work. Good luck.

1 Like

That does work as a workaround! Thank you very much.

Well, unfortunately, the Other Settings, when inactive does not take into account if a video or other source is blocking sleep and will only execute based on time since last input. Meaning it will sleep while watching a video. So not quite a solution but thanks for the help regardless.

Ah, KDE, always missing the details.
It’s not a big deal, we can create a small script that will check if there are any inhibitions before suspending

The one-liner for you :laughing:

#!/bin/bash
[ "$(busctl --user call org.kde.Solid.PowerManagement.PolicyAgent /org/kde/Solid/PowerManagement/PolicyAgent org.kde.Solid.PowerManagement.PolicyAgent HasInhibition u 1 | awk '{ print $2 }')" = "false" ] && systemctl suspend

Save it to a file, make the file executable, and use it instead of systemctl suspend command.

Disclaimer, have not tested this thoroughly, you may need to adjust it to your needs.

2 Likes

Based one liner thank you. Marking as solved! Thank you!!!:star_struck:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.