A guide to stutter free playback with Reclock (1 Viewer)

red5goahead

MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Italy Italy
    Not a good way, but you could query PowerStrip for such information (bad since requires 3rd party application and wont work with Nvidia > 7xxxx series). Reading from HW would be the best way, but I guess you wont want to develop another PowerStrip (and not to be able to read from newer Nvidia GPUs).
    A good solution could be a reclock exposed com on .net library to query the exactly refresh used by reclock itself.
    I'll try to ask this to Jong or James (reclock devs team). (better if reclock is not necessary indeed)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Not a good way, but you could query PowerStrip for such information (bad since requires 3rd party application and wont work with Nvidia > 7xxxx series). Reading from HW would be the best way, but I guess you wont want to develop another PowerStrip (and not to be able to read from newer Nvidia GPUs).
    A good solution could be a reclock exposed com on .net library to query the exactly refresh used by reclock itself.
    I'll try to ask this to Jong or James (reclock devs team). (better if reclock is not necessary indeed)
    Preferably a C++ based library, since dshowhelper.dll is not a NET component :) I guess ReClock is just asking from the DirectDraw / DirectX about the refresh rate (and neither of those are as accurate as PowerStrip)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I was just following the technique that was already in use (but with calculated sleep times rather than looping with a 1ms sleep each iteration). I don't want to use anything that wastes CPU time e.g. polling for vsync, given that this is running at 'critical' thread priority.

    It's only trying to push the 'paint' start time approx in the middle of the low/high limit period.
    If thread context switch happens during a sleep (most likely it will since sleep is telling system that it is allowed to do it :)) it could be as high as 10 ms that the sleep will take. And that is already almost the whole frame with 60hz display that the v-sync can "travel" during that time.

    Causing high CPU usage in that part of code is not a sin, it won't be causing any playback issues like it would be if done in some other places. Also since the v-sync is most likely already in the place the high CPU spike wont be a long one. After all, that part of the code should be doing only a small fine tuning to the paint position.

    I think the Sleep(1) was a relic, and shouldn't be there in the first place. Also I think I didn't see any CPU usage rise when busy polling in that part of the code.
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,540
    5,038
    Cambridge
    United Kingdom United Kingdom
    Country flag
    Not a good way, but you could query PowerStrip for such information (bad since requires 3rd party application and wont work with Nvidia > 7xxxx series). Reading from HW would be the best way, but I guess you wont want to develop another PowerStrip (and not to be able to read from newer Nvidia GPUs).
    A good solution could be a reclock exposed com on .net library to query the exactly refresh used by reclock itself.
    I'll try to ask this to Jong or James (reclock devs team). (better if reclock is not necessary indeed)
    Preferably a C++ based library, since dshowhelper.dll is not a NET component :) I guess ReClock is just asking from the DirectDraw / DirectX about the refresh rate (and neither of those are as accurate as PowerStrip)
    AFAIK, if it's not in it's timings database, it measures the refresh rate (this is the red/green flashing icon period - quite a long time period sometimes). Once it's got the display timing stored, it then just recalls the values each time (to speed things up at start of play).

    Tony

    I was just following the technique that was already in use (but with calculated sleep times rather than looping with a 1ms sleep each iteration). I don't want to use anything that wastes CPU time e.g. polling for vsync, given that this is running at 'critical' thread priority.

    It's only trying to push the 'paint' start time approx in the middle of the low/high limit period.
    If thread context switch happens during a sleep (most likely it will since sleep is telling system that it is allowed to do it :)) it could be as high as 10 ms that the sleep will take. And that is already almost the whole frame with 60hz display that the v-sync can "travel" during that time.

    Causing high CPU usage in that part of code is not a sin, it won't be causing any playback issues like it would be if done in some other places. Also since the v-sync is most likely already in the place the high CPU spike wont be a long one. After all, that part of the code should be doing only a small fine tuning to the paint position.

    I think the Sleep(1) was a relic, and shouldn't be there in the first place. Also I think I didn't see any CPU usage rise when busy polling in that part of the code.
    What about the timer + callback technique used in scheduler.cpp ? (but I don't have enough windows programming knowledge to understand how that really works.....)

    Tony
     

    mrmojo666

    MP Donator
  • Premium Supporter
  • January 24, 2006
    599
    179
    Turin
    Italy Italy
    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
    GOOD JOB!

    I don't know what you exactly did but it work like a charm on my htpc this almost fix my hard stuttering problem https://forum.team-mediaportal.com/606737-post21.html.
    Finally i get all working as it must work, playing pal 50i tv hd and sd is Ok at 50hz just get few framedrops, but they are not visible during play, no more stuttering :)

    I think you found the right way to fix this annoying problem.

    i don't use reclock , all is perfectly sync witout that.

    Thank you i'll keep your directshowhelper as my treasssssure ;)
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,540
    5,038
    Cambridge
    United Kingdom United Kingdom
    Country flag
    OK, good - and you are using Win 7 with an ATi 4670 video card too :) (I can only test it on Vista with nVidia 9500GT)

    It doesn't need/assume ReClock, but it tries to accomdate the timing changes ReClock can perform....

    Tony
     

    mrmojo666

    MP Donator
  • Premium Supporter
  • January 24, 2006
    599
    179
    Turin
    Italy Italy
    Country flag
    OK, good - and you are using Win 7 with an ATi 4670 video card too :) (I can only test it on Vista with nVidia 9500GT)

    It doesn't need/assume ReClock, but it tries to accomdate the timing changes ReClock can perform....

    Tony

    Would be nice if us will keep in contact, to fine tuning.............. now , as i told , is stutter free....... would be GREAT if you can reach total stutter free with no framedrops at all ;)


    I'm really happy to help you in testing this customization, seems no one of the team is interested in get for ALL mp users stutter free experience ;)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    What about the timer + callback technique used in scheduler.cpp ? (but I don't have enough windows programming knowledge to understand how that really works.....)
    I'm not sure how reliable those are, but in any case CPU polling is most accurate so I would suggest you to do some testing if it has any affect on CPU usage (if I remember correct I didn't see any increase in CPU usage with my low end dev pc).
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,540
    5,038
    Cambridge
    United Kingdom United Kingdom
    Country flag
    What about the timer + callback technique used in scheduler.cpp ? (but I don't have enough windows programming knowledge to understand how that really works.....)
    I'm not sure how reliable those are, but in any case CPU polling is most accurate so I would suggest you to do some testing if it has any affect on CPU usage (if I remember correct I didn't see any increase in CPU usage with my low end dev pc).
    OK, I'll give it a try (but I'll incorporate the latest 'crash to the desktop' fixes from SVN 25556 first - I've had those crashes happen a few times...)

    I take your point about sleep() allowing Windows to steal to much time sometimes :)

    Tony
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    What about the timer + callback technique used in scheduler.cpp ? (but I don't have enough windows programming knowledge to understand how that really works.....)
    I'm not sure how reliable those are, but in any case CPU polling is most accurate so I would suggest you to do some testing if it has any affect on CPU usage (if I remember correct I didn't see any increase in CPU usage with my low end dev pc).
    OK, I'll give it a try (but I'll incorporate the latest 'crash to the desktop' fixes from SVN 25556 first - I've had those crashes happen a few times...)
    Just do a SVN update and the merging should be automatic (unless there are conflicts with the local changes you have made).
     

    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