A guide to stutter free playback with Reclock (2 Viewers)

red5goahead

MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Italy Italy
    Basicly it means disabling AERO from Windows itself. Most likely ReClock is not able to get rid of the tearing, but who knows worth to try at least. On Windows Vista / 7 MP is always using v-sync from OS itself. Also nothing has changed regarding the v-sync (unless it is 1:2 fps / Hz matching, where EVR renderer tries to do slight correction presentation time based on the v-sync. Something that cannot be turned of).
    A good and maybe cheap solution could be let users choose the offical customized renderer or the evr standard one released with the operating system.
    Not possible since standard EVR renderer wont support providing texture for MP GUI engine.
    Ok.

    The wierd stuff is often MP start play fine . Sometimes start with the stuttering .in this case ,with shift-1 information overlay, I can notice a lot of peaks in the red line that exceed the green line , if I pause the play and restart MP restart playing fine most of time.
    Perhaps the solution could be check this peeks in the red line and try to put forward or backward the vsynch timing a little bit.
    wait for few frames and repeat this control and so on.
    I'm a c# developer, .Do you think could be possible for me try to recompile MP e try to debug this behavior?
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    The wierd stuff is often MP start play fine . Sometimes start with the stuttering .in this case ,with shift-1 information overlay, I can notice a lot of peaks in the red line that exceed the green line , if I pause the play and restart MP restart playing fine most of time.
    Perhaps the solution could be check this peeks in the red line and try to put forward or backward the vsynch timing a little bit.
    wait for few frames and repeat this control and so on.
    Sounds like EVR mixer issue. This is something I have tried to solve for a long time and then just gave up. I could figure out how to change the v-sync / EVR mixer frame presentation "spot" (I tried to calculate how v-sync and EVR mixer frame presentation times are differing)

    basicly it there seems to be two different "clocks". EVR mixer pushes frames at intervals of frame rate and v-sync eats frames at the same interval. Only the "spot" when EVR mixer thinks the frame should be presented is random one (starting a graph / pause changes this spot).

    Please note that MP doesn't implement a custom EVR mixer, so we are under on MS componet's behavior. Yellow line is the interestig line here (since it shows about the EVR mixer and v-sync correlation, how much frame presentation time differes from the actual v-sync).

    I'm a c# developer, .Do you think could be possible for me try to recompile MP e try to debug this behavior?
    Anything is possible :) But you need to take a peek into C++ source codes since all the magic happens in dshowhelper.dll (but don't worry the C++ is not a beast, especially only when you have to work with some logic changes and not to implement nothing new).

    1) download whole MP trunk from SVN
    2) read trunk\DirectShowFilters\VS Environment Setup.txt
    3) setup the environment according to the document so you are able to compile drectshow & directx related C++ projetcs
    4) open trunk\mediaportal\Core.cpp\Core.cpp.sln in Visual Studio
    5) try to compile dshowhelper project

    After that you can start experimenting with the EVR presenter code. EVRCustomPresenter.cpp is the most interesting place. Search for the My Dying Bride lyrics reference... "it will come". That will show how you can adjust the v-sync position in crude way (it affects only the time when MP tries to render the frame, GPU still has v-syncs that it obeys).

    ps. it is always nice to have one new pair of hands getting dirty in dshow / directx / evr... :D
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,539
    5,037
    Cambridge
    United Kingdom United Kingdom
    Country flag
    Thanks for the info Tourettes (and all the work on the renderer code) - I've just got to stage of compiling the dshowhelper myself, for much the same reasons as red5goahead.

    On my system for most material the current renderer is a big improvement over the MP102 version, but sometimes (interlaced HD MPEG-2 seems to be a particular problem after skipping through a file) I get short bursts (~1s or so) of very bad stutter which correspond to the yellow line - raster offset - switching from the top of the graph to the bottom.

    Time to do a few experiments......I'd already worked out that the "it will come" code section was one of the important bits :)

    Tony
     

    red5goahead

    MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Italy Italy
    Thanks for the info Tourettes (and all the work on the renderer code) - I've just got to stage of compiling the dshowhelper myself, for much the same reasons as red5goahead.

    On my system for most material the current renderer is a big improvement over the MP102 version, but sometimes (interlaced HD MPEG-2 seems to be a particular problem after skipping through a file) I get short bursts (~1s or so) of very bad stutter which correspond to the yellow line - raster offset - switching from the top of the graph to the bottom.

    Time to do a few experiments......I'd already worked out that the "it will come" code section was one of the important bits :)

    Tony
    Ok. owl glad to hear this.
    Remember another important issue. Media Portal never work proper on the secondary monitor (as extend one of course). Maybe for the same reason (ok Tourettes told me MP is intended for a classic htpc not for a general purpose pc but......)
    When a beta version will be shippable I might try it to check with reclock audio renderer.:D
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Ok. owl glad to hear this.
    Remember another important issue. Media Portal never work proper on the secondary monitor (as extend one of course). Maybe for the same reason (ok Tourettes told me MP is intended for a classic htpc not for a general purpose pc but......)
    2nd monitor has issues from GPU driver side as well. For example Nvidia's driver read me states that clone etc. modes aren't recommended for MCE (so it most likely targets all DirectX based media player applications).
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,539
    5,037
    Cambridge
    United Kingdom United Kingdom
    Country flag
    Thanks for the info Tourettes (and all the work on the renderer code) - I've just got to stage of compiling the dshowhelper myself, for much the same reasons as red5goahead.

    On my system for most material the current renderer is a big improvement over the MP102 version, but sometimes (interlaced HD MPEG-2 seems to be a particular problem after skipping through a file) I get short bursts (~1s or so) of very bad stutter which correspond to the yellow line - raster offset - switching from the top of the graph to the bottom.

    Time to do a few experiments......I'd already worked out that the "it will come" code section was one of the important bits :)

    Tony
    Ok. owl glad to hear this.
    Remember another important issue. Media Portal never work proper on the secondary monitor (as extend one of course). Maybe for the same reason (ok Tourettes told me MP is intended for a classic htpc not for a general purpose pc but......)
    When a beta version will be shippable I might try it to check with reclock audio renderer.:D
    I only said 'experiments' - you should be in a better position to look at this than me - I'm a hardware designer who very occasionally does a bit of C and assembler programming for embedded microcontrollers - this is the first time I've ventured into C++ , C# and Windows programming :)

    Tony
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I only said 'experiments' - you should be in a better position to look at this than me - I'm a hardware designer who very occasionally does a bit of C and assembler programming for embedded microcontrollers - this is the first time I've ventured into C++ , C# and Windows programming :)
    As I said in one of my previous posts, it is not language issue we have here, but instead a logic issue :D
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,539
    5,037
    Cambridge
    United Kingdom United Kingdom
    Country flag
    Just a quick update - experiments looking interesting - not there yet, but a reasonable amount of (frustrating) midnight oil has been burnt :)

    One issue is that ReClock manipulates the render sample clock dynamically, which makes adjusting sample presentation times, vsync correction etc a bit awkward.....

    Tony
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,539
    5,037
    Cambridge
    United Kingdom United Kingdom
    Country flag
    OK - time to put the tin hat on :)

    Attached is my version of the dshowhelper.dll - it works OK on my system (Vista32, nVidia 9500GT with 195.62 drivers) but has to be regarded as VERY EXPERIMENTAL so tread carefully !

    Please disable vsync correction in ReClock - the dshowhelper does it's own vsync correction internally.

    It only attempts vsync correction if the (measured) display refresh rate is within 2% of 1x or 2x the (measured) video frames-per-second rate.

    Tony
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    D Display Day of week in TV Guide? Feature Requests 0
    S Shortcuts MP1 My Recorded & TV Guide General 10
    framug Nouveau plugin XmlTvFR pour récupérer le guide télé français Kazer / ZguideTv (WebEPGfr) 11
    G Movie release date in guide Electronic Program Guide 2
    M [Rejected] Always show full hours in TV Guide Feature Requests 2
    M [fixed] [MP2-831] 12h time format shown in TV Guide with Swedish language settings Submit: Bug Reports 27
    geotwticher TV Guide EPG Grabber for Australia 2020 RIP freepg.tv General 4
    B [solved] MP2.2.3 TV Guide not scrolling with mouse wheel General 2
    R [solved] All Channel 7 stations listed in guide as 1000 Newcomers Forum 4
    T Freeview EPG-Anyone know what channel sends the guide data? Electronic Program Guide 10
    M Guide mapping schedules direct, tvguide, epg buddy How to get correct entry to the correct channel? Electronic Program Guide 0
    G Newb trying MP2, trouble with guide data General 5
    C How do I see the broadcast channel decimal numbers in the guide? General 0
    M [Pending] Fix for Inconsistent date display in TV Guide Submit: code patches (MediaPortal/TV-Server/etc.) 1
    G [solved] Are genres in the guide working properly General 4
    drumrob Inconsistent date display in TV Guide 1.22 Pre Release 15
    HTPCSourcer [Evaluate] MP2-Updates do not remove the GUID of previous installs MediaPortal 2 13
    Rob Hexenmeister Radio Guide descriptions in myradio.xml (screen 30) MediaPortal 1 Skins 3
    N Include both TV and Radio channels together in the guide Feature Requests 2
    doskabouter No guide info added due to a MYSQL deadlock Electronic Program Guide 1
    Patrik-See [solved] MediaPortal 2.2 Fernseher bleibt schwarz nach TV Sender Stop Allgemeines Support- und Diskussionsforum 2
    W Need help getting my TV guide working again General Support 1
    R TV Guide No Episode Info Displayed Electronic Program Guide 5
    ltfearme Feature request: Parental Guide IMDb+ 17
    B [Finished] TV Guide Navigation Button Archive 0
    Similar threads

























    Top Bottom