this post was submitted on 04 Jun 2024
29 points (96.8% liked)

Linux

48137 readers
566 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
29
submitted 5 months ago* (last edited 5 months ago) by iggames@lemmy.world to c/linux@lemmy.ml
 

I have KDE set to Turn Off Screen after 5 minutes and to Sleep after 10 minutes of inactivity. This works when I first turn on the machine, but eventually stops working after a few hours of general use (mostly Firefox, VS Code, and some Steam games). Sometimes the screen isn't turning off at all, other times the screen turns off but the machine never goes to sleep. (Explicitly telling it to go to sleep from the main menu always works.)

EDIT: Seems like browser tabs or Steam are the likely culprits. I would often leave Steam running in the background, and KDE is suspending more reliably for me now after I close it. Possibly this steam-for-linux GitHub issue.

I figure there's either some sort of issue with KDE power management, or one (or more) applications are preventing it from sleeping. How do I troubleshoot this further?

systemd-inhibit just lists PowerDevil, which seems to be KDE's power management service:

$ systemd-inhibit --list --mode=block
WHO        UID  USER    PID  COMM            WHAT                                                                       WHY                      MODE 
PowerDevil 1000 iggames 4115 org_kde_powerde handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch KDE handles power events block

1 inhibitors listed.

One time, I clicked KDE's Power Management notification icon, and it showed me an app that was preventing sleep (a game that had not exited properly). Most of the time, however, it doesn't list anything.

Is there a way to see what apps are causing "activity" that would prevent PowerDevil from suspending the machine? What should I try next?

System details:

Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.8.11-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × 12th Gen Intel® Core™ i5-12400
Memory: 31.1 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B660M DS3H DDR4
all 10 comments
sorted by: hot top controversial new old
[–] gnuhaut@lemmy.ml 6 points 5 months ago (1 children)

Steam does block screensavers/dpms. Can you make sure steam isn't running in the background?

[–] iggames@lemmy.world 2 points 5 months ago (1 children)

I often leave Steam running in the background. Indeed, KDE seems to be suspending more reliably after I exit Steam. Thanks for the suggestion!

[–] gnuhaut@lemmy.ml 1 points 5 months ago* (last edited 5 months ago)

I think what's going on there is that your suspend thingy looks at the "idle time" (kept track of by the X server or (I assume) wayland compositor) to know when to do its thing. This idle time gets reset whenever you use the keyboard or mouse, but not when you use a controller, because games talk directly to the kernel for controller input, not X. This used to be a serious annoyance because screensavers/lockscreens/dpms kept enabling themselves while playing with a game controller.

Steam "fixed" this some years back, by interfering with this idle time in some way, so your screensaver/dpms/lock wouldn't start. But, annoyingly, steam does this all the time, not just while playing a game.

Bug report:

https://github.com/ValveSoftware/steam-for-linux/issues/5607

[–] baru@lemmy.world 3 points 5 months ago (1 children)

I highly recommend list-inhibitors. Not sure if this is the one I mean, the command line seems to match to the one I use: https://pypi.org/project/list-session-inhibitors/

This command gives a way nicer output.

For me Firefox often prevents the system from going to idle. If some page has a video it often seems to inhibit going to idle. Firefox strangely does that even if the video is paused.

For me and Firefox I'm often intend to do something about it. And then I don't for various reasons 😂

[–] iggames@lemmy.world 1 points 5 months ago

Looks like that script is for Gnome (based on the StackOverflow post listed on the project page, it talks to org.gnome.SessionManager via dbus). I wonder if there is a similar way to talk to PowerDevil?

[–] tsonfeir@lemmy.world 3 points 5 months ago

Melatonin works pretty well for me when I’m not sleeping and idle.

[–] Guenther_Amanita@slrpnk.net 2 points 5 months ago* (last edited 5 months ago) (2 children)

Same here. Like... forever now.
When I click "hibernate"/ "standby", the PC goes off for a second, and then switches on again. Resetting the energy settings to default helped for some time, but that only made it a bit less often IIRC, not fixing it.

On my laptop, that doesn't happen. I set it to go to standby if the lid closes, and it works as it should.

My thesis is, that there are different standby-states. KDE tries to force one explicit kind of it, and if the device doesn't support it, it won't go into standby properly.

On Gnome on the other hand, I never had problems with the standby on my PC. It's a KDE issue

[–] reddthat@reddthat.com 6 points 5 months ago* (last edited 5 months ago)

Close, that is because of the wakeup. (I think)

See all of your devices that make your computer: cat /proc/acpi/wakeup

Toggle all of them one by one:

echo GPP0 | sudo tee /proc/acpi/wakeup (where GPP0 is the item in the left hand column)

Cat again if you want to see if it's disabled

Keep going until you find the one that is 'waking' your computer back up after a sleep.

When you find the right one, add it to your crontab so it turns it off on every boot:

sudo crontab -e
@reboot echo "GPP0" > /proc/acpi/wakeup
[–] Vincent@feddit.nl 1 points 5 months ago

Unfortunately I have the same symptoms you do... On GNOME.

It doesn't always happen, but every now and then the system will get into a state that suspend doesn't work.