Media Portal freezes on wake (1 Viewer)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Code:
    if (_suspended && !_resumedSuspended)
    ...to...
    Code:
    if (_suspended && _resumedAutomatic && !_resumedSuspended)

    I will try :)
    Can you explain what you have in mind with the change ? I try to think about what should happen but i would like your theory :)
    I need to look back what microsoft said about PBT_APMRESUMEAUTOMATIC, should be alone or always associate with PBT_APMRESUMESUSPEND.

    I remember @michael_t talk or link about it :)
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Can you explain what you have in mind with the change ? I try to think about what should happen but i would like your theory :)
    Sure. :)
    My theory is...
    We only want to trigger the "Resuming operation of user interface" etc. part of the patch when the PC is waking up (after PBT_EVENT.PBT_APMRESUMEAUTOMATIC is received but PBT_EVENT.PBT_APMRESUMESUSPEND is not received), not when it is suspended/suspending.

    _resumedAutomatic is set to false when PBT_EVENT.PBT_APMSUSPEND is received:
    https://github.com/MediaPortal/Medi.../MediaPortal.Application/MediaPortal.cs#L1779

    ...and set to true when PBT_EVENT.PBT_APMRESUMEAUTOMATIC is received:
    https://github.com/MediaPortal/Medi.../MediaPortal.Application/MediaPortal.cs#L1851

    So, we know that if _resumedAutomatic is false the PC is suspending/suspended, and if _resumedAutomatic is true we know that the PC is waking up.
    Therefore we can check _resumedAutomatic to check if the patch code should be executed.
    If _resumedAutomatic is true, the PC is waking so it is okay to execute the patch code; otherwise the patch code should not be executed.

    Is it clear? :)

    I need to look back what microsoft said about PBT_APMRESUMEAUTOMATIC, should be alone or always associate with PBT_APMRESUMESUSPEND.
    AFAIK PBT_APMRESUMEAUTOMATIC comes alone if the PC wakes without user input (eg. scheduled recording or EPG grabbing). If/when the user provides input later, Windows should send PBT_APMRESUMESUSPEND. However for Jeffrios and keeperoftracken that PBT_APMRESUMESUSPEND is never sent/received. It is strange... but I can't solve problems with Windows or third party software. I can only provide a patch/workaround for MediaPortal.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Yep it's clear :) i will go this way and revert my latest commit and we can test it :)
    Thanks again for your good and clear explanation :p
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Hello,

    Resume of "HTPC1" from deep sleep resulted in PC coming up with MP showing as a smaller black rectangle on top of a Windows desktop. After a few seconds the display switched to the usual MP full screen, however only as a black screen. PC was still running and it was possible to just terminate MP from the task bar. While I was about to collect logs, a restart kicked in and in the end previous logs were overwritten with new ones.

    Anyway, I now installed Seb's latest version and will go for another round.
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Alright, I stopped MP at 14:26 by sending the PC into Hibernate from the MP menu. I then resumed at 15:55 and the PC woke with the same MP home screen from where I had sent it into hibernate. No entry in the log after 14:26...
     

    Attachments

    • MediaPortal.zip
      71.7 KB

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Do you have full log ? to see what happen in event system etc. ?
    Also we have maybe a theory about PS fault but that not sure, could you reproduce the issue (always) and disable PS ?
    Thanks :)
     

    Users who are viewing this thread

    Top Bottom