Author Topic: Feature: Prevent hibernate and standby  (Read 9291 times)

0 Members and 1 Guest are viewing this topic.

Offline parade

  • Tireless poster
  • ****
  • Posts: 138
    • View Profile
Feature: Prevent hibernate and standby
« on: February 24, 2008, 12:33:43 PM »
Hi,

I configured my HFS-PC to hibernate after some time of idleness. The server is only used for a closed group of people I know. All of them know how to wake this PC with "wake on lan" and HFS is ready to respond within 15 seconds after the wol-command.
This would be perfect if Windows would allow network traffic or harddisk activity to reset the idle-timer. So far I see no way to tell this to windows. As far that I know the idle-timer only gets a reset by real user-activity with mouse or keyboard. Even another wol-packet does not reset the idle-timer. Therefore it sometimes happens, that Windows hibernates during a download or upload.

It would be perfect if HFS could reset the idle-timer, whenever there is activity initialized by a client.

Greetings
parade

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #1 on: February 24, 2008, 01:22:07 PM »
I don't know how to reset such timer.
Made a quick search and found nothing.
If anyone knows, just tell me.

Offline parade

  • Tireless poster
  • ****
  • Posts: 138
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #2 on: February 24, 2008, 02:54:23 PM »
I don't know how to reset such timer.
Made a quick search and found nothing.
If anyone knows, just tell me.
I did some search for this topic too, before I startetd this thread.
The only thing I found is this:
http://www.taotoon.com/forums/showthread.php?p=6227

Edit:
http://msdn2.microsoft.com/en-us/library/aa373208(VS.85).aspx
« Last Edit: February 25, 2008, 04:07:24 AM by parade »


Offline Unknown8063

  • Experienced poster
  • ***
  • Posts: 96
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #4 on: February 25, 2008, 01:03:50 PM »
I have a concern about this.  I admit I don't know how programs that detect system idleness work, but there are programs such as SETI@Home which can be configured to trigger when a system is left idle for a period of time.  This is a convenient setting to allow one to participate in these programs while maintaining maximum system resources when the computer is in actual use.  I would not want a background process (HFS web server) to conflict with these programs as it would essentially make such configuration settings worthless.

Would this feature also cause network activity on HFS to cancel a screen saver?

Just my 2 cents
« Last Edit: February 25, 2008, 01:12:17 PM by Unknown8063 »

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #5 on: February 25, 2008, 06:02:51 PM »
the second link is what i needed.
now it should be effortless.

@unk
i don't see how it would conflict

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #6 on: February 25, 2008, 06:25:04 PM »
available in next beta

Offline parade

  • Tireless poster
  • ****
  • Posts: 138
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #7 on: February 29, 2008, 07:02:33 AM »
available in next beta

i forgot to put this line in the what's new
+ Menu -> Other options -> "Prevent system standby on network activity" www.rejetto.com/forum/?topic=5694

Hi rejetto,

I did some tests with Build 180 and option activated and so far can see no different behaviour.
As you mention "standby" - is it also active for hibernate?

I set my windows-energy-options with standby to "never" and hibernate to 30 minutes.
After initializing some network traffic on HFS I would expect that the PC hibernates 30 minutes later after I stopped traffic. Buit my PC hibernates sometimes already after 5 minutes.

How did you do it? Reset the timer every time there is network traffic? Is there a special interval you do it?

Greetings
parade

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #8 on: February 29, 2008, 07:51:06 AM »
yes, i asked to reset the timer at every activity.
just this
Code: [Select]
if preventStandbyChk.checked then
  setThreadExecutionState(1);

it should apply to hibernation too, since there's no different timer but a different timeout.

what Windows are you using?

Offline parade

  • Tireless poster
  • ****
  • Posts: 138
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #9 on: February 29, 2008, 10:52:10 AM »

it should apply to hibernation too, since there's no different timer but a different timeout.

what Windows are you using?

I use Windows XP Home SP2.

