PDA

View Full Version : Switching Off the Server



Steve
2006-01-13, 16:32
Hi

Has anyone experiance or ideas on how I can get a remote server to switch off or go in to hibernate mode if the Slimserver does not access it for say 30 minutes. I would prefer however that the PC is (soft) switched off (as it boots up to the desk top and can be controled remotely)

I have a dedicated PC to hold all my music files running Windows XP. To save wear and tear it would be desirable to switch off the PC when not in use. There is an inbuild function (Control Panel - Display - Screen Saver - Power) to put the PC in standby/hibernate mode if not used. It seems that activity via tha LAN does not count and the PC will switch to the standby/hibernate mode after the set time even though music is being streamed from it.

Any clues?

Michaelwagner
2006-01-13, 16:50
It depends on what you're trying to accomplish.

If you want to save power and perhaps noise when there's no usage for a while, use the power control applet to spin down your hard disk(s) after half an hour of no use. This saves more than half of the total power consumption, works like a charm, has worked in M$ software for many years, does the right thing, etc.

Do the same thing with your monitor and you're 3/4 of the way there.

Steve
2006-01-14, 07:13
I want to save power and wear and tear. Unfortunately when the PC stays on there is noise from the fans and the electronics (heating up) and moving parts are subject to wear and tear.

In the absence of the facility to have the PC go to standby/hibernation or Off when streaming (Hard Disc & LAN activity) is stopped, I will have to stop the HD and monitor working.

Perhaps someone knows how to switch the PC to the standby/hibernate mode or Off after the set time even though music is being streamed from it.

Michaelwagner
2006-01-14, 07:53
Perhaps someone knows how to switch the PC to the standby/hibernate mode or Off after the set time even though music is being streamed from it.
Why would you want to do that? It would stop the music ... ???

gharris999
2006-01-14, 08:14
I worked out some power saving methods for slimservers running on windows. See my post at http://forums.slimdevices.com/showthread.php?t=15523&page=3

)p(
2006-01-14, 09:12
Hi

Has anyone experiance or ideas on how I can get a remote server to switch off or go in to hibernate mode if the Slimserver does not access it for say 30 minutes. I would prefer however that the PC is (soft) switched off (as it boots up to the desk top and can be controled remotely)

I have a dedicated PC to hold all my music files running Windows XP. To save wear and tear it would be desirable to switch off the PC when not in use. There is an inbuild function (Control Panel - Display - Screen Saver - Power) to put the PC in standby/hibernate mode if not used. It seems that activity via tha LAN does not count and the PC will switch to the standby/hibernate mode after the set time even though music is being streamed from it.

Any clues?


I am new to slimserver. But should slimserver not just tell the os that its in use when one or more player is connected and playing like most mediaplayers do? There is a basic function call to set the execution state to do this. Then you could user the regular powermanagement that will turn the server off after x amount of idle time.

Michaelwagner
2006-01-14, 12:04
An interesting idea ... I seem to recall in the dim dark recesses of my trivia-infested mind that there is a windows call for "I'd like to power down this PC now, do you agree?". I guess Slim could hook it and veto power-down if it was streaming to a player.

Steve
2006-01-14, 18:08
Why would you want to do that? It would stop the music ... ???

The idea is to stop the PC being On when the Slimserver is no longer in use. The slimserver has this fantastic fuction WOL where it turns the PC On when Music is wanted.

Steve
2006-01-14, 18:20
I worked out some power saving methods for slimservers running on windows. See my post at http://forums.slimdevices.com/showthread.php?t=15523&page=3

Thankyou. There is some reading to do here. I will get back to you

Steve
2006-01-14, 18:23
I am new to slimserver. But should slimserver not just tell the os that its in use when one or more player is connected and playing like most mediaplayers do? There is a basic function call to set the execution state to do this. Then you could user the regular powermanagement that will turn the server off after x amount of idle time.

Thanks. What you suggest would be useful but I guess that Slimserver does not employ the function call that you are aware of.

Steve
2006-01-14, 18:24
An interesting idea ... I seem to recall in the dim dark recesses of my trivia-infested mind that there is a windows call for "I'd like to power down this PC now, do you agree?". I guess Slim could hook it and veto power-down if it was streaming to a player.


Would be a good idea. How can it be made to happen?

)p(
2006-01-15, 01:43
In the os dependent code of slimserver you could:

-trace if a sb player is connected and playing.

-if so call the SetThreadExecutionState function with the continueous flag and reset it when no sb player is playing anymore.

or probably better

-if a sb player is playing call regularly the SetThreadExecutionState function and set the system_required flag to reset the idle time.


What does this bring us. While any sb player is playing the slimserver computer will keep itself alive. When no player is playing the slimserver computer will go into stand by/himbernation/shutdown depending after the set idle times in the powermanagement settings on that computer.

peter

Steve
2006-01-15, 05:51
In the os dependent code of slimserver you could:

-trace if a sb player is connected and playing.

-if so call the SetThreadExecutionState function with the continueous flag and reset it when no sb player is playing anymore.

or probably better

-if a sb player is playing call regularly the SetThreadExecutionState function and set the system_required flag to reset the idle time.


What does this bring us. While any sb player is playing the slimserver computer will keep itself alive. When no player is playing the slimserver computer will go into stand by/himbernation/shutdown depending after the set idle times in the powermanagement settings on that computer.

peter
Thanks again

I am not a programmer and do notunderstand what you are saying. I will refer you reply to a programmer.

Thanks

jtuggey
2006-01-15, 08:17
I have used auto shutdown Xp with great success.
This will either shutdown/standby/hibernate at set time, or more usefully, when a particular process or system measure falls below or above a certain threshold. I use it to monitor the network activity of the slim server, and when this falls below a certain level, the PC shut's itself down. This together with WOL working, makes for a very good turnkey system, but without the server running 24x7. There are alternative programs as well, but this does it for me.
http://www.gillit.com/asdxp/index.htm

Steve
2006-01-16, 10:40
I have used auto shutdown Xp with great success.
This will either shutdown/standby/hibernate at set time, or more usefully, when a particular process or system measure falls below or above a certain threshold. I use it to monitor the network activity of the slim server, and when this falls below a certain level, the PC shut's itself down. This together with WOL working, makes for a very good turnkey system, but without the server running 24x7. There are alternative programs as well, but this does it for me.
http://www.gillit.com/asdxp/index.htm

Many thanks. Now that I know that such software exists I will look for somthing cheaper.

Gildahl
2006-02-20, 20:31
Hibernate or Stand-by can be activated on a schedule using AutoHotKey from www.autohotkey.com. This free open source scripting utility lets you control many system level operations very easily. I created a simple script as shown below. I then created a windows schedule task to execute this script at 11:00 every night. So far I haven't figured out a free way to ensure that no one is using the SB prior to hibernation, but since everyone is normally asleep by this time, this script/task in combination with WOL is a pretty good compromise.


; Call the Windows API function "SetSuspendState" to have the system suspend or hibernate.
; Windows 95/NT4: Since this function does not exist, the following call would have no effect.
; Parameter #1: Pass 1 instead of 0 to hibernate rather than suspend.
; Parameter #2: Pass 1 instead of 0 to request permission from each application prior to suspending.
; Parameter #3: Pass 1 instead of 0 to disable all wake events.

DllCall("PowrProf\SetSuspendState", "int", 1, "int", 0, "int", 0)