MPstandbyHandler (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    1 - Is it possible to cancel the suspend when MPSH is notified? If it is possible, you can cancel the suspend do the suspend actions and call suspend again.
    Vista and Windows 7 do not allow you to cancel suspend requests. You need to stop the suspend request being raised (where as in XP you can actually intercept the message and tell windows to ignore it)

    Not sure if you have looked before but
    SetThreadExecutionState Function (Windows)
    is pretty good as showing how it should work in Vista.

    The problem of the request to standby already being sent might still be a problem as once the actual request to sleep is sent it is too late.
     

    Zorg

    Portal Pro
    June 12, 2008
    174
    8
    Home Country
    Spain Spain
    Hi josch.hh.

    First of all, thank you a lot for this plugin. I think it may be the definitive solution for all my problems with my Skystar2 TV PCI card, the TVService and the hibernation and resume of the computer. (I'm using last version of MP in Windows XP SP 3.)

    I found a solution to these problems by doing this before suspend:
    1) Stop TVService
    2) Disable Technisat Skystar Card

    and by doing this on resume:
    1) Enable Tecnhisat Skystar Card
    2) Start TVService

    I only needed a program capable of doing that. I started using Hibernate Trigger, but it failed sometimes. So I discovered your program and saw that it worked much better. Nevertheless, I'm still having problems, because weird things happen now and then.

    Now, I don't know why the program has started to trigger after the PC resuming both resume and suspend procedures, one after the oder.
    This is the log I found after resuming the computer and failing the scheduled recording, because everything was disabled again:

    03/01/2010 21:28:16 :: Info :: Settings Load - Loading settings from C:\Documents and Settings\All Users\Datos de programa\MPstandbyHandler\MPstandbyHandlerUtils.xml
    03/01/2010 21:28:16 :: Info :: Version 2.0.0.9
    03/01/2010 21:28:16 :: Info :: Job Load - Loaded RESUME job HardwareDeviceRestart
    03/01/2010 21:28:16 :: Info :: Job Load - Loaded RESUME job TVServiceStart
    03/01/2010 21:28:16 :: Info :: Job Load - Loaded RESUME job ExternalCommand
    03/01/2010 21:28:16 :: Info :: Job Load - Loaded SUSPEND job TVServiceStop
    03/01/2010 21:28:16 :: Info :: Job Load - Loaded SUSPEND job ExternalCommand

    I would appreciate very much some help.
    Thank you in advance
     

    visteon

    Portal Pro
    October 19, 2007
    94
    2
    I have been using this for over a year now and without it standby would be impossible so thanks very much.

    After setting up a new PC I had problems during the resume with a second call to Resume() from PowerBroadcastStatus.ResumeSuspend:

    This seemed to abort the resume process.

    I changed the code in MpshService.cs:

    case PowerBroadcastStatus.ResumeSuspend:
    // The system has resumed operation after being suspended.
    if (isResuming) Logger.Info("OnResume - Already resuming !Test!");
    else Resume();
    break;

    This is so Resume() is not called again if it has not completed. My system has been running fine for the last 3 weeks with this mod.

    I am no expert on C# and would be interested if anyone can tell me what happens if a function is called again before it has completed the first time.

    My guess is that the code :

    if (isResuming)
    {
    Logger.Info("OnResume - Already resuming");
    return;
    }

    causes the first call to the function to terminate too.

    Hope this may help others if it is integrated in the project.
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: MPstandbyHandler

    Hi Josch,
    I have the following setup:
    - Central TV-server (all fine, sleeps and wakes up, no additional tools except MP stuff necessary) - Using S3 to let the box sleep when not in use
    - NAS for mediafiles - also using S3 for sleeping
    On the clientPCs thus 2 things have to happen: Waking the TV-server (is now done within MePo WOL function, works fine) plus waking the NAS.
    To wake the NAS I used hybernatetrigger in the past. Works, but sometimes failed (don't know why). I replaced this now with MPstandnyhandler 2.0.0.9 - just for the purpose to send a WOL magic packet to the NAS, when clients resumes from hibernation.
    I still have the situation, that sometimes the NAS does not wake up .... the TV server always does.
    To make sure I have defined 3 steps in the MPstandbyhandler:
    1. check networkconnection to the router (to make sure, ip-connectivity is properly up, DHCP-renewal, or whatever)
    2. call a script wol.bat to send the magicpacket to the NAS
    3. another check networkconnection to the NAS to make sure, NAS is up and running
    The logic seems nice - but from time to time I have the situation, that NAS will not resume when resuming the HTPC.
    Checking the logs, it seems, the first networkcheck times out - thus the WOL packet probably can't be sent to the NAS.
    I am using DHCP on the HTPCs.
    So any idea what/how this could improved to safely wake the NAS? SHould I reinitialize the LAN connection? How could this be done?
    THanks in advance, Guzzi

    Logs from unsuccessful resume:
    13.01.2010 00:40:34 - INFO System PowerEvent: ResumeAutomatic
    13.01.2010 00:40:34 - INFO OnResume
    13.01.2010 00:40:34 - INFO System PowerEvent: ResumeSuspend
    13.01.2010 00:40:34 - INFO OnResume - Already resuming
    13.01.2010 00:40:35 - INFO OnResume - Unable to show splashscreen, MPstandbyHandlerUser not running
    13.01.2010 00:40:35 - INFO Job Load - Loaded RESUME job NetworkCheck
    13.01.2010 00:40:35 - INFO Job Load - Loaded RESUME job ExternalCommand
    13.01.2010 00:40:35 - INFO Job Load - Loaded RESUME job NetworkCheck
    13.01.2010 00:40:35 - INFO NetworkCheck - Waiting 20s for network interface LAN-Verbindung 3
    13.01.2010 00:40:37 - INFO Check Network Connection - Interface LAN-Verbindung 3 is UP
    13.01.2010 00:40:37 - INFO NetworkCheck - Connection successfull, trying to ping host "xps-01"
    13.01.2010 00:40:39 - INFO Ping - Connection to host "xps-01" timed out
    13.01.2010 00:40:39 - WARNING NetworkCheck - Host "xps-01" could not be reached
    13.01.2010 00:40:39 - INFO Command Start - Starting (20s): C:\WOL\wol.bat
    13.01.2010 00:40:42 - INFO NetworkCheck - Waiting 20s for network interface LAN-Verbindung 3
    13.01.2010 00:40:42 - INFO Check Network Connection - Interface LAN-Verbindung 3 is UP
    13.01.2010 00:40:42 - INFO NetworkCheck - Connection successfull, trying to ping host "xms-01"
    13.01.2010 00:40:42 - INFO Ping - Host "xms-01" successfully reached within 0ms
    13.01.2010 00:40:42 - INFO NetworkCheck - Host "xms-01" successfully reached
    13.01.2010 00:40:42 - INFO OnResume - Done
     

    ichessblumen

    MP Donator
  • Premium Supporter
  • November 21, 2006
    456
    18
    Home Country
    Germany Germany
    Re: AW: MPstandbyHandler

    So any idea what/how this could improved to safely wake the NAS? SHould I reinitialize the LAN connection? How could this be done?

    hi guzzi,

    maybe I can help with that. On my HTPC I've just added a network drive in windows explorer.

    open explorer and click on "extras". then "connect network drive"(I don't know if that is the right description cause I am on a German OS) . A popup appears and then you can assign a drive name as well as the path and folder to your NAS. Check the box which means "reconnect at boot" or somthing similar. ther's only one checkbox.

    Then add in MP config the drive in the section where you want to have your mediafiles e.g. in videos, music or pictures.

    every time when you have MP running you have access to this drive then. sometimes it takes a few seconds, depending on the adjustement of your NAS' "spin off" time.... that's it.
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Re: AW: MPstandbyHandler

    So any idea what/how this could improved to safely wake the NAS? SHould I reinitialize the LAN connection? How could this be done?

    hi guzzi,

    maybe I can help with that. On my HTPC I've just added a network drive in windows explorer.

    open explorer and click on "extras". then "connect network drive"(I don't know if that is the right description cause I am on a German OS) . A popup appears and then you can assign a drive name as well as the path and folder to your NAS. Check the box which means "reconnect at boot" or somthing similar. ther's only one checkbox.

    Then add in MP config the drive in the section where you want to have your mediafiles e.g. in videos, music or pictures.

    every time when you have MP running you have access to this drive then. sometimes it takes a few seconds, depending on the adjustement of your NAS' "spin off" time.... that's it.
    Hi, thanks for your suggestion - but unfortunately I don't think this will solve the root cause of my problem.
    My problem is, that the NAS sometimes does not wake up from S3 - reading the log I assume, that the networkadapter (of the HTPC) is not yet ready to properly send the magic packet, thus not waking the NAS. IF the NAS was resuming, I have no problems to access all files via UNC-shares.
    What I tried for the moment is to add another networkcheck to let MPstandbyhandler give more time and extra step to wait for networkadapter to come online and IP-stack working. Will see, if this helps, but is more a "workaround" than a solution...
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Re: MPstandbyHandler

    I tried the handler but have a ´question. do i have to active Powerscheduler?
    Yes, otherwise MP doesn't handle standby/resume. The MPstandbyhandler monitors those activities and supports additional events control (afaik)
     

    Zwo

    New Member
    April 1, 2008
    1
    0
    Home Country
    Germany Germany
    Hi everybody,

    finally I am at the point of being totally frustrated with this whole S3 issue. Searching the forum did not help so far at this point.

    After waking up from resume, successfully recording a scheduled TV show and going back into the suspend mode the PC is not able to resume from standby another time. Neither manually via remote control nor via the PowerScheduler i.e. do another recording as scheduled. The PC powers up but the screens remains blank and I am not able to gain control of the PC or MP. The only solution is to shut down the PC via the power button.

    Going into standby the MPSH is set to kill MP and TVService immediately. I followed Luna96's advice to simply reboot the system at resume. It is not my preferred method (since it takes 2-3 min total) but this way I hope to get a "clean" restart. MSPH is executing the standard command for restarting the computer from a batch file (%windir%\system32\shutdown.exe -r -t 00).

    I attached the current settings for MP (general), the MPSH and the PowerScheduler (MPconfig & TvServer).

    I also added the ServiceLog for the MPStandbyHandler. Since I reboot the system when resuming I get a new log each time. I put them together manually this time.
    The scheduled record took place at 15:59 (start 3 min in advanced) and ended at 16:03 (end 3 min after). For some reason there is no log entry for the standby event afterwards, which definitely took place. Seems like, the MPSH never noticed the PC going into standby again...

    So if anyone knows a solution to this problem I would be grateful! I am helpless... :confused:
     

    Attachments

    • MP_1_General.png
      MP_1_General.png
      33.4 KB
    • MPSH_1_Common.png
      MPSH_1_Common.png
      21.6 KB
    • MPSH_2_Resume.png
      MPSH_2_Resume.png
      8.1 KB
    • MPSH_3_Suspend_1.png
      MPSH_3_Suspend_1.png
      8.3 KB
    • MPSH_3_Suspend_2.png
      MPSH_3_Suspend_2.png
      8.2 KB
    • PowerScheduler_1_General.png
      PowerScheduler_1_General.png
      5.9 KB
    • PowerScheduler_2_Advanced.png
      PowerScheduler_2_Advanced.png
      5.2 KB
    • TVServer_PS-Plugin_1_General.png
      TVServer_PS-Plugin_1_General.png
      32 KB
    • TVServer_PS-Plugin_2_Advanced.png
      TVServer_PS-Plugin_2_Advanced.png
      31.1 KB
    • TVServer_PS-Plugin_3_EPG.png
      TVServer_PS-Plugin_3_EPG.png
      29 KB
    • TVServer_PS-Plugin_4_Processes.png
      TVServer_PS-Plugin_4_Processes.png
      23.5 KB

    pisdu

    Portal Pro
    March 7, 2006
    202
    2
    Switzerland
    Hi there , im using successfully the plugin on XP sp 3.
    Wanna use it on 7 but noticed i cannot do an TV card hardware initialize , interface freezes if i try to open the hardware settings..
    Cannot do this on Windows 7 or there's a solution?

    Thanks a lot
     

    Users who are viewing this thread

    Top Bottom