I am using MP 1.9.0 pre, with the "aMPed" and "DefaultWide" skins, on 32-bit Vista.
Does PowerScheduler use the Windows function "SetThreadExecutionState()"? I scanned the PowerScheduler source, but could not find any references to this function. If PS does not use this function, what does it use to stop the system from sleeping or hibernating?
The reason that I am asking this is to try to find a solution to an intermittent failure that I am experiencing. My hardware does not work correctly with sleep, but it does work correctly with hibernation. Unfortunately, hibernation has poor usability for an HTPC, so to circumvent this poor usability I use a tool that I wrote myself, called HIBERMON ("Hibernation Monitor", not to be confused with any other tool of the same name available elsewhere on the internet). This tool worked without problem for two years with Windows Media Center, but when used with Media Portal it exposes some sort of "window of opportunity" in PowerScheduler's algorithm that allows Vista to hibernate the system just as a recording is starting (not every time -- I would estimate about 5% of unattended recordings fail in this way).
The way that I would expect it to work is this:
(1) "x" minutes before a recording is about to start, the HTPC wakes from hibernation.
(2) PS immediately uses "SetThreadExecutionState()" with the ES_CONTINUOUS, ES_SYSTEM_REQUIRED, and ES_AWAYMODE_REQUIRED flags to prevent the system sleeping or hibernating.
(3) The x-minute pre-record period then passes ("x" is 4 minutes in my case).
(4) The recording starts at the published start time less pre-padding, and continues until the published end time plus post-padding.
(5) PS then uses "SetThreadExecutionState()" with only the ES_CONTINUOUS flag (not sure about this), to allow the system to return to sleep or hibernation.
With the above algorithm, there is no window of opportunity that would allow Vista to hibernate the system near the start of the recording. So what is PowerScheduler doing that does seem to allow this? Thanks for any info.
-- from CyberSimian in the UK
Does PowerScheduler use the Windows function "SetThreadExecutionState()"? I scanned the PowerScheduler source, but could not find any references to this function. If PS does not use this function, what does it use to stop the system from sleeping or hibernating?
The reason that I am asking this is to try to find a solution to an intermittent failure that I am experiencing. My hardware does not work correctly with sleep, but it does work correctly with hibernation. Unfortunately, hibernation has poor usability for an HTPC, so to circumvent this poor usability I use a tool that I wrote myself, called HIBERMON ("Hibernation Monitor", not to be confused with any other tool of the same name available elsewhere on the internet). This tool worked without problem for two years with Windows Media Center, but when used with Media Portal it exposes some sort of "window of opportunity" in PowerScheduler's algorithm that allows Vista to hibernate the system just as a recording is starting (not every time -- I would estimate about 5% of unattended recordings fail in this way).
The way that I would expect it to work is this:
(1) "x" minutes before a recording is about to start, the HTPC wakes from hibernation.
(2) PS immediately uses "SetThreadExecutionState()" with the ES_CONTINUOUS, ES_SYSTEM_REQUIRED, and ES_AWAYMODE_REQUIRED flags to prevent the system sleeping or hibernating.
(3) The x-minute pre-record period then passes ("x" is 4 minutes in my case).
(4) The recording starts at the published start time less pre-padding, and continues until the published end time plus post-padding.
(5) PS then uses "SetThreadExecutionState()" with only the ES_CONTINUOUS flag (not sure about this), to allow the system to return to sleep or hibernation.
With the above algorithm, there is no window of opportunity that would allow Vista to hibernate the system near the start of the recording. So what is PowerScheduler doing that does seem to allow this? Thanks for any info.
-- from CyberSimian in the UK