Log in

View Full Version : Windows goes to sleep while BD Rebuilder is compressing


mposner
11th February 2011, 18:46
I am using version 0.37.03. The release notes indicated a fix to prevent Windows from sleeping while DB Rebuilder was compressing a disk. This does not work for me (Win7 64 bit).
In the past I have used the following to prevent Windows from going to sleep successfully:

EXECUTION_STATE WINAPI SetThreadExecutionState(
__in EXECUTION_STATE esFlags
);


SetThreadExecutionState(ES_CONTINUES | ES_SYSTEM_REQURED);

and this to allow it to go to sleep:

SetThreadExecutionState(ES_CONTINUES);

I hope this helps

jdobbs
11th February 2011, 23:37
This is what is currently used:

SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED | ES_CONTINUOUS)

It is executed at the beginning of every encode (call to X264).

and I use this to allow it to go to sleep:

SetThreadExecutionState(ES_CONTINUOUS)

It is executed at the end of each X264 call.

The only way I can see that your system might go to sleep is if you have the timeout so low that it will go to sleep during muxing or some other relatively low time demand process. I got another similar report, so I'm changing it for the next version so it gets disabled at the beginning of each complete job, and disabled when it is finished.

ilancas
12th February 2011, 17:03
The problem is that issuing that command does not reset the sleep timer, so if the pc thinks it has been idle for the "sleep after" time already, it will sleep straight away!

My issue is that my monitor doesn't sleep whilst BD RB is doing its stuff, so I have to turn if off manually in order not to waste 100+ watts of electricity (I have a large screen) when not using my pc for anything else.

jdobbs
12th February 2011, 18:32
The problem is that issuing that command does not reset the sleep timer, so if the pc thinks it has been idle for the "sleep after" time already, it will sleep straight away!

My issue is that my monitor doesn't sleep whilst BD RB is doing its stuff, so I have to turn if off manually in order not to waste 100+ watts of electricity (I have a large screen) when not using my pc for anything else. I'm changing the way it works in the next release. Also, in the next version you will be able to disable it if you don't want it.

mposner
13th February 2011, 18:49
The sleep timer on my system is set to 1 hr.

Setting at the begin of each job and resetting at the end should work. I have a small command line program that uses this code to prevent the system from going to sleep during a backup and it has worked (the backup program I was using did not prevent the system from sleeping). You might also instead consider framing a batch instead of each job.
- Mike

jdobbs
13th February 2011, 19:58
The sleep timer on my system is set to 1 hr.

Setting at the begin of each job and resetting at the end should work. I have a small command line program that uses this code to prevent the system from going to sleep during a backup and it has worked (the backup program I was using did not prevent the system from sleeping). You might also instead consider framing a batch instead of each job.
- Mike In the next release I've also added a routine that resets the timer count every 30 seconds while a job is being processed. That ought to do it for everybody..