Standby stops the music

Hi, for some time my screen goes to sleep while I listen to music on spotify, so the music stops dead, I have to move the mouse to hear it again.
In System Configuration (KDE) “Pause media players when going to sleep” is however unchecked… well, alas, it doesn’t work!
Even with the latest updates the problem is still not fixed.

What app your use to spotify ?

Web browser and with the spotify app same problem !

Here I never had this problem using Plasma

T+ = See you later

Did you ever find a fix to this problem? It’s driving me insane, seems to be a problem in every Linux distro with Youtube Music and listening in a browser. Watch a video seems fine. Tried different browsers but nothing seems to prevent the PC from sleeping. I don’t know if its a fault of the browser or KDE is the problem, I have a feeling its the browser and/or the steaming platform(?) but I don’t know enough about the sleep/kde/browser/platform interactions to know where to start.

The problem is that those apps lack the implementation of sleep inhibition for audio playing, for example Elisa (audio player) can prevent sleep/locking while playing audio music

Screenshot_20240218_225234

To force Plasma to disable sleep and screen locking, enable this option in Battery and Brightness widget

Screenshot_20240218_223317

At least some of the posters mention using the browser.
We dont know which ones though, let alone whether they have things like plasma-browser-integration in use.

https://wiki.archlinux.org/title/Firefox#KDE_integration

In some other cases you may have virtually no option. Depending on the software itself.
I know I have made wrapper scripts that would inhibit sleep (Something like refresh every 5 seconds) while launching the program, with an extra desktop entry like “Insomnia-Spotify-Player”.
But I found that users tend to forget about these things … so it was common to then find the app has been kept open and so the systems left on in the insomniac state for days.
Its probably better to just encourage the use of “Manually Block Sleep”, as shown above.

1 Like

Problem still unresolved for me. I think the problem is with KDE.
The sound stops when the computer goes into standby mode, whether it’s :
listening to Internet radio with Firefox,
using Spotify with the app from AUR,
using Elisa.

I have a desktop

I’m daily using Elisa to play music, and it prevents sleep and screen locking when it plays audio.
Did you install another power management tool like TLP, system76-power…?

If you use an app that doesn’t implement the protocol to inhibit sleep and screen-locking when only audio is playing, you can force it for that specific app via:

kde-inhibit --power --screenSaver <app command>
This command will launch the app and prevent sleep and screen locking until it’s closed.

TLP, system76-power… I have neither

I’ve been doing some testing with KDE/Gnome and various distros and browser combinations.

It seems like it’s a Firefox bug specifically with audio. When playing a video you get the “Firefox is enforcing presentation mode” in the display settings, but you don’t get it for audio, nor do you get “Firefox is preventing sleep” (which I’m sure you used to).

Interesting Chrome seems to work fine for both Audio and Video but KDE doesn’t seem to display anything in the system tray. When playing audio it allows the screen to power off and keeps the screen awake when watching a video.

Whilst yes running things through something like caffeine or a script is possible it seems more of a workaround than a fix.

The problem is, I don’t know enough about how all of this hangs together to start debugging nor do I know who I should actually log a big report with.

Any suggestions?

Did you try plasma browser Integration like @cscs suggested above, because you’ll get an icon in the tray when playing media in the browser.

1 Like

Yeah, I always have the Plasma integration running as I use it to control music with my phone whilst not sat at the computer, hence it’s really annoying when it just sleeps on me.

Doing some more testing, Elisa does seem to handle the screen locking and sleep as expected. But firefox is not listed even though it is playing music at the same time.

Screenshot_20240227_075112

It does however enforce presentation mode.
Screenshot_20240227_075144

Do we conclude this is a Firefox problem?

I tested Elisa, SMPlayer/VLC, and Firefox/Chromium with Plasma Integration extension installed on both:

Chromium

  • Automatically inhibits sleep and screen locking while the tab playing video is currently selected,

    Screenshot_20240227_134452

  • Automatically inhibits sleep and screen locking while the tab playing audio is currently selected or not, but in some websites it disables the inhibition so it needs pausing and playing again the audio.

    Screenshot_20240227_134115

Firefox

  • Automatically inhibits sleep and screen locking while the tab playing video is currently selected,

    Screenshot_20240227_135232

  • Firefox fails to trigger inhibition while only audio is playing.

Elisa

Automatically inhibits sleep and screen locking while audio is playing in the background.

Screenshot_20240227_135835

SMPlayer/VLC

  • Automatically inhibits sleep and screen locking with audio and video playing in background even if inhibition option is available only on video tab settings.

    Screenshot_20240227_141348

  • VLC on other hand, automatically inhibits sleep and screen locking with only video playing in background and inhibition option is also available only on video tab settings.

I got bored and decided to log a bugzilla and got this as the response:

In short, it’s been known for 4 years and there is no fix in the works as far as I can see. Going to look tonight at compiling Firefox and maybe creating a pull request or something.

Edit: I’ve just looked (briefly) at all the blockers, needless to say it may take a while to get this resolved. Looks like we’re reduced to using a different method/browser for now.