Page 1 of 4

Prevent hibernate/standby/sleep

PostPosted: Mon Mar 07, 2011 10:59 pm
by Dogg
Hi,

Apologies if this has been requested before or if I'm missing a setting/simple workaround.

Can I suggest an option that will prevent Windows from entering standby mode when the server is actively playing media. e.g:

"Prevent standby if active playback in operation" checkbox.

Benefits for power saving and watching media in bed before sleep!

Thanks and great product.

Re: Prevent hibernate/standby/sleep

PostPosted: Mon Mar 07, 2011 11:14 pm
by zip

Re: Prevent hibernate/standby/sleep

PostPosted: Mon Mar 21, 2011 6:43 pm
by kjricker
I am looking forward to having this option in .6!

Re: Prevent hibernate/standby/sleep

PostPosted: Fri Jun 03, 2011 8:45 am
by zip
Try turning off automatic library checking.

Re: Prevent hibernate/standby/sleep

PostPosted: Wed Aug 31, 2011 8:25 pm
by kjricker
Has this option made it into the .6 betas? This is one feature I really need. MY 5 year old son is constantly getting mad at the TV for quitting his cartoons while he is watching them.

Re: Prevent hibernate/standby/sleep

PostPosted: Wed Aug 31, 2011 9:50 pm
by zip
no, it has not. set your PC up not to hibernate if it's on the power cord.

Re: Prevent hibernate/standby/sleep

PostPosted: Thu Sep 01, 2011 12:53 am
by kjricker
Well crap. Okay. I'll figure something out. I'd rather not leave it running all the time. With him in Kindergarten now, he doesn't have as much time to watch shows anyhow. I can use another app to monitor the network activity and prevent standby based on that.

Re: Prevent hibernate/standby/sleep

PostPosted: Tue Sep 27, 2011 6:36 pm
by Dogg
Hi kjricker,

I'd be interested if you found a work around for this.

Re: Prevent hibernate/standby/sleep

PostPosted: Tue Sep 27, 2011 6:43 pm
by kjricker
For a windows install try Shutter. Grab the beta. It has support for Network usage.

Re: Prevent hibernate/standby/sleep

PostPosted: Tue Sep 27, 2011 7:04 pm
by Cerberus
Definition of a server is a constantly running networked device so, to have it go to sleep defeats whole point of a server.

Re: Prevent hibernate/standby/sleep

PostPosted: Tue Sep 27, 2011 7:30 pm
by kjricker
Not really. The definition of a server is a computer that serves files on demand. If it can wake from standby to server the files when needed, then why not save power when you can. No reason to have a computer sucking down power when no one is home most of the day or while on vacation. If your using a PC with enough power to transcode media on demand, chances are it is not a low power PC.

Re: Prevent hibernate/standby/sleep

PostPosted: Tue Sep 27, 2011 7:40 pm
by Cerberus
kjricker wrote:Not really. The definition of a server is a computer that serves files on demand. If it can wake from standby to server the files when needed, then why not save power when you can. No reason to have a computer sucking down power when no one is home most of the day or while on vacation. If your using a PC with enough power to transcode media on demand, chances are it is not a low power PC.


no that would be a NAS.

Re: Prevent hibernate/standby/sleep

PostPosted: Tue Sep 27, 2011 8:07 pm
by kjricker
We'll just have to agree to disagree, or just disagree.

Regardless. If a computer is not doing anything I want it to go into standby. If it is doing something, wait 'til that is done, then go to standby. I know I am not alone in this. Whether this gets implemented in Serviio is up to Zip. I'll accept his decision either way.

Re: Prevent hibernate/standby/sleep

PostPosted: Thu Oct 27, 2011 1:55 am
by AeroSC
I'd like this feature as well. Other software (XBMC, Beyond TV) support this so it must be possible. I've looked for a standalone solution and haven't found anything that really addresses the issue. Shutter was suggested, but it can just force hibernation if network activity drops. I did find a DOS program that would intercept system hibernation requests and prevent them. Something like that could be incorporated based on server activity, but it's beyond my ability.

Re: Prevent hibernate/standby/sleep

PostPosted: Thu Oct 27, 2011 2:10 am
by moltra
I found a way to do it on windows XP via java. I will see if I can figure out a way to do it in linux and mac

  Code:
Introduction
This article shows how your Java (and C++) program can detect and refuse sleep/standby/hibernate requests made by the user or the system.

