PowerScheduler++ test versions (3 Viewers)

michael_t

Portal Pro
November 30, 2008
1,258
813
Home Country
Germany Germany
AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

mameo:
Does this plugin allow to complete power off (not standby or hibernation) the computer? I'm searching a way to complete shutdown pc using powerscheduler plugin or something.. thx
At the moment it does not, since I see not much use in such a feature. But it can be implemented quite easy - so maybe I'll find the time to do it.

Wbunaarf:
Thank you very much for your excellent logs and bug descriptions. :D

1) The behaviour you detected was as designed;). Since I have no multi-seat environment I have no experience what is useful in this scenario or not. So I modified the server that it is now active as long as one of it's clients is running (as in the original PowerScheduler).

2) Based on the hint by crazyboy I modified PS++ so that away mode requests are triggerd now by Start/End-Recording and Start/End-Timeshifting events. From your logs I could see that the events for timeshifting (recording is ok) are raised before the tvcontroller is really timeshifting and before timeshifting is really finished. So I cannot use those events for a reliable detection and modified PS++ accordingly. It should work now as expected.

3) The third bug is that away mode is not exited after recording is finished so that any try to suspend the system by PS++ (it does try it) will only keep the system in away mode. I did not realize this since my system is suspended by windows idle timer which does not care for away mode. I hope I can fix this, otherwise you would have to configure your system idle timer to suspend the system corresponding to PS++ settings (e.g. after 5 minutes inactivity).

4) I will have a look at the configuration after having fixed the other things...

A new version 1.1.1.5a with the first two bugs fixed can be downloaded from Sourceforge (not included in the automatic plugin update).


Michael
 

