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

Owlsroost

Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Not yet - the code's a bit messy at the moment, and I'd like a few people to try it first so I know if it's a real improvement.

    How do you create the patch files ? (currently there's four modified source files)

    Tony
     

    red5goahead

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

    Cool! :D

    I'll try this evening... :D
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Not yet - the code's a bit messy at the moment, and I'd like a few people to try it first so I know if it's a real improvement.

    How do you create the patch files ? (currently there's four modified source files)

    Right click on a mediaportal folder and tortoise has "create patch".

    btw. If someone would be really strict the DLL should be removed (based on GPL) since there is no source code made public :D
     

    Seeco

    Portal Pro
    October 15, 2007
    241
    7
    Linköping
    Home Country
    Sweden Sweden
    I have a general question about Reclock, refresh rates etc.

    Before when playing 23.976fps material, I used Reclock with a 24Hz refresh rate to make the fps and Hz match. Now it is possible to set a 23.976Hz refresh rate in ATI's CCC. However, when I bring up the OSD in MP during playback the RR says 23.974Hz.

    At first I tried using Reclock with the 23.974Hz refresh rate. I figured that 23.974 at least was closer to 23.976 than 24. Only problem was that Reclock didn't seem to accept it, it didn't know what to do with the video material with a 23.976Hz refresh rate. I guess Reclock can only adjust the fps to 24?

    What do you think would work best for me - continue with the 23.974Hz without Reclock, or go back to 24Hz with Reclock? Are there other benefits to using Reclock?

    I use Win 7. Does anyone know if the Vsync discussion applies to this OS? I haven't had any VSync issues (that I know of) since i stopped using XP.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Not yet - the code's a bit messy at the moment, and I'd like a few people to try it first so I know if it's a real improvement.

    How do you create the patch files ? (currently there's four modified source files)

    Right click on a mediaportal folder and tortoise has "create patch".

    btw. If someone would be really strict the DLL should be removed (based on GPL) since there is no source code made public :D

    OK, to keep the pedants happy, current source code attached ;)

    Note this is based on rev 25466 sources, so doesn't incorporate the two most recent SVN updates (and it's messy in places, with blocks of commented-out code etc)

    Tony
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Just a quick note, since you are basic the v-sync adjustment on m_dDetectedScanlineTime, have you made sure that the results are always correct? I did disable that estimation code since it would give wrong results (it could vary quite much between the runs, where it should be always the same and match pretty closely yo the one that you can calculate based on the screen refresh rate).
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    2nd quick note. Targeting the v-sync seems to use Sleep(). Sleep shouldn't be used since it is good way to miss a v-sync. If thread context switch happens the sleep is not accurate (it could cause missed v-sync). Instead of sleep you should wither use busy polling (CPU usage rises).
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Just a quick note, since you are basic the v-sync adjustment on m_dDetectedScanlineTime, have you made sure that the results are always correct? I did disable that estimation code since it would give wrong results (it could vary quite much between the runs, where it should be always the same and match pretty closely yo the one that you can calculate based on the screen refresh rate).

    I've only seen it get it wrong once, immediately after an auto refresh rate change, but I've seen the windows reported refresh rate incorrect much more often (after refresh rate changes). Also the windows reported rate(on Vista at least) is only an integer value, e.g it reports '59' for nVidia actual 59.94Hz refresh rate, so it's inaccurate anyway.

    It does a tight (currently within 2%) comparison of video-to-display rates to decide if vsync correction is possible, so if it gets the rate measurement wrong it just means the vsync correction is disabled.

    I'd like to measure the display refresh rate continuously (with minimal overhead), but I haven't come up with a good method so far.....

    Tony
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I've only seen it get it wrong once, immediately after an auto refresh rate change, but I've seen the windows reported refresh rate incorrect much more often (after refresh rate changes). Also the windows reported rate(on Vista at least) is only an integer value, e.g it reports '59' for nVidia actual 59.94Hz refresh rate, so it's inaccurate anyway.

    On my testing it had up to 5% deviance (not acceptable).

    On Windows 7 at least we get the real refresh rate (Win7RefrehsRateHelper.dll or something similar).


    I'd like to measure the display refresh rate continuously (with minimal overhead), but I haven't come up with a good method so far.....

    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).
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    2nd quick note. Targeting the v-sync seems to use Sleep(). Sleep shouldn't be used since it is good way to miss a v-sync. If thread context switch happens the sleep is not accurate (it could cause missed v-sync). Instead of sleep you should wither use busy polling (CPU usage rises).

    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 to approx in the middle of the low/high limit period.

    Tony
     

    Users who are viewing this thread

    Top Bottom