2023-04-24, 02:40 AM
I'm not sure why Windows is choosing to go to sleep that quickly. The 'sleep unattended idle timeout' should only start counting from when NextPVR tell Window's it's no longer in use.
2023-04-24, 02:40 AM
I'm not sure why Windows is choosing to go to sleep that quickly. The 'sleep unattended idle timeout' should only start counting from when NextPVR tell Window's it's no longer in use.
2023-04-24, 02:50 AM
I would set unattended sleep to zero and just let regular sleep settings control sleep and see what happens in your case.
Martin (2023-04-24, 02:40 AM)sub Wrote: I'm not sure why Windows is choosing to go to sleep that quickly. The 'sleep unattended idle timeout' should only start counting from when NextPVR tell Window's it's no longer in use. If the server is fast enough, streaming one channel isn't demanding enough for Windows to consider it active as mentioned here. It seems logical as you say that while a power request is active, Windows 11 shouldn't consider the system to be idle but it seems the idle timer doesn't take power requests into account in practice. @Martin: I'll try to set 'sleep unattended idle timeout' to zero as you said and see what that does. I didn't even know about this hidden setting until you taught me about it. Currently it's set equal to my hibernate timeout.
2023-04-29, 04:12 AM
(2023-04-24, 02:50 AM)mvallevand Wrote: I would set unattended sleep to zero and just let regular sleep settings control sleep and see what happens in your case.I have now set unattended sleep to zero as you suggested and it didn't make any difference to the sleeping too early issue. (2023-04-24, 02:40 AM)sub Wrote: I'm not sure why Windows is choosing to go to sleep that quickly. The 'sleep unattended idle timeout' should only start counting from when NextPVR tell Window's it's no longer in use.I set "hibernate after" to 5 min for quick testing ("sleep after" is never). Below is a tweaked powershell script gotten online that reads the "hibernate after" setting, creates a power request, waits for that amount of seconds then removes the request and exits. I ran the script twice (the second time adding 3 min to the hibernateSettingSeconds variable) and observed the following. Code: 10:52: started 5 min power request On my Windows 11 Pro it appears the power request only prevents the machine from hibernating/sleeping while it is present but does not prevent the timer from counting down. If the task were demanding enough (NextPVRServer and this script are not), then the CPU activity would prevent the timer from counting down (not the power request). If I can provide any extra useful information about my server please ask. Code: # ---------------------------------------------------
2023-04-29, 03:15 PM
(This post was last modified: 2023-04-29, 03:30 PM by mvallevand.)
Looking at the script I see a problem since you allow sleep with
$ste::SetThreadExecutionState($ES_CONTINUOUS) and I think you also need to reset the timer https://learn.microsoft.com/en-us/window...dfrom=MSDN $ste::SetThreadExecutionState($ES_CONTINUOUS | $ES_SYSTEM_REQUIRED) Maybe this is the issue with NextPVR too? Both seem to required for Windows 11 https://stackoverflow.com/questions/7243...eep-on-win Martin
2023-04-29, 04:23 PM
(2023-04-29, 03:15 PM)mvallevand Wrote: and I think you also need to reset the timer https://learn.microsoft.com/en-us/window...dfrom=MSDNLooks like you may have figured this out. Nice! I'll try the script with the changed line you gave above on the same Win11 Pro system and observe. Could be an idiosyncrasy of Win11.
2023-04-29, 07:27 PM
Just like the winscp author in the stackoverflow link you gave, I can't get the sleep script to work in Win11 the way it did in Win10. Not only does the timer not reset in Win11 anymore on ES_SYSTEM_REQUIRED calls, there is no longer a grace period and systems can sleep right after the power request is lifted as this comment explains.
It seems NextPVRService on Win11 will need to postpone removing the power request for an appropriate/configurable delay after streaming ends.
2023-04-29, 07:41 PM
Did you do your testing or'ing them together?
Martin
2023-04-29, 08:15 PM
Yes and learned that -bor is binary or in powershell. I tried these three combinations and nothing worked. I tend to forget what I'm testing while I'm testing so if someone with access to Win11 could try that would be more conclusive.
Code: $ste::SetThreadExecutionState($ES_CONTINUOUS -bor $ES_SYSTEM_REQUIRED) Code: $ste::SetThreadExecutionState($ES_CONTINUOUS -bor $ES_SYSTEM_REQUIRED) Code: $ste::SetThreadExecutionState($ES_SYSTEM_REQUIRED) That stackoverflow Q&A seems to show Win11 is by design much more aggressive at going to sleep than Win10.
2023-04-30, 12:57 AM
(This post was last modified: 2023-04-30, 01:03 AM by mvallevand.)
I did some tests with netcore and saw something similar However what if you add -bor $ES_DISPLAY_REQUIRED to the first call? It doesn't make sense but it worked for me.
Martin |
|