Power Management

Discuss issues related to PS3 Media Server development (only for programmers)

Power Management

Postby OnkelPeter » Sat Jun 02, 2012 10:33 am

Hi Guys!
(sorry about my english, but i'm from germany ;-)
You did good work. But Prevent Save Energy don't work correct on Win7 (Prof/64Bit). My PC go to sleep mode during streaming.
I'm not a windows or java expert, but i have a look an the code. The Sub that should do this work is in
Modul Win Utils.java (here the code)

Code: Select all
public void disableGoToSleep() {
      // Disable go to sleep (every 40s)
      if (PMS.getConfiguration().isPreventsSleep()
            && System.currentTimeMillis() - lastDontSleepCall > 40000) {
         logger.trace("Calling SetThreadExecutionState ES_SYSTEM_REQUIRED");
         Kernel32.INSTANCE.SetThreadExecutionState(Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_CONTINUOUS);
         lastDontSleepCall = System.currentTimeMillis();

Perhaps it is an idee to change "ES_CONTINUOUS" to "ES_AWAYMODE_REQUIRED" (found at http://msdn.microsoft.com/en-us/library/windows/desktop/aa373208%28v=vs.85%29.aspx )
I dont have knowllege and enviroment to test it myself, but when you did it, i will test it for you.

Thanks for your fine job and until it doesn't work correkt i use "preventsleep"
Last edited by Raptor399 on Sat Jun 02, 2012 11:26 am, edited 1 time in total.
Reason: Edited for code fragments
Posts: 4
Joined: Fri Mar 25, 2011 4:59 pm

Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest