[Testing - Trixie] [Solved] Suspend broken, power button now prompts for shutdown

- - ALL UNSTABLE / TESTING THREADS SHOULD BE POSTED HERE - -
This sub-forum is the dedicated area for the ongoing Unstable/Testing releases of Debian. Advanced, or Experienced User support only. Use the software, give, and take advice with caution.
Post Reply
Message
Author
jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

[Testing - Trixie] [Solved] Suspend broken, power button now prompts for shutdown

#1 Post by jost-s »

Running GNOME on a desktop PC, suspend has been working reliably and was configured to be triggered by the power button out fo the box.

I don't know what I've changed or if it was some package upgrade, but more often than not suspend is broken. When I press the power button now, I'm prompted for a shutdown. When I select "Suspend" from the system menu, nothing happens.

`systemd-inhibit` outputs:

Code: Select all

$ systemd-inhibit 
WHO            UID  USER PID  COMM            WHAT                                                     WHY                                       MODE 
ModemManager   0    root 987  ModemManager    sleep                                                    ModemManager needs to reset devices       delay
NetworkManager 0    root 960  NetworkManager  sleep                                                    NetworkManager needs to turn off networks delay
UPower         0    root 1291 upowerd         sleep                                                    Pause device polling                      delay
GNOME Shell    1000 jost 1947 gnome-shell     sleep                                                    GNOME needs to lock the screen            delay
jost           1000 jost 2115 gsd-media-keys  handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses                 block
jost           1000 jost 2115 gsd-media-keys  sleep                                                    GNOME handling keypresses                 delay
jost           1000 jost 2117 gsd-power       sleep                                                    GNOME needs to lock the screen            delay
jost           1000 jost 1916 gnome-session-b sleep                                                    user session inhibited                    block

8 inhibitors listed.
After a restart suspend works from system menu as well as power button, but after using applications for a while, It stops working. I need to log out and then can suspend.

How can I diagnose what the issue is?
Last edited by jost-s on 2024-12-19 13:19, edited 4 times in total.

User avatar
sunrat
Site admin
Site admin
Posts: 7477
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 135 times
Been thanked: 670 times

Re: Suspend broken, power button now prompts for shutdown

#2 Post by sunrat »

Moved to Testing and Unstable
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#3 Post by jost-s »

I'm pretty sure now after some trying that it has to do with my browser. When suspend doesn't work and instead the shutdown prompt appears, I close the browser and suspend works as expected. Could it be some media playback that's inhibiting suspend and causing this weird behavior?

jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#4 Post by jost-s »

Yes, that was the culprit. It's a particular website that streams video content. When its tab is open, I cannot suspend. Closing that tab enables suspending again. Is that intended behavior?

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2551
Joined: 2010-06-07 16:59
Has thanked: 50 times
Been thanked: 282 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#5 Post by FreewheelinFrank »

jost-s wrote: 2024-12-17 22:37 Yes, that was the culprit. It's a particular website that streams video content. When its tab is open, I cannot suspend. Closing that tab enables suspending again. Is that intended behavior?
I believe so: Firefox is asking Gnome not to lock or blank the screen or to suspend on the assumption that you are watching something, or the website contains a request not to lock/blank/suspend.

jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#6 Post by jost-s »

Agreed. I doubt that It's intended to display the shutdown prompt instead. Also it's confusing that the browser doesn't show up under `systemd-inhibit`.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2551
Joined: 2010-06-07 16:59
Has thanked: 50 times
Been thanked: 282 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#7 Post by FreewheelinFrank »

jost-s wrote: 2024-12-18 02:14 Agreed. I doubt that It's intended to display the shutdown prompt instead. Also it's confusing that the browser doesn't show up under `systemd-inhibit`.
I had a look for some documentation on how Firefox does this, but could not find anything definitive, so I'm just guessing here.

I suspect suspend is disabled along with blank and lock screen as part of the process of keeping the screen on while media is playing - an intended action. If the user opts to shutdown, then they obviously don't want to continue watching the media, and there would be no reason to block the request. I can only imagine there is no override process in the user-selected suspend option via the power button because nobody envisaged that the user might want to suspend while watching media.

I have seen reference to the following command. Is the output any different with the tab open?

Code: Select all

gnome-session-inhibit --list
https://forums.mozillazine.org/viewtopic.php?t=3126162

Could Firefox be using DBus and org.freedesktop.PowerManagement rather than Systemd?

https://bugzilla.mozilla.org/show_bug.cgi?id=1862159

Edit: format.

jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#8 Post by jost-s »

Thanks for the investigation.
I suspect suspend is disabled along with blank and lock screen as part of the process of keeping the screen on while media is playing - an intended action. If the user opts to shutdown, then they obviously don't want to continue watching the media, and there would be no reason to block the request. I can only imagine there is no override process in the user-selected suspend option via the power button because nobody envisaged that the user might want to suspend while watching media.
I agree. I was surprised to see a shutdown from pressing the power button, because I learned that it was changed by the GNOME team to not being configurable for the power button.

The first link shows a 404 for me.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2551
Joined: 2010-06-07 16:59
Has thanked: 50 times
Been thanked: 282 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#9 Post by FreewheelinFrank »

Sorry, it's a command not a link. Wrong tags used - corrected.

jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#10 Post by jost-s »

Haha, I didn't figure that out!

Yes, that's showing the difference (with and without the tab open):

Code: Select all

~ $ gnome-session-inhibit --list
firefox-esr: video-playing (idle)
~ $ gnome-session-inhibit --list
No inhibitors

jost-s
Posts: 7
Joined: 2024-11-25 16:01
Has thanked: 2 times

Re: [Testing - Trixie] Suspend broken, power button now prompts for shutdown

#11 Post by jost-s »

If there's nothing wrong here, I'll consider this resolved.

Post Reply