Jay_UK

Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Re: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Hi there,

    Many thanks for the new release :D

    I run a singleseat seat, with another client.

    Everything seems to work ok - client correctly shuts down now :)

    But I have just noticed a weird thing (might be a one off - so I will do more testing).

    The client has gone into sleep. the singleseat should have, but when I came to use it again, the screen was on the homescreen but nothing was responding. After a Ctrl-Alt_Del I was abale to manually reboot it.

    I have attached the log (check the bottom/end and work upwards).

    Where does the plugin store its config information?

    Thanks,

    J.
     

    mameo

    MP Donator
  • Premium Supporter
  • August 8, 2006
    74
    0
    Perugia
    Home Country
    Italy Italy
    Re: AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    michael_t

    So if you can do it easily, I will be happy it if you add in one of your next release. Thanks in advance!
     

    michael_t

    Portal Pro
    November 30, 2008
    1,258
    813
    Home Country
    Germany Germany
    AW: Re: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Jay_UK
    Please send your logs, so I can check it.
    The server plugin stores its information in the tv service database, the client plugin in mediaportal.xml (like all plugins).

    Wbunaarf
    Concerning the bug not suspending when in away mode (3), I found no way to fix it yet. As a workaround configure your windows power settings to suspend your system after some minutes of inactivity and it should suspend also from away mode.
    The problem is that when the system has entered away mode it is not possible to suspend it by program. Away mode must be exited first to do so, which can only be done by user activity (e.g. key press). I found a trick using "SendKeys" to imitate this user action (seen in GPMS), but it did not work in PowerScheduler, maybe because it is no forms application but runs as a service (part of tvservice).

    Michael
     

    Wbunaarf

    Portal Pro
    December 9, 2005
    534
    103
    Sweden
    Home Country
    Sweden Sweden
    Re: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    1) The behaviour you detected was as designed;). Since I have no multi-seat environment I have no experience what is useful in this scenario or not. So I modified the server that it is now active as long as one of it's clients is running (as in the original PowerScheduler).

    I can confirm this.

    2) Based on the hint by crazyboy I modified PS++ so that away mode requests are triggerd now by Start/End-Recording and Start/End-Timeshifting events. From your logs I could see that the events for timeshifting (recording is ok) are raised before the tvcontroller is really timeshifting and before timeshifting is really finished. So I cannot use those events for a reliable detection and modified PS++ accordingly. It should work now as expected.

    With 'as expected', do you mean that it should suspend when the client is no longer active (without using windows power management) or that away mode is now used here as well? If you meant the first case, it unfortunately still isn't working here (please see attached logs showing the server being restarted, the client being restarted, TV being watched on the client, the client suspended from within MP and finally the server staying awake). If you meant the second case - Nice, if only... ;)

    3) The third bug is that away mode is not exited after recording is finished so that any try to suspend the system by PS++ (it does try it) will only keep the system in away mode. I did not realize this since my system is suspended by windows idle timer which does not care for away mode. I hope I can fix this, otherwise you would have to configure your system idle timer to suspend the system corresponding to PS++ settings (e.g. after 5 minutes inactivity).

    I must admit that I haven't had windows managing power save for a very long time. It didn't use to work very well (a few years ago when I first set the system up using Vista), but perhaps it's better now in Windows 7. However, considering these machines being dedicated HTPCs makes me somewhat reluctant having windows meddling with power save. One particular reason not using it is that unless MP is running and idle I don't want the machine to suspend. Why? Because this means that I'm doing some work on it. Either directly on it or remotely using remote desktop or just shared folders. This leads to a small feature request: Would it be possible to add the feature to only allow sleep if the mp gui is running? As it is, with the frontend shut down I need to start one of the configuration tools to prevent suspend.

    @Wbunaarf
    Concerning the bug not suspending when in away mode (3), I found no way to fix it yet. As a workaround configure your windows power settings to suspend your system after some minutes of inactivity and it should suspend also from away mode.
    The problem is that when the system has entered away mode it is not possible to suspend it by program. Away mode must be exited first to do so, which can only be done by user activity (e.g. key press). I found a trick using "SendKeys" to imitate this user action (seen in GPMS), but it did not work in PowerScheduler, maybe because it is no forms application but runs as a service (part of tvservice).l

    I'm not a programmer, but I had a look at the source code and Microsofts documentation (Away Mode in Windows Vista). Is the following correctly understood?

    When a recording is started you issue a 'SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED);' telling the system to enable away mode.
    When the recording is finished, you issue a 'SetThreadExecutionState(ES_CONTINUOUS);' telling the system that it's now ok to suspend again.

    If the power button isn't pressed during the recording the away mode isn't actually entered, and thus ps(++) should be able to suspend afterwards?
    If the power button is pressed during the recording, the away mode is activated. In this case, ps++ isn't able to suspend the system for some reason. Pressing a key (or somehow simulating it in code) exits away mode, and ps(++) should again be able to suspend the system?

    Would it make a difference using the newer functions in Power Availability Requests ?

    //Johannes
     

    tom78

    Portal Pro
    August 10, 2007
    149
    5
    Home Country
    Germany Germany
    AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Hello.

    After aclean reinstall of Windows 7 x86 i decided to test your PS-Plugin, but i have a small problem.
    When a scheduled recording is running and i press the power button on the remote,my system goes into the "away-mode" as expected, so your plugin works generally.
    But when my system goes into sleep mode (because of inactivity), it doesn't wakeup for a scheduled recording.
    It's a clean windows 7 x86 installation without any modifications of the standard energy saving modes (well, i switched off the password protection, but that's everything i chaned)
    In the BIOS all wageup-events are enabled and your plugin is configured as "Desktop" without any advanced settings.
    Could you give me a tip what the reason could be?

    thanks
    Tom
     

    michael_t

    Portal Pro
    November 30, 2008
    1,258
    813
    Home Country
    Germany Germany
    AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Hi Johannes,

    first of all many thanks for your efforts and your support detecting the remaining bugs in PS++!:D I am sorry that I could not respond earlier, but I had lots of other things to do this week. So let's have a look at your last post:

    With 'as expected', do you mean that it should suspend when the client is no longer active (without using windows power management) or that away mode is now used here as well? If you meant the first case, it unfortunately still isn't working here (please see attached logs showing the server being restarted, the client being restarted, TV being watched on the client, the client suspended from within MP and finally the server staying awake). If you meant the second case - Nice, if only...
    PS++ on the server had a problem in detecting the beginning and the end of a timeshifting (watching tv or tv recordings) properly. Thus it thought timeshifting was still going on even after you stopped watching tv and suspended your client. So your server kept running and running... Now PS++ recognizes start and end of timeshifting correctly and suspends the server when there's no more client activity.

    This leads to a small feature request: Would it be possible to add the feature to only allow sleep if the mp gui is running? As it is, with the frontend shut down I need to start one of the configuration tools to prevent suspend.
    I will be thinking about that; indeed it is very annoying when the system is suspending right under your fingers while you want to fix something... BTW: That would not happen if the system was configured to let windows do the suspend... ;)

    If the power button isn't pressed during the recording the away mode isn't actually entered, and thus ps(++) should be able to suspend afterwards?
    That's correct.
    If the power button is pressed during the recording, the away mode is activated. In this case, ps++ isn't able to suspend the system for some reason. Pressing a key (or somehow simulating it in code) exits away mode, and ps(++) should again be able to suspend the system?
    Exactly that is my problem: finding a way how to exit away mode by program. I found another hint in a Microsoft paper (calling SetThreadExecutionState(ES_SYSTEM_REQUIRED) should also exit away mode), but that didn't work either, probably because PS++ is running as a service. I have still one idea to try out, but had found no time so far...
    Would it make a difference using the newer functions in Power Availability Requests ?
    Thank you for the link; I didn't know these new functions. But they provide no new features compared to SetThreadExecutionState - besides the independence from the calling thread, which I already cared for in PS++...

    And one last question: Maybe I oversaw it, but I am wondering why you added the logs :confused: Could you please explain their background?


    tom78
    Please provide logs, otherwise I can not help you!

    Michael
     

    tom78

    Portal Pro
    August 10, 2007
    149
    5
    Home Country
    Germany Germany
    AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Here are my logs.

    This time i used the power options in MP home window to switch my machine to standby mode. ...
    the scheduled recording didn't start my pc; the recording began immediately when i started my pc manually.
     

    michael_t

    Portal Pro
    November 30, 2008
    1,258
    813
    Home Country
    Germany Germany
    AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Hallo Tom.

    ich kann Dein Problem bei mir leider nicht nachvollziehen. Auch wenn ich das System sehr knapp (wie bei Dir ca. 30 Sek.) vor dem geplanten Wakeup für die nächste Aufnahme in den Suspend schicke, wacht es dennoch zuverlässig wieder auf, um die Aufnahme auszuführen.

    Kann es sein, dass Deine Energieeinstellungen nicht stimmen? Das kann ich anhand der Logs nicht feststellen. Bitte prüfe daher, ob Dein System überhaupt aus dem Suspend aufwachen kann:
    Unter Systemsteuerung -> Energieoptionen -> Energiesparplaneinstellungen bearbeiten -> "Erweiterte Energieeinstellungen ändern": Bei "Energie Sparen" den Punkt "Zeitgeber zur Aktivierung zulassen" auf "Aktivieren" stellen
    Und dann noch einmal mit etwas mehr zeitlichem Abstand zwischen Suspend und Wakeup testen...

    Michael
     

    tom78

    Portal Pro
    August 10, 2007
    149
    5
    Home Country
    Germany Germany
    AW: [New Plugin] PowerScheduler++ (New Version 1.1.1.5)

    Hi Michael.

    Danke für deine Antwort.
    Ich hab jetzt mal in den Energieoptionen nachgeschaut, aber diese Einstellung vom Zeitgeber stand bei mir bereits auf "aktivieren", von daher sollte es daran nicht liegen. Ich werd da aber noch etwas rumexperimentieren.
    Wie funktioniert das eigentlich mitm aufwachen (bzw wie sollte es funktionieren)? Greift dein Plugin auf die RTC-Wakeup-Funktion vom BIOS zu? Falls ja, dann müßte sich ja die darin programmierte Zeit mit jeder neuen Aufnahme ändern, was ich ja recht schnell überprüfen könnte.
    Ansonsten, hast du vielleicht irgendwelche Windows-Tasks programmiert, die den Rechner starten können? (z.B. die automatischen Updates) Weil vielleicht wird dadurch noch ein Windows-Dienst gestartet der bei mir momentan nicht läuft, aber notwendig ist?!
    Wie oben geschrieben, hab ich Windoof komplett neu installiert und nix an den "Werkseinstellungen" geändert.

    Bis dann
    Thomas
     

    Users who are viewing this thread

    Top Bottom