jellyfin-plugin-preventsleep icon indicating copy to clipboard operation
jellyfin-plugin-preventsleep copied to clipboard

Music streams don't prevent sleep

Open RamiPPA opened this issue 1 year ago • 3 comments

When streaming music the computer is not prevented to sleep. It works well with video.

My setup: Windows 11 Jellyfin server 10.9.11

RamiPPA avatar Oct 03 '24 19:10 RamiPPA

I took a look but could not reproduce it. Blocking sleep while streaming music seems to work as expected on my machine (Jellyfin Server 10.9.11, Prevent Sleep 0.2.0, Windows 10, both with the web client in Firefox on Windows 10 and in Firefox on Android).

  • What kind of client are you using to play back the music (web client in the browser or something else)? In the latter case, does this issue also appear when using the web client?
  • If that does not lead anywhere, could you provide some logs?
    • In the plugin settings, set Delay before unblocking sleep (in minutes) to 1.
    • Find the file logging.default.json in your config directory and set "Default": to "Debug".
    • Restart your server and make sure that no devices are connecting automatically (this can clutter the logs).
    • Play back a video for a minute, then wait for two minutes.
    • Play back a music file for a minute, then wait for two minutes.
    • Go to Administration -> Overview -> Log (or similar), download the most recent log.
    • Remove any personal information (if necessary) and upload it here.

jonschz avatar Oct 05 '24 12:10 jonschz

Thanks for the reply jonschz ! I found the problem in the web client (using chrome) from a different pc, but from the TV I didn't find this issue. I'm really busy these days but I'll try to reproduce the conditions which led to the problem and generate the logs that would bring some light to the issue.

BTW thanks a lot for the plugin. I wish that this eventually makes it to the holy "jellyfin core" which does nothing to help users with the carbon footprint.

RamiPPA avatar Oct 09 '24 20:10 RamiPPA

My hypothesis is that the affected client does not send the PlaybackProgress events for music, which this plugin relies on to tell that a stream is actively being watched. Another way to test that might the following:

  • Start playing some music.
  • Kill the browser mid-stream (e.g. using Task Manager)
  • Reopen the browser and check if the song starts over from the beginning
  • Check if the behaviour is different for videos

jonschz avatar Oct 12 '24 07:10 jonschz

I tried several times to reproduce the issue (trying to get the same conditions) and was not able to do so.

If I come across this again, I will report it with a full log.

Thanks

RamiPPA avatar Nov 04 '24 20:11 RamiPPA