Background
I wrote an application that is fed by a special PCI card, and runs 24/7. We found that if the PC went into standby mode, the PCI card was falsely activated, which was really bad. There was no easy way to uniformly disable the sleep/standby/hibernate features in Windows XP. Therefore, I decided to use the Windows API to detect whether a standby request is made and refuse it. Luckily, the Win32 API has a message, called WM_POWERBROADCAST, that is sent to all applications when the PC wants to go into standby or hibernate mode. The win32 subsystem will abort the standby if you return BROADCAST_QUERY_DENY from this message handler.

By using this API, the enclosed code is able to detect whether the computer goes into standby mode and, through the utilization of JNI, notify the rest of the Java code about that event. Also, the code lets you allow or disallow the PC to enter standby mode.

Using the Code
To use the code from Java, simply instantiate a StandByDetector object and provide the constructor with a reference to a StandByRequestListener. The listener will be notified when a standby/hibernate request is made on the PC. Use the setAllowStandby() to tell the code whether or not you want to allow entering a standby. Remember that the DLL (enclosed) has to be in your java.library.path path. Here is an example:

StandByDetector sd=new StandByDetector(new StandByRequestListener() {
   public void standByRequested() {
      System.out.println("standby requested");
   }
});
sd.setAllowStandby(false);

Now try to put the PC in standby: Task manager->Shut Down->Stand By.
You will note that the cmd shell shows the message "standby requested" and the PC does not go


From http://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907

Re: Prevent hibernate/standby/sleep

PostPosted: Sat Nov 05, 2011 8:08 am
by Cerberus
moltra wrote:I found a way to do it on windows XP via java. I will see if I can figure out a way to do it in linux and mac

  Code:
Introduction
This article shows how your Java (and C++) program can detect and refuse sleep/standby/hibernate requests made by the user or the system.

Background
I wrote an application that is fed by a special PCI card, and runs 24/7. We found that if the PC went into standby mode, the PCI card was falsely activated, which was really bad. There was no easy way to uniformly disable the sleep/standby/hibernate features in Windows XP. Therefore, I decided to use the Windows API to detect whether a standby request is made and refuse it. Luckily, the Win32 API has a message, called WM_POWERBROADCAST, that is sent to all applications when the PC wants to go into standby or hibernate mode. The win32 subsystem will abort the standby if you return BROADCAST_QUERY_DENY from this message handler.

By using this API, the enclosed code is able to detect whether the computer goes into standby mode and, through the utilization of JNI, notify the rest of the Java code about that event. Also, the code lets you allow or disallow the PC to enter standby mode.

Using the Code
To use the code from Java, simply instantiate a StandByDetector object and provide the constructor with a reference to a StandByRequestListener. The listener will be notified when a standby/hibernate request is made on the PC. Use the setAllowStandby() to tell the code whether or not you want to allow entering a standby. Remember that the DLL (enclosed) has to be in your java.library.path path. Here is an example:

StandByDetector sd=new StandByDetector(new StandByRequestListener() {
   public void standByRequested() {
      System.out.println("standby requested");
   }
});
sd.setAllowStandby(false);

Now try to put the PC in standby: Task manager->Shut Down->Stand By.
You will note that the cmd shell shows the message "standby requested" and the PC does not go


From http://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907


if its java based it should work on all platforms :)

Re: Prevent hibernate/standby/sleep

PostPosted: Sat Nov 05, 2011 11:58 am
by kairoh
Cerberus wrote:if its java based it should work on all platforms :)

Not really because the code in article relies on JNI (java native interface) which is platform dependant.
This allows java programs to call library compiled in another language (DLL for Windows, some lib on Unix...).

Re: Prevent hibernate/standby/sleep

PostPosted: Mon Mar 12, 2012 1:46 am
by dRdoS7
Hi,

New to Serviio, but I have used Shutter for several years. You could monitor network usage, but that may be low while browsing files or paused. I added a "ping" to the list of Shutter's events. This ensures the PC stays awake while the player is switched on.

Works well.

dRdoS7

RE: Prevent hibernate/standby/sleep

PostPosted: Sat May 05, 2012 8:52 pm
by spelarn
Looking for this feature as well. If anyone has a custom solution for this, then please share.
Drdos7, please let us know if your solution works.

RE: Prevent hibernate/standby/sleep

PostPosted: Sun May 06, 2012 2:06 pm
by spelarn
If there only is a service that goes active or changes mode once streaming start this issue could be fixed easily using tasks in win7....