Plugin: RefreshRateChanger (1 Viewer)

morpheus_xx

Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,972
    Germany Germany
    Country flag
    • 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
    Germany Germany
    Country flag
    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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,972
    Germany Germany
    Country flag
    • 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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,972
    Germany Germany
    Country flag
    • 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
    Germany Germany
    Country flag
    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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,972
    Germany Germany
    Country flag
    • 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
    Germany Germany
    Country flag
    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
    574
    232
    Canada Canada
    Country flag
    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 (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    M Installing Plugins Newcomers Forum 0
    joecrow 1.25.0 Radio Time plugin fails after Resume from Sleep with MP 1.25 Bugreports 4
    P MP2: US user, OTA - can NOT get SchedulesDirect plugin to work on MP1 or MP2 --> how do I get OTA schedule? General 5
    E aktuelle englische Forums Webseite von - Showtime Plugin v3 Plugins & Erweiterungen 4
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    joecrow MultiShortcut Plugin (Uavailable) in DWHD skin General Support 58
    vapourEyes Building TV Plugin General Development (no feature request here!) 49
    Golf4 Nach Windows-Updates läuft TV-Plugin nicht mehr Allgemeines Support- und Diskussionsforum 0
    joecrow How about a Launcher plugin for MP1? MediaPortal 1 6
    D [solved] TVServer Plugin must be missing something. General Development (no feature request here!) 1
    framug Nouveau plugin XmlTvFR pour récupérer le guide télé français Kazer / ZguideTv (WebEPGfr) 11
    emphatic Allow remote control mapping of all plugins Improvement Suggestions 0
    D Where should plugins be located on hard drive? General Support 0
    D how to disengage from one version of a plugin to use another Newcomers Forum 0
    cbr954rr How to disable a pre-configured plugin? General 2
    mrmojo666 [Plugin]Marantz Control Plugin 0.0.0.2 MediaPortal 1 Plugins 2
    mrmojo666 beginner: trying to write a plugin, need help to catch event General Development (no feature request here!) 3
    framug [Rejected] Fix PowerScheduler plugin for MP2 single seat Submit: Code Patches 9
    doskabouter [Question] Stale plugins Developer Discussions 9
    M MP1 stops responding after Starting Plugins General Support 14
    Terra LAVFilter Plugin cannot be updated (MP1.23) MediaPortal 1 Plugins 10
    L Mediaportal 1.21 and Windows 10: user schedules de-activated when powerscheduler plugin is selected General Support 1
    C Can the XmlTv Plugin handle 600+ channels? General 3
    M Online Video Plugin V.2.32 keine Installtion unter MediaPortal 1.22 ? TV / Streaming 3
    emphatic Pictures in the cloud - would a plugin be possible for services like Google Photos MediaPortal 1 Plugins 1
    Similar threads

























    Top Bottom