Plugin: RefreshRateChanger (3 Viewers)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #61
    Yes, the issue probably is not related to refresh rate changing at all. Maybe only the retrieval of video frame "hangs" at the end of playback?
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    I downloaded the latest weekly and installed it on my laptop and on my HTPC.
    I tried the AtmoLight Beta 2 and my current dev version. With both i could not reproduce a blackscreen/hanging of MP2 after either stopping videoplayback nor ending videoplayback.

    I did find a bug though, i forgot to add a case for PlayerManagerMessaging.MessageType.PlayerEnded to the message handler, so at the moment, when a video ends on its own, AtmoLight will do nothing. This will result in still capturing the frames (instead of shuting off the leds (default setting)), but that works without a problem here aswell, and it should as you can configure to capture the menu and behave like this.
    Also in the ui capture method everything related to the video frames is in a try catch block.

    In this post: https://forum.team-mediaportal.com/threads/plugin-refreshratechanger.125796/page-6#post-1110378
    @kilik360 disabled leds for video playback and still encounters the blackscreen problem.

    What is happening from AtmoLight side in this scenario:

    Message handler gets called, video started, atmolight tries to change effect to LEDsDisabled, but that is already active, so AtmoLight does nothing.
    The UI capture event gets called every frame.
    First few lines:

    Code:
        public void UICapture(object sender, EventArgs args)
        {
          if (!AtmoLightObject.IsConnected() || !AtmoLightObject.IsAtmoLightOn() || AtmoLightObject.GetCurrentEffect() != ContentEffect.MediaPortalLiveMode)
          {
            return;
          }

    With IsAtmoLightOn=false and GetCurrentEffect=LEDsDisabled, we will enter this if statement and return.
    When video ends, as i forgot to add that the the message handler, nothing happens in AtmoLight.

    So, i dont have any clue why AtmoLight would cause a problem here :(. But maybe im just blind.

    https://github.com/ambilight-4-mediaportal/AtmoLight/blob/master/AtmoLight.MediaPortal2/Plugin.cs
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #63
    Thanks for looking into this issue! From reading your source code I also can't see any obvious issue :(

    I'm away this week, so I have few time only.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #64
    One question: I only found one place where the refreshrate is considered:
    https://github.com/ambilight-4-medi...er/AtmoLight.MediaPortal2/Plugin.cs#L212-L213

    Is it possible that inside the "AtmoLightObject" might appear problems, if at player ending the refresh rate is changed back to original one?

    Another thing comes into my mind: it could be required to sync frame grabbing to rendering (see SkinContext.DeviceSceneEnd event), so you don't query surface while scene is still being rendered (although this has also nothing todo with refresh rate)
     
    Last edited:

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    One question: I only found one place where the refreshrate is considered:
    https://github.com/ambilight-4-medi...er/AtmoLight.MediaPortal2/Plugin.cs#L212-L213
    Is it possible that inside the "AtmoLightObject" might appear problems, if at player ending the refresh rate is changed back to original one?
    No, not that i can think of. Worst case scenario, The calculations in ChangeDelay() result in 0 or a negative number.
    If that happens, the field in the core (AtmoLightObject, probably should change the name to coreObject) just wont get changed (https://github.com/ambilight-4-mediaportal/AtmoLight/blob/master/AtmoLight.Core/Core.cs#L937-L946)
    The core itself does not care what refreshrate is being used. It just delays sending the color infos to the the target software based on the delay we gibe it. And if the delay is 0, it sends it the next chance it gets (in a thread).


    Another thing comes into my mind: it could be required to sync frame grabbing to rendering (see SkinContext.DeviceSceneEnd event), so you don't query surface while scene is still being rendered (although this has also nothing todo with refresh rate)
    I know very little of DirectX, SharpDX or redering in generall, so might be. But UICapture() is called by the event SkinContext.DeviceSceneEnd (see: https://github.com/ambilight-4-medi.../master/AtmoLight.MediaPortal2/Plugin.cs#L118) so i was under the impression this only gets called when a frame has been rendered completly and is ready?!
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #67
    Ok, if you use this event it's good. I have not checked all code, so sorry if I missed it.

    Can you reproduce the "hang" in video end with refresh rate change and AtmoLight enabled?
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Ok, if you use this event it's good. I have not checked all code, so sorry if I missed it.
    No problem, i was not expecting you to look through all of the code ;).

    Can you reproduce the "hang" in video end with refresh rate change and AtmoLight enabled?
    No :(. Tested on 2 systems (htpc and laptop) and with last official release and our current dev build.
     

    kilik360

    MP Donator
  • Premium Supporter
  • September 3, 2010
    576
    235
    Home Country
    Canada Canada
    I think a lot of people will start to move over to mp2 once this is finished, i think a big part of people avoiding it is the lack of a skin that makes it shine to show what it can do.
    Count me in this group!

    For me, it's the RefreshRate Changer who breaks me to do the switch.[DOUBLEPOST=1418393126]
     

    Users who are viewing this thread

    Top Bottom