I had a look around and found, that there is another timer called "unattended idle timer", that is automatically set, when the system wakes automatically. Maybe a WOL-command is such an automatic wake.
This would explain why my system hibernates shortly after wake up from hibernate. Normally I would expect, that waking up from hibernation would reset the idle timer.

http://msdn2.microsoft.com/en-us/library/aa373235(VS.85).aspx

I just made some tests. Timer is set to 30 minutes.

Waking up from hibernate: went to sleep after 5 minutes and another time after 15 minutes
Reboot normally: hibernates 30 minutes after last activity

Greetings
parade

Offline parade

  • Tireless poster
  • ****
  • Posts: 138
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #10 on: March 24, 2008, 08:38:59 AM »
Hi rejetto,

as I told you in my previous reply, I still can see no effect in setting "Prevent system standby on network activity".

Are you still looking for a solution or do you want to forget.  ;)

Is there someone here who is willing to test this new option and tell me, if it is working?

Greetings
parade

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #11 on: March 28, 2008, 01:25:04 PM »
i will look at the last link you posted and let you know if i can do sth about it

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #12 on: June 17, 2008, 06:18:30 AM »
I finally found some time to test myself.
I made some tests on my system: laptop with XP Pro + SP3.

1. set a standby to few minutes, no HFS running: standby as configured.
2. ran HFS with no "prevent standby" and no download: standby as configured.
3. enabled "prevent standby" and started a long download: no standby after 3 times the configured standby time-out, so i guess, no standby at all.

So, after this, i can say the feature is effective and working on my system, and likely on other systems too.
I didn't test about the hibernate, so i can guess there is a problem with it, or with your system.
I made these tests to decide if i should remove this feature or not, and the result is: i keep it. :)

Offline parade

  • Tireless poster
  • ****
  • Posts: 138
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #13 on: June 23, 2008, 03:19:13 AM »

3. enabled "prevent standby" and started a long download: no standby after 3 times the configured standby time-out, so i guess, no standby at all.

So, after this, i can say the feature is effective and working on my system, and likely on other systems too.
I didn't test about the hibernate, so i can guess there is a problem with it, or with your system.

Maybe it really is the hibernation but as I told on my feature request, I need hibernation mode.

If I understand your testing you just launched HFS and started a download. The problem I have is, that after the system wakes up with a WOL-Call, the feature "prevent standby" does not seem to work.
Did you make a test with a WOL-Call? I ask this because as I told you quoting the link I mentioned speeks of an "unattended idle timer" in opposition to an "system idle timer".

Was the download going on all the time or did you test, how long it takes, that the system goes to sleep after the download is finished?
After resetting the timer the system should stay alive the whole time-out, that was set.
Sometimes clients start a download, go for a cup of coffee and return when the download has finished some minutes already. As I set my system to a hibernation time-out of 30 minutes, I would like my system to hibernate not before 30 minutes after the last network activity.

Greetings
parade



Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12778
  • Country: it
    • View Profile
Re: Feature: Prevent hibernate and standby
« Reply #14 on: June 23, 2008, 01:27:13 PM »
i studied the microsoft document you linked.
the expected behaviour seems to be:
your system wakes up, and in few minutes (2-5 ?) any program can call the timer-reset (or standby will occur).
your computer doesn't switch off while there's any HFS serving activity.
when this activity ceases for X minutes, your system will sleep again.
sadly, the documentation doesn't seem to specify this latter amount of time.

Quote
Did you make a test with a WOL-Call?

no, and i had hibernate set to "never"

Quote
Was the download going on all the time or did you test, how long it takes, that the system goes to sleep after the download is finished?

i manually stopped the download (on the same PC) and waited without touching mouse or keyboard.
after 2 minutes, standby occurred.

Quote
As I set my system to a hibernation time-out of 30 minutes, I would like my system to hibernate not before 30 minutes after the last network activity.

if this doesn't happen, it may be because Windows uses a different timer in such situation.
If that's true, it must be a design decision.
« Last Edit: June 23, 2008, 01:31:05 PM by rejetto »