Author Topic: [WISH] 'Prevent Display From Sleeping' Preference  (Read 14738 times)

dm123

  • Newbie
  • *
  • Posts: 6
In Windows you can programmatically prevent the display from 'sleeping' (edit: SetThreadExecutionState) and it would be great to see this as a preference in MusicBee.

This would solve the problem of music cutting off when using HDMI in a HTPC environment with the display set to automatically sleep. This matter has been raised before but I'm not sure if this solution was considered. I suspect not because the issue was quickly (and unfairly IMHO) dismissed.

MusicBee is (nearly) ideal for a HTPC and many HTPC's pump their audio and video via HDMI. Depending on the equipment in use if the HDMI video signal stops the line is considered 'off' and audio ceases. Adjusting the Windows Power Policy to 'never sleep' (or similar) just to accommodate MusicBee would be a very cumbersome approach in the face of a more elegant solution.

A user option to 'Prevent display from sleeping while playback is active' (default: on) would be a perfect and unobtrusive solution.

I appreciate you're busy with a long list of requests and improvements but hope you'll have the time to consider this valuable functional request.

I enjoy using MusicBee, keep up the good work and thank you.

Edit #2: I changed the suggested default state to 'on' - I think I only typed 'off' because that would replicate current behaviour in MusicBee (which I believe to be incorrect). The computer should not be able to sleep when playback is active (default).
Last Edit: November 03, 2014, 09:26:34 AM by dm123

dm123

  • Newbie
  • *
  • Posts: 6
How is this not annoying the hell out of everybody?

I'm astonished this request hasn't even been acknowledged considering some of the otherwise trivial requests that get airtime.

Has nobody else noticed your computer will go to sleep in the middle of a playlist, like no other media player on earth?  ???

The app is awesome but let's not overlook the basics in pursuit of the bells and whistles.

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
Has nobody else noticed your computer will go to sleep in the middle of a playlist, like no other media player on earth?  ???
I don't but I'm usually using my PC when I'm playing music so it's not going to sleep.

It does sound like the sort of thing that would annoy more people solely using MusicBee for a HTPC setup though. What equipment are you using? Is there an option somewhere in the chain that allows an HDMI display to be turned off but audio to continue?

Until your request is considered, you might be able to MacGyver a couple of toolbar buttons in MB that use the powercfg command to disable sleeping while you are playing music.

e.g.
To disable sleeping (on a PC running on AC power):
powercfg -change -standby-timeout-ac 0

To enable sleeping after 15 minutes of inactivity:
powercfg -change -standby-timeout-ac 15

I'm not sure if you can create toolbar buttons in MB to run batch files, but I think it should work. It's not very elegant, but still a lot easier than digging into the power options every time you start or stop playing music.

-edit-
Forgot to mention the default for any such setting should definitely be off. Leaving the display on when the computer isn't in use is the exception to the norm (i.e. contrary to what the Power Options control panel says), so any user who wants that behaviour needs to "opt in".
Last Edit: November 21, 2014, 06:30:54 AM by Zak
Bee excellent to each other...

redwing

  • Guest
I'm not sure if you can create toolbar buttons in MB to run batch files

That's supported using external tools command.

dm123

  • Newbie
  • *
  • Posts: 6
Thanks for the reply! Very innovative workarounds! :D

-edit-
Forgot to mention the default for any such setting should definitely be off. Leaving the display on when the computer isn't in use is the exception to the norm (i.e. contrary to what the Power Options control panel says), so any user who wants that behaviour needs to "opt in".

Sorry for any confusion, all I'm saying is that no sleep state should be allowed during activity (playback) unless the user allows it. I'm just asking for default Windows behaviour.


Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
i have done this so when a track is playing then the screen and system will stay awake (except if the auto-shutdown timer is active).
Its possible i might change this if there is negative feedback but given other apps do the same i think it should be ok

unzip and replace the existing files:
http://musicbee.niblseed.com/V2_5/MusicBee_Exe_Patched.zip

dm123

  • Newbie
  • *
  • Posts: 6
i have done this so when a track is playing then the screen and system will stay awake (except if the auto-shutdown timer is active).
Its possible i might change this if there is negative feedback but given other apps do the same i think it should be ok

unzip and replace the existing files:
http://musicbee.niblseed.com/V2_5/MusicBee_Exe_Patched.zip

Thanks for looking in to this!

So I replaced the files and started MusicBee but didn't notice anything different, my screen when to sleep just like before. Is there a configuration I need to change to activate it, I had a look but didn't immediately notice anything?

