A guide to stutter free playback with Reclock | Page 8

Discussion in 'Codecs, External Players' started by ErikLarsson, September 30, 2008.

  1. red5goahead
    • Premium Supporter

    red5goahead MP Donator

    Joined:
    November 24, 2007
    Messages:
    695
    Likes Received:
    96
    Gender:
    Male
    Occupation:
    Software engineering
    Location:
    Italy, North West
    Ratings:
    +144 / 1
    Home Country:
    Italy Italy
    Show System Specs
    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?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    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).

    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
     
  4. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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
     
    • Like Like x 1
  5. red5goahead
    • Premium Supporter

    red5goahead MP Donator

    Joined:
    November 24, 2007
    Messages:
    695
    Likes Received:
    96
    Gender:
    Male
    Occupation:
    Software engineering
    Location:
    Italy, North West
    Ratings:
    +144 / 1
    Home Country:
    Italy Italy
    Show System Specs
    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
     
  6. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    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).
     
  7. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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
     
  8. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    As I said in one of my previous posts, it is not language issue we have here, but instead a logic issue :D
     
  9. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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
     
  10. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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
     
    • Like Like x 3
  11. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    Please post the patch file as well.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!