PowerScheduler unconditionally checks every second (1 Viewer)

Oxan

Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    The powerScheduler plugin unconditionally checks all power handlers each second.

    Relevant part of the log when starting up the TV Server:
    Code:
    2011-10-18 11:56:38.114666 [TVService(6)]: PowerScheduler: Registered PowerScheduler service to GlobalServiceProvider
    2011-10-18 11:56:38.116666 [TVService(6)]: TV Service: Plugin: Power Scheduler started
    2011-10-18 11:56:38.122666 [TVService(6)]: PowerScheduler: Registered PowerScheduler as PowerEventHandler to tvservice
    2011-10-18 11:56:38.122666 [TVService(6)]: PowerScheduler: Registered default set of standby/resume handlers to PowerScheduler
    2011-10-18 11:56:38.127667 [TVService(6)]: PowerScheduler: Registered PowerScheduler as "PowerControl" remoting service
    2011-10-18 11:56:38.137667 [TVService(6)]: PowerScheduler: extensive logging enabled: True
    2011-10-18 11:56:38.138667 [TVService(6)]: PowerScheduler: entering standby is enabled: True
    2011-10-18 11:56:38.140667 [TVService(6)]: PowerScheduler: automatic wakeup is enabled: True
    2011-10-18 11:56:38.142667 [TVService(6)]: PowerScheduler: Reinitialize controller on wakeup: True
    2011-10-18 11:56:38.145668 [TVService(6)]: PowerScheduler: Run external command before standby / after resume: 
    2011-10-18 11:56:38.147668 [TVService(6)]: PowerScheduler: idle timeout set to: 10 minutes
    2011-10-18 11:56:38.149668 [TVService(6)]: PowerScheduler: pre-wakeup time set to: 150 seconds
    2011-10-18 11:56:38.150668 [TVService(6)]: PowerScheduler: pre-no-shutdown time set to: 150 seconds
    2011-10-18 11:56:38.152668 [TVService(6)]: PowerScheduler: Check interval set to 300 seconds
    2011-10-18 11:56:38.154668 [TVService(6)]: PowerScheduler: Shutdown mode set to Hibernate
    2011-10-18 11:56:38.155668 [TVService(6)]: PowerScheduler: Standby allowed until 24 o' clock
    2011-10-18 11:56:38.160668 [TVService(6)]: PowerSchedulerFactory CTOR
    2011-10-18 11:56:38.170669 [TVService(6)]: PowerScheduler: preventing standby for process: SetupTv
    2011-10-18 11:56:38.170669 [TVService(6)]: PowerScheduler: preventing standby for process: Configuration
    2011-10-18 11:56:38.175669 [TVService(6)]: ActiveSharesHandler: Share monitoring is disabled.
    2011-10-18 11:56:38.199671 [TVService(6)]: PowerScheduler: wakeup system for EPG at time: 0:0
    2011-10-18 11:56:38.199671 [TVService(6)]: PowerScheduler: EPG last run: 1-1-0001 0:00:00
    2011-10-18 11:56:38.203671 [TVService(6)]: PowerScheduler: Starting poll thread
    2011-10-18 11:56:38.205671 [TVService(6)]: Powerscheduler: started

    And then, repeated every second:
    Code:
    2011-10-18 12:02:00.432598 [PowerScheduler poll thread(14)]: PowerScheduler: lastUserTime: 12:01:57.2501 , False
    2011-10-18 12:02:00.463798 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:MaravillaLock DisAllowShutdown:False
    2011-10-18 12:02:00.463798 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:GenericStandbyHandler DisAllowShutdown:False
    2011-10-18 12:02:00.463798 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ActiveStreamsHandler DisAllowShutdown:False
    2011-10-18 12:02:00.479398 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ControllerActiveHandler DisAllowShutdown:False
    2011-10-18 12:02:00.479398 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ProcessActiveHandler: DisAllowShutdown:False
    2011-10-18 12:02:00.479398 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:NetworkMonitorHandler DisAllowShutdown:False
    2011-10-18 12:02:00.479398 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ActiveSharesHandler DisAllowShutdown:False
    2011-10-18 12:02:00.479398 [PowerScheduler poll thread(14)]: PowerScheduler: lastUserTime: 12:01:57.2501 , False
    2011-10-18 12:02:01.493400 [PowerScheduler poll thread(14)]: PowerScheduler: lastUserTime: 12:01:57.2501 , False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:MaravillaLock DisAllowShutdown:False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:GenericStandbyHandler DisAllowShutdown:False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ActiveStreamsHandler DisAllowShutdown:False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ControllerActiveHandler DisAllowShutdown:False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ProcessActiveHandler: DisAllowShutdown:False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:NetworkMonitorHandler DisAllowShutdown:False
    2011-10-18 12:02:01.524600 [PowerScheduler poll thread(14)]: PowerScheduler.DisAllowShutdown: inspecting handler:ActiveSharesHandler DisAllowShutdown:False
    2011-10-18 12:02:01.540200 [PowerScheduler poll thread(14)]: PowerScheduler: lastUserTime: 12:01:57.2501 , False
    (I just copied the last two but it actually happens every second).

    This has the following reason:
    • TvEngine.PowerScheduler.PowerScheduler.PollThread loops in one-second intervals, where it calls CheckForStandby(true) every configured time (that's each 300 seconds in my case) and CheckForStandby(false) all other 299 times.
    • CheckForStandby calls DisAllowShutdown() with it's argument
    • DisAllowShutdown completely ignores it's argument and *always* checks all handlers
    I think checking the handlers should be made conditional depending on the refresh parameter.

    This behaviour is new in MP1.2, in MP1.1 everything worked fine. The reason that this is a problem for me is that I've a custom powerscheduler plugin which checks external conditions for whether shutdown should be performed and that shouldn't happen each second (it's at least a waste of CPU cycles). It also results in huge logfiles when extended logging is enabled.
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    AW: Re: PowerScheduler unconditionally checks every second

    In reference to another problem I had deactivated the powerscheduler.

    Until then I always observed that the system responsiveness was mediocre when I was for example pressing OK on my remote to bring up the mini-EPG while watching a HD channel. With the powerscheduler deactivated the system behavior is all of a sudden much, much smoother. The mini-EPG comes up without any delay and the HD picture continues to display normally. With an activated powerscheduler the display often freezes or is strongly stuttering at best.

    It appears that the powerscheduler is affecting the system. With a standby/idle time preset of 10 min one would not expect any effect on the system performance.

    Regards,
    Johannes
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    AW: PowerScheduler unconditionally checks every second

    I would recommand adding a part of my commit to the MP code (https://github.com/disaster123/MediaPortal-1/commit/315f0b261ec1488373386ccc53de0e9b0d7fb980#diff-1). This helped a lot for me.
    Hello disaster123,

    This is really interesting and you seem to have identified a significant improvement. Unfortunately I am unable (and probably also somehow reluctant) to compile my own private MP version. So what would be the mchanism to see this introduced to MediaPortal?

    Regards,
    HTPC_Soucer
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: PowerScheduler unconditionally checks every second

    Please try if this one is working for you - removed - as it is not compatible wth 1.2.2
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    AW: PowerScheduler unconditionally checks every second

    Please try if this one is working for you:
    Thank you, but unfortunately TV Server shows this dll under "incompatible plugins". I am running 1.2.2.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: PowerScheduler unconditionally checks every second

    OK i expected that. Then sorry i can't provide a compiled one as i've switched my whole development already to git and the new git version scheme.
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    AW: PowerScheduler unconditionally checks every second

    Then sorry i can't provide a compiled one as i've switched my whole development already to git and the new git version scheme.
    Thanks anyway.

    May we expect that this will find its way into an official version?
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    I would implement a proper fix though. There are already settings in the PowerScheduler to control the interval between checks, why not use them instead of setting some hardcoded 10 seconds?
     

    Users who are viewing this thread

    Top Bottom