FWIW - I'm using the standard 'Balanced' Windows power plan with a couple of minor adjustments on Win 8.1 Pro x64. MusicBee reports version 2.5.5443 after applying the patch above.



Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
i took keeping the screen awake out because it was probably the cause of an issue for someone else. I dont want to add an option for this but havent made a final decision

dm123

  • Newbie
  • *
  • Posts: 6
i took keeping the screen awake out because it was probably the cause of an issue for someone else. I dont want to add an option for this but havent made a final decision

I understand but I still think you should follow standard operating procedure for Windows. If people *want* their system to sleep whilst it's playing music then they're the exception for sure - this is a ridiculous (and counter intuitive) expectation.

Nobody has the right to complain if you implement standard (expected) Windows behaviour. If the system is in "playback mode" there is *no* circumstance where a suspend procedure should be automatically initiated (without explicit consent).

If an isolated group feel they need their screen to sleep during playback (and not initiate system sleep?????????) then that should be an explicit option they select, not one applied by default to all.

I'd like to hear the logic of those that feel they need this 'auto-sleep even if I'm playing music' functionality.


Last Edit: November 27, 2014, 08:58:41 AM by dm123

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
the change still includes forcing the computer not to sleep while a track is playing - just the display is still allowed to sleep.
I dont agree with your comments about windows default behavior because i have to add something special to change the windows default behavior

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3833
  • MB Version: 3.6.8849 P
I was going to adapt the sample code available here to make a plugin to achieve this.

At the moment updating my skins is keeping me busy enough, so, maybe somebody else might like to have a go at this.
MusicBee and my library - Making bee-utiful music together

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
Nobody has the right to complain if you implement standard (expected) Windows behaviour.
Standard (and expected) Windows behaviour is for the display to be blanked after a specified period of inactivity unless the user requests otherwise. This is to reduce power usage and prevent screen burn-in and generally extend the life of the monitor. If a program is going to override the system-wide settings I have specified in the Power Options control panel without telling me, then yes I have the right to complain.

If the system is in "playback mode" there is *no* circumstance where a suspend procedure should be automatically initiated (without explicit consent).
Actually, there is such a circumstance, and it's called not relying on HDMI audio on a HTPC with an insufficiently lengthy screen sleep period. Presumably it's a circumstance most MusicBee users find themselves in as no one has raised this before.


If an isolated group feel they need their screen to sleep during playback (and not initiate system sleep?????????) then that should be an explicit option they select, not one applied by default to all.
Isolated group? Thousands of otherwise happy people have been using MusicBee in all manner of environments for years and to date only one person (i.e. you) has raised this issue. How does every other MusicBee user suddenly fall into an isolated group?  :-\

Do you really expect every other MusicBee user to leave their monitors on all day to solve the problem you're having? Sorry, but in this case you are the exception and it's a bit rich to expect the solution to your problem to be forced on everyone.
Bee excellent to each other...

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3833
  • MB Version: 3.6.8849 P
Thousands of otherwise happy people have been using MusicBee in all manner of environments for years and to date only one person (i.e. you) has raised this issue. How does every other MusicBee user suddenly fall into an isolated group?  :-\

Despite the OP's inaccuracies about standard Windows behaviour, I do think this should be an available option.

Most media players (note: not necessarily music players) have an 'always on' switch that suspends both the screensaver and sleep mode.  With its enhanced Artist image view, I think it's something that should have been introduced with the Compact player.  But, as long time forum users would remember, there was a lot going on then and I wasn't about to add another item to the Wishlist.

I've been using a little tray app (NoSleep) for when I'm using the Compact player or TheaterMode, but having a built-in option or a plugin, working from MB, would be a better idea.
MusicBee and my library - Making bee-utiful music together

dm123

  • Newbie
  • *
  • Posts: 6
Thanks for all the comments, not looking to antagonise anyone. This issue has been raised (and dismissed outright) in the past.

Okay, forget the "default" request - I'd hate for the discussion to get distracted from the required functionality because of semantics.

An option, with any default setting, to prevent the screen from sleeping would be just fine. I'm happy to swallow my pride and say I asked the wrong way or for the wrong thing or whatever if it prevents distraction from the merits of the request.



scooter.pave

  • Guest
i have done this so when a track is playing then the screen and system will stay awake (except if the auto-shutdown timer is active).
Its possible i might change this if there is negative feedback but given other apps do the same i think it should be ok

unzip and replace the existing files:
http://musicbee.niblseed.com/V2_5/MusicBee_Exe_Patched.zip

So I replaced the files but it still goes to sleep while I am playing music.  Anything else you can suggest?  Thanks.