home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Quality Assurance
Bugreports
Archive
PowerScheduler plugin -- Standby timeout timer does not get update
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Edward Cheung" data-source="post: 1194118" data-attributes="member: 159714"><p><strong>MediaPortal Version:</strong> 1.14.0</p><p></p><p><strong>Description</strong></p><p>Dear Dev,</p><p></p><p>I have a machine with TVServer installed and use the PowerScheduler to shutdown the machine.</p><p>The standby time does not get reset after a system busy event is detected. It stays unchanged.</p><p></p><p>Had a quick look into the source code and it seems possible fix is to modify the <em>CheckForStandby()</em> function such that the <em>_lastUserTime </em>gets updated to current time when system not idle is detected. I may well be wrong or there is better way to do this.</p><p></p><p>I am happy to test the fix if you can send me the plugin files.</p><p></p><p></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> else </span></span></span></span></span></p><p> <span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000">{ </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> if (_idle) </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> { </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> Log.Info("PS: System changed from idle state to busy state"); </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> _idle = false; </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> SendPowerSchedulerEvent(PowerSchedulerEventType.SystemBusy); </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"> } </span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000">++ _lastUserTime = DateTime.Now <--Set <em>_lastUserTime</em> to current time</span></span></span></span></span></p><p> <span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000">Log.Debug("PS: System is busy and should not go to standby"); </span></span></span></span></span></p><p> <span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000">} </span> </span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000">Regards,</span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000"></span></span></span></span></span></p><p><span style="color: #ff0000"><span style="color: #000000"><span style="font-size: 12px"><span style="color: #ff0000"><span style="color: #000000">Edward</span></span></span></span></span></p><p></p><p><strong>Steps to Reproduce:</strong></p><p>Here's an extract of the log file and step to reproduce:</p><p></p><p>====PowerScheduler Initialize (For information only)====</p><p>[2016-08-23 07:59:23,063] [Log ] [TVService] [DEBUG] - PS: Registered PowerScheduler as IPowerScheduler service to GlobalServiceProvider</p><p>[2016-08-23 07:59:23,079] [Log ] [TVService] [INFO ] - PS: Starting PowerScheduler server plugin...</p><p>[2016-08-23 07:59:23,079] [Log ] [TVService] [DEBUG] - PS: LoadSettings()</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: PowerScheduler forces system to go to standby when idle: True</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Shutdown mode: Shutdown</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Standby after: 60 minutes</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Pre-wakeup time: 60 seconds</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Pre-no-standby time: 300 seconds</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Standby allowed until 24 o' clock</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Standby allowed until 24 o' clock on weekend</p><p>[2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Wakeup system for varios events: True</p><p>[2016-08-23 07:59:23,110] [Log ] [TVService] [DEBUG] - PS: Run command on power state change: </p><p>[2016-08-23 07:59:23,110] [Log ] [TVService] [INFO ] - PS: PowerSchedulerFactory</p><p>[2016-08-23 07:59:23,110] [Log ] [TVService] [DEBUG] - PS: Registered standby/wakeup handlers to PowerScheduler server plugin</p><p>[2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - PS: Registered PowerScheduler as IPowerEventHandler service to GlobalServiceProvider</p><p>[2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - PS: Registered PowerScheduler as IPowerControl remoting service</p><p>[2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - PS: StandbyWakeupThread started</p><p>[2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - ProcessActiveHandler: Preventing standby for processes:</p><p></p><p>====First time powerscheduler check for events and detected I logon using terminal service====</p><p>[2016-08-23 07:59:24,140] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings()</p><p>[2016-08-23 07:59:24,155] [Log ] [PS StandbyWakeup] [DEBUG] - NetworkMonitorHandler: Network monitor started</p><p>[2016-08-23 07:59:24,545] [Log ] [PS StandbyWakeup] [DEBUG] - NetworkMonitorHandler: Idle limit in KB/s: 10</p><p>[2016-08-23 07:59:24,561] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer()</p><p>[2016-08-23 07:59:24,576] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system</p><p>[2016-08-23 07:59:24,592] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby()</p><p>[2016-08-23 07:59:24,654] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Inspecting ActivePorts: StandbyPrevented</p><p>[2016-08-23 07:59:24,654] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyPrevented)</p><p>[2016-08-23 07:59:24,654] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is busy and should not go to standby</p><p></p><p>====I logged out and powerscheduler now detected system is idle and set the sleep timeout to 8:59:23====</p><p>[2016-08-23 08:00:58,161] [Log ] [PS StandbyWakeup] [DEBUG] - PS: StandbyWakeupThread triggered by check interval</p><p>[2016-08-23 08:00:58,161] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings()</p><p>[2016-08-23 08:00:58,192] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer()</p><p>[2016-08-23 08:00:58,192] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system</p><p>[2016-08-23 08:00:58,192] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby()</p><p>[2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyAllowed)</p><p>[2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [INFO ] - PS: System changed from busy state to idle state</p><p>[2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is idle and may go to standby</p><p>[2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Active standby is enabled - go to standby after idle timeout at 8:59:23</p><p></p><p>====I login again via terminal service====</p><p>[2016-08-23 08:01:28,394] [Log ] [PS StandbyWakeup] [DEBUG] - PS: StandbyWakeupThread triggered by check interval</p><p>[2016-08-23 08:01:28,394] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings()</p><p>[2016-08-23 08:01:28,425] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer()</p><p>[2016-08-23 08:01:28,425] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system</p><p>[2016-08-23 08:01:28,425] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby()</p><p>[2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Inspecting ActivePorts: StandbyPrevented</p><p>[2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyPrevented)</p><p>[2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [INFO ] - PS: System changed from idle state to busy state</p><p>[2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is busy and should not go to standby</p><p></p><p>====I logout but the idle timeout remained at 8:59:23. It should be 60 minutes from the time I logout based on my setting====</p><p>[2016-08-23 08:01:58,642] [Log ] [PS StandbyWakeup] [DEBUG] - PS: StandbyWakeupThread triggered by check interval</p><p>[2016-08-23 08:01:58,642] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings()</p><p>[2016-08-23 08:01:58,674] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer()</p><p>[2016-08-23 08:01:58,674] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system</p><p>[2016-08-23 08:01:58,674] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby()</p><p>[2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyAllowed)</p><p>[2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [INFO ] - PS: System changed from busy state to idle state</p><p>[2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is idle and may go to standby</p><p>[2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Active standby is enabled - go to standby after idle timeout at 8:59:23</p></blockquote><p></p>
[QUOTE="Edward Cheung, post: 1194118, member: 159714"] [b]MediaPortal Version:[/b] 1.14.0 [b]Description[/b] Dear Dev, I have a machine with TVServer installed and use the PowerScheduler to shutdown the machine. The standby time does not get reset after a system busy event is detected. It stays unchanged. Had a quick look into the source code and it seems possible fix is to modify the [I]CheckForStandby()[/I] function such that the [I]_lastUserTime [/I]gets updated to current time when system not idle is detected. I may well be wrong or there is better way to do this. I am happy to test the fix if you can send me the plugin files. [COLOR=#ff0000][COLOR=#000000][SIZE=3][COLOR=#ff0000][COLOR=#000000] else { if (_idle) { Log.Info("PS: System changed from idle state to busy state"); _idle = false; SendPowerSchedulerEvent(PowerSchedulerEventType.SystemBusy); } ++ _lastUserTime = DateTime.Now <--Set [I]_lastUserTime[/I] to current time Log.Debug("PS: System is busy and should not go to standby"); } [/COLOR] [COLOR=#000000]Regards, Edward[/COLOR][/COLOR][/SIZE][/COLOR][/COLOR] [b]Steps to Reproduce:[/b] Here's an extract of the log file and step to reproduce: ====PowerScheduler Initialize (For information only)==== [2016-08-23 07:59:23,063] [Log ] [TVService] [DEBUG] - PS: Registered PowerScheduler as IPowerScheduler service to GlobalServiceProvider [2016-08-23 07:59:23,079] [Log ] [TVService] [INFO ] - PS: Starting PowerScheduler server plugin... [2016-08-23 07:59:23,079] [Log ] [TVService] [DEBUG] - PS: LoadSettings() [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: PowerScheduler forces system to go to standby when idle: True [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Shutdown mode: Shutdown [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Standby after: 60 minutes [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Pre-wakeup time: 60 seconds [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Pre-no-standby time: 300 seconds [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Standby allowed until 24 o' clock [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Standby allowed until 24 o' clock on weekend [2016-08-23 07:59:23,094] [Log ] [TVService] [DEBUG] - PS: Wakeup system for varios events: True [2016-08-23 07:59:23,110] [Log ] [TVService] [DEBUG] - PS: Run command on power state change: [2016-08-23 07:59:23,110] [Log ] [TVService] [INFO ] - PS: PowerSchedulerFactory [2016-08-23 07:59:23,110] [Log ] [TVService] [DEBUG] - PS: Registered standby/wakeup handlers to PowerScheduler server plugin [2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - PS: Registered PowerScheduler as IPowerEventHandler service to GlobalServiceProvider [2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - PS: Registered PowerScheduler as IPowerControl remoting service [2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - PS: StandbyWakeupThread started [2016-08-23 07:59:23,126] [Log ] [TVService] [DEBUG] - ProcessActiveHandler: Preventing standby for processes: ====First time powerscheduler check for events and detected I logon using terminal service==== [2016-08-23 07:59:24,140] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings() [2016-08-23 07:59:24,155] [Log ] [PS StandbyWakeup] [DEBUG] - NetworkMonitorHandler: Network monitor started [2016-08-23 07:59:24,545] [Log ] [PS StandbyWakeup] [DEBUG] - NetworkMonitorHandler: Idle limit in KB/s: 10 [2016-08-23 07:59:24,561] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer() [2016-08-23 07:59:24,576] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system [2016-08-23 07:59:24,592] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby() [2016-08-23 07:59:24,654] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Inspecting ActivePorts: StandbyPrevented [2016-08-23 07:59:24,654] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyPrevented) [2016-08-23 07:59:24,654] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is busy and should not go to standby ====I logged out and powerscheduler now detected system is idle and set the sleep timeout to 8:59:23==== [2016-08-23 08:00:58,161] [Log ] [PS StandbyWakeup] [DEBUG] - PS: StandbyWakeupThread triggered by check interval [2016-08-23 08:00:58,161] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings() [2016-08-23 08:00:58,192] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer() [2016-08-23 08:00:58,192] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system [2016-08-23 08:00:58,192] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby() [2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyAllowed) [2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [INFO ] - PS: System changed from busy state to idle state [2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is idle and may go to standby [2016-08-23 08:00:58,270] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Active standby is enabled - go to standby after idle timeout at 8:59:23 ====I login again via terminal service==== [2016-08-23 08:01:28,394] [Log ] [PS StandbyWakeup] [DEBUG] - PS: StandbyWakeupThread triggered by check interval [2016-08-23 08:01:28,394] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings() [2016-08-23 08:01:28,425] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer() [2016-08-23 08:01:28,425] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system [2016-08-23 08:01:28,425] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby() [2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Inspecting ActivePorts: StandbyPrevented [2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyPrevented) [2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [INFO ] - PS: System changed from idle state to busy state [2016-08-23 08:01:28,503] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is busy and should not go to standby ====I logout but the idle timeout remained at 8:59:23. It should be 60 minutes from the time I logout based on my setting==== [2016-08-23 08:01:58,642] [Log ] [PS StandbyWakeup] [DEBUG] - PS: StandbyWakeupThread triggered by check interval [2016-08-23 08:01:58,642] [Log ] [PS StandbyWakeup] [DEBUG] - PS: LoadSettings() [2016-08-23 08:01:58,674] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetWakeupTimer() [2016-08-23 08:01:58,674] [Log ] [PS StandbyWakeup] [DEBUG] - PS: No pending events found in the future which should wakeup the system [2016-08-23 08:01:58,674] [Log ] [PS StandbyWakeup] [DEBUG] - PS: CheckForStandby() [2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [DEBUG] - PS: SetStandbyMode(StandbyAllowed) [2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [INFO ] - PS: System changed from busy state to idle state [2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [DEBUG] - PS: System is idle and may go to standby [2016-08-23 08:01:58,767] [Log ] [PS StandbyWakeup] [DEBUG] - PS: Active standby is enabled - go to standby after idle timeout at 8:59:23 [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Quality Assurance
Bugreports
Archive
PowerScheduler plugin -- Standby timeout timer does not get update
Contact us
RSS
Top
Bottom