Prevent Sleep when Streaming

Get answers about the current version of MediaMonkey for Windows

Moderator: Gurus

GMGJ
Posts: 130
Joined: Mon Mar 12, 2007 3:17 pm
Contact:

Prevent Sleep when Streaming

Post by GMGJ »

I have an LG tv running LG's Webos
Running MediaMonkey 5 (Help About MM 2024) latest version
I can have both Media Monkey Library and Media Monkey Service checked and available.
I could install it as a service.
What settings can I use to play the Library or the Server on the LG, and let the screen on my laptop go blank, but have MediaMonkey prevent the PC from going to sleep? :roll: :wink:
Peke
Posts: 18215
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Prevent Sleep when Streaming

Post by Peke »

Hi,
That you can archive in Laptop power options eg.
Image

As you use Laptop you can set Sleep setting differently when on Battery.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
GMGJ
Posts: 130
Joined: Mon Mar 12, 2007 3:17 pm
Contact:

Re: Prevent Sleep when Streaming

Post by GMGJ »

Thank you for replying. I do not know what you mean by archive in? I like my normal settings, except for when I stream music. Then I want the screen off and the PC running. If the streaming to device does not request something from the source for more than, for example, 30 minutes, then go to sleep. Let me call this ideal the keep the wife happy option. The source code for power toys awake is here: https://github.com/microsoft/PowerToys. I sometimes use Caffeine for situations like this. Both options force me to make changes from my normal setup and keep the screen on. I use .cmd files to start multiple applications, like I will start Unified Remote and MediaMonkey at the same time for my workouts. I experimented with some PowerShell scripts to automate this but, alas, I am not ready to climb the PowerShell learning curve. 71 year old. I wrote my first program in 10 minutes, it took me 2 1/2 hours to keypunch it. Love the monkey and appreciate all the help you give. I would not ask, but this seems like a thing most people would want.
Peke
Posts: 18215
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Prevent Sleep when Streaming

Post by Peke »

Hi,
OK,
We each other have own things that we relies on or got used too.

Here is simple Script To turn that ON/OFF.

Set Sleep and Hibernate OFF [SleepOff.cmd]:

Code: Select all

@PowerCfg /x standby-timeout-ac 0
@PowerCfg /x standby-timeout-dc 0
@PowerCfg /x hibernate-timeout-ac 0
@PowerCfg /x hibernate-timeout-dc 0
Set Sleep and Hibernate ON [SleepOn.cmd] (set Tweak Minutes according to your needs):

Code: Select all

@PowerCfg /x standby-timeout-ac 15
@PowerCfg /x standby-timeout-dc 15
@PowerCfg /x hibernate-timeout-ac 30
@PowerCfg /x hibernate-timeout-dc 30
As that needs to be started As Administrator after you create those two files do this:
1. Right click both on SleepOn.cmd and SleepOff.cmd -> Send To -> Shortcut (Desktop)
2. Right click on created Desktop shortcuts -> Properties -> Shortcut TAB -> Advanced Properties and enable Run as Administrator

After you have done that double clicking on Desktop Shortcuts will disable/enable Sleep and Hibernate without interfering Screen of Time.

If you are adventurer enough you can incorporate that into your existing .cmd files.

Lastly, have fun and Happy Monkeying!
GMGJ wrote: Mon Apr 28, 2025 8:20 am I would not ask, but this seems like a thing most people would want.
I not saying that I disagree, but usually users do that setting only once to their needs.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
GMGJ
Posts: 130
Joined: Mon Mar 12, 2007 3:17 pm
Contact:

Re: Prevent Sleep when Streaming

Post by GMGJ »

THANK YOU
I added
PowerCfg /x monitor-timeout-ac xx
PowerCfg /x monitor-timeout-dc xx
to mine
Peke
Posts: 18215
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Prevent Sleep when Streaming

Post by Peke »

Hi,
If you managed all that, then I guess you are lying about 71 :D :lol: :wink:

Happy Monkeying!
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
GMGJ
Posts: 130
Joined: Mon Mar 12, 2007 3:17 pm
Contact:

Re: Prevent Sleep when Streaming

Post by GMGJ »

I can no longer do computer work consciously. For around 30 years I worked with a new OS and a new language every couple of years. My mind says what are you do still mucking around with computers. But if I hypnotize myself, I can get low and medium level complexity stuff done. Just in Case (JIC) someone gets here and tries to do this. I add ac is main power, dc is battery. And again, thanks. :D :) 8)
GMGJ
Posts: 130
Joined: Mon Mar 12, 2007 3:17 pm
Contact:

Re: Prevent Sleep when Streaming

Post by GMGJ »

FYI, I live in a 3 story wood house. The floors giggle when we walk, and it is enough to trigger something in my mouse.
I turn my mouse off if I want to let my computer and display goto sleep

For the super lazy, display the current state of sleep in powershell

Code: Select all

# ac main dc battery 
# for shortcut target powershell.exe -ExecutionPolicy Bypass -File "This file"
#Get a list of all options for this plan
$Options = powercfg -query SCHEME_CURRENT
$index = 0
$line = '';

#Find index of line that contains Sleep Settings
For($i=0; $i -lt $Options.Length; $i++)
{
    $line = $Options[$i]
#    if($line -contains "VIDEOIDLE")
	    if($line.ToLower() -like "*standbyidle*")
    {
        echo $line.Trim()
        $index = $i
        break

    }        
}

#AC Setting is 5 lines later
$sleepSetting = $Options[$index + 5]
#trim off the beginning of the string, leaving only the value
$sleepSettingTrimmed = $sleepSetting.Substring($sleepSetting.IndexOf(":")+2)

#Show Current Setting
#hex to dec
$sleeptime = [uint32]"$sleepSettingTrimmed"

if($sleepSettingTrimmed -eq "0x00000000")
{
	Write-Host "Set for Streaming - Sleep is currently disabled on AC."
}
else
{
	write-host "Sleep Normal Time to Sleep on AC is currently $sleeptime seconds."
}

pause
------
adapted from https://superuser.com/questions/739658/ ... -windows-7

There are lots of premade power settings see below

Subgroup GUID: 9596fb26-9850-41fd-ac3e-f7c3c00afd4b (Multimedia settings)
Power Setting GUID: 03680956-93bc-4294-bba6-4e0f09bb717f (When sharing media)
Possible Setting Index: 000
Possible Setting Friendly Name: Allow the computer to sleep
Possible Setting Index: 001
Possible Setting Friendly Name: Prevent idling to sleep
Possible Setting Index: 002
Possible Setting Friendly Name: Allow the computer to enter Away Mode
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000000

Be nice if MickeySoft told us how to use them
Post Reply