Powerscheduler shuts down PC too early during WEB EPG grabbing (1 Viewer)

jonm

Portal Pro
January 12, 2009
429
26
Wales
Home Country
Wales Wales
Hi arion_p, I tried this fix because I'm seeing strangeness on my system, but with this fix the TV Server config program doesn't remember the times I set for EPG wakeup in the powerscheduler section - I set the time/days and then exit, come back to it and they're all blank again :(
 

arion_p

Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    Hi arion_p, I tried this fix because I'm seeing strangeness on my system, but with this fix the TV Server config program doesn't remember the times I set for EPG wakeup in the powerscheduler section - I set the time/days and then exit, come back to it and they're all blank again :(
    Logs could help eliminate the guesswork.;)
     

    jonm

    Portal Pro
    January 12, 2009
    429
    26
    Wales
    Home Country
    Wales Wales
    Indeed. I will post some when I have time, am working at the moment but will spend some time on this tonight, didn't get much time over lunch :) The behaviour I'm seeing (before this patch) is weird - I just get a hang with MP being unresponsive and I have to kill it. This seems to happen after a wakeup to grab the EPG but I've not proved that yet. Anyway, will update later...
     

    nikigraus

    Portal Pro
    January 2, 2007
    60
    5
    Home Country
    Switzerland Switzerland
    @ arion_p

    I have an easy question but I am looking since ages for a solution on this. Now I ask myself if the newest change of the PowerScheduler will be able to help me.
    (see https://forum.team-mediaportal.com/bugtracker-feed-462/0002693-powerscheduler-does-not-prevent-windows-standby-even-when-standbyhandlers-di-77537/)

    I have an audio player running on the touchscreen of the HTPC. Now I want the powerscheduler to _not_ go to standby when that player is playing something. This means, I can't use the "preventing processes" feature, because the process is always there.
    But power scheduler should detect if it is active or not (I think every application can set a flag if it is ready to go to standby or not). Like the windows standby feature, which detects if something is running and hence doesn't go to standby while it is.

    Will the change mentioned in the link above implement this?

    Thank you very much for an info on this!
    Daniel
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    No this change refers to MediaPortal's standby handlers. Unless the player is written specifically with MediaPortal in mind, it is impossible for MediaPortal to know if it is active or not.

    Windows does by providing an API that application can use to signal when it is active. MediaPortal also provides a similar API, but the application must be build to use that API (i.e. be built with MediaPortal mind).
     

    nikigraus

    Portal Pro
    January 2, 2007
    60
    5
    Home Country
    Switzerland Switzerland
    Hi arion

    Okay, I understand.
    Would it be possible to add a "Windows mode" in Power Scheduler, so that Windows could take care of the standby control? And Power Scheduler would use the Windows API to signal whether it is allowed to go to standby or not.
    I am using 4TheRecord at the moment which works like this. But I don't like that S/W too much because it also replaces the TV Module and this has some drawbacks.

    Thanks
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    I remember there were issues with the Windows power management and that is why the PoweScheduler plugin was created in the first place. But I don't remember the details. One problem however is that different versions of Windows respond differently to the power management API and that made it difficult to have a universal solution. Another one is that Windows allows only 2mins (IIRC) from the time an application is informed about an imminent suspend until the system actually suspends. This is not always enough time for TV Server to prepare for the suspend.

    It is always possible to create a new plugin to handle power management but I am not sure it would be easy.
     

    nikigraus

    Portal Pro
    January 2, 2007
    60
    5
    Home Country
    Switzerland Switzerland
    Hmm...
    I have looked a bit at the plugins that are available for the MP3 streaming system I use (Squeezeboxes from Logitech).
    There is a plugin that uses calls to the Win32 API to prevent standby. I can see the following line in the plugin code:

    $SetThreadExecutionState = Win32::API->new('kernel32', 'SetThreadExecutionState', 'N', 'N');

    Maybe it would be possible to call the Power Scheduler API function instead? Is there a description about this API?
     

    nikigraus

    Portal Pro
    January 2, 2007
    60
    5
    Home Country
    Switzerland Switzerland
    arion_p,

    is thera a command line interface of the power scheduler to keep it alive by executing a command from time to time?

    Thanks
    Daniel
     

    Users who are viewing this thread

    Top Bottom