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

red5goahead

MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Home Country
    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

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    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
    Home Country
    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

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    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

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    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

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    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

    Top Bottom