Media Portal freezes on wake (4 Viewers)

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    @Jeffrios
    Thank you for the log files. They show that there's still something not right on your system. This something could be the underlying cause of your resume problem, and perhaps the cause of the crashes as well. On second examination, the same problem seems to apply to @keeperoftraken .

    What I see is this.

    MP resumes from standby:
    [2015-11-03 17:30:59,307] [Log ] [MPMain ] [INFO ] - Main: WM_POWERBROADCAST (PBT_APMRESUMESUSPEND)

    Databases are opened etc. That stuff is not relevant.

    Now MP tries to activate the user interface:
    [2015-11-03 17:31:10,753] [Log ] [MPMain ] [INFO ] - Main: Resuming operation of user interface
    [2015-11-03 17:31:10,753] [Log ] [MPMain ] [INFO ] - Main: OnResumeSuspend - Switch to basic home screen
    [2015-11-03 17:31:10,862] [Log ] [MPMain ] [DEBUG] - Window: WindowPlugins.home.GUIBasicHome init
    [2015-11-03 17:31:10,878] [Log ] [MPMain ] [DEBUG] - Main: OnResumeSuspend - set GUIGraphicsContext.State.RUNNING
    [2015-11-03 17:31:10,878] [Log ] [MPMain ] [DEBUG] - Main: OnResumeSuspend - Init Input Devices

    ...and then the thread is locked. :(
    I can tell that the thread is locked because there is no "Main: OnResumeSuspend - Done" message in the log.

    After the thread is locked MP receives the notification that you want to use the interface:
    [2015-11-03 17:31:10,893] [Log ] [MPMain ] [INFO ] - Main: WM_POWERBROADCAST (PBT_POWERSETTINGCHANGE)
    [2015-11-03 17:31:10,893] [Log ] [MPMain ] [INFO ] - Main: User is providing input to the session

    ...and my patch activates the user interface successfully:
    [collapse][2015-11-03 17:31:10,909] [Log ] [MPMain ] [INFO ] - Main: Resuming operation of user interface
    [2015-11-03 17:31:10,909] [Log ] [MPMain ] [DEBUG] - Main: OnResumeSuspend - set GUIGraphicsContext.State.RUNNING
    [2015-11-03 17:31:10,909] [Log ] [MPMain ] [DEBUG] - Main: OnResumeSuspend - Init Input Devices
    [2015-11-03 17:31:10,909] [Log ] [MPMain ] [INFO ] - Remotes: Init was called before Stop - stopping devices now
    ...
    [2015-11-03 17:31:10,956] [Log ] [MPMain ] [INFO ] - X10 debug: Could not get interface
    [2015-11-03 17:31:10,956] [Log ] [MPMain ] [DEBUG] - Main: OnResumeSuspend - Autoplay start listening
    [2015-11-03 17:31:10,956] [Log ] [MPMain ] [INFO ] - Main: OnResumeSuspend - Done[/collapse]

    However, if the thread did not get locked then the interface would already have been activated and my patch would not be required.

    So, the question is: why is the thread locked?
    After checking the code, it seems to me that the only place that the thread could get locked (since all input/remote handlers are disabled) is here:
    https://github.com/MediaPortal/Medi...ugins/Remotes/X10Remote/X10Remote.cs#L88-L115

    I think that loading should not be necessary unless the X10 input/remote handler is actually enabled.

    @Sebastiii
    Can you please build another installer with the following changes:
    1. Remove the previous patch. I think it should not be needed.
    2. Add the following code:
    Code:
    if (!_controlEnabled)
    {
      return;
    }

    ...after this line:
    https://github.com/MediaPortal/Medi...otePlugins/Remotes/X10Remote/X10Remote.cs#L78

    @Jeffrios and @keeperoftraken : please could you install and test the new installer once it becomes available, and please post log files regardless of success or failure.
     

    keeperoftraken

    Portal Member
    September 30, 2012
    14
    7
    St ives, Cambs
    Home Country
    Great Britain (UK) Great Britain (UK)
    downloaded and tested. but fails.
    Mediaportal front end is not responding after waking up for scheduled recording. programme gets recorded ok and powerscheduler hibernates the pc after.
    waking the pc myself all is ok, mediaportal fuctions as it should.

    Logs attached
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    @keeperoftraken could you set debug level to MP config :)
    upload_2015-11-6_13-9-8.png

    Thanks :)
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Thanks again guys. I really appreciate your patience, and the time you've taken to test for us. :)

    It looks like both patches are required.

    The first patch solves the obvious "unusable interface on auto-resume" problem. As per my previous comment: I'm not so sure about the compatibility, so I recommend to include it in a pre-release.

    The second patch solves the non-obvious "deadlocked resume thread" problem. In my opinion it is safe to include in MP 1.13 pre-release or final.
     

    Users who are viewing this thread

    Top Bottom