MediaPortal Audio renderer - better video playback quality (6 Viewers)

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    New test binaries available: https://forum.team-mediaportal.com/637138-post3.html


    version 14 - based on SVN revision 26527

    Minor fix release.

    • Fixed a crash with the OnlineVideos plugin
    • Fixed a deadlock on stream automatic type changes
    • Minor adjustment to rendering stats layout
    • Added workaround for the MS Video decoder reporting wrong fps values and therefore causing incorrect bias calculation.
    • Improving bias calculation accuracy
    • Added a setting for toggling the sync adjustment on/off for debugging. When disabled the EVR presenter is not able to do the minor v-sync position adjustments.
    • Improving A/V sync - drifting is tried to be minimized (drift handling needs to be refactored completely to fix it completely)

    New setting:

    EnableSyncAdjustment

    Toggles between v-sync adjustments on / off. By default this is on. Use only for debugging purposes (like sync drifting).


    Please note that this version wont still probably solve the A/V sync drifting on all PCs (althou it should reduce the issue at least a bit). When encoutering the drift issue please do the following:

    • Play a video (or two prefereably with 1:1 and non 1:1 material) for a hour
    • Try to guess how much audio is behind / ahead the video
    • Take a screen shot that shows the ! stats and post it into this thread
    • Repeat steps 1 & 2 with versions 12 & 13 (also try to play around with the following debug settings: EnableSyncAdjustment, EnableTimestretching, ForceDirectSound & HWBasedRefClock

    I know it will take quite amount of time to test that drifting and to see if any of those things make difference, but believe me it will take much more time (and has already taken) than you could ever imagine to try to debug the issue here locally - making one small code change and then waiting at least 1 hour for the issue to appear or not). So, please try to give some feedback when possible. davidf is currently helping me to write a completely new way of taking care of the A/V sync drifting - hopefully this will sort it out finally.
     

    robyf

    Retired Team Member
  • Premium Supporter
  • June 20, 2005
    1,076
    278
    52
    Bolzano
    Home Country
    Italy Italy
    Tested with Live TV and microsoft video codec and solved the problem with the codec non detecting correct frame rate. Great work!! :D:D
     

    red5goahead

    MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Home Country
    Italy Italy
    As usual work fine with HWBasedRefClock disabled. Enabling it the drift is huge since early few seconds.

    two images. first on after about 3700 frames and HWBasedRefClock=0. the audio is perfect in synch also after about 3 minutes.
    no problem at all for for than 40 minutes. play was awsome smooth.

    hwbasedrefclockno.jpg


    second image same point and HWBasedRefClock=0.
    the audio was awfully out of synch. the video and the sub was in synch. the audio was delayed.

    hwbasedrefclockyes.jpg


    Why 25.576 fps?
     

    micko

    Portal Pro
    May 27, 2006
    258
    51
    Home Country
    Finland Finland
    Test results (used 1:2 and and non 1:2 material):
    - v12 & v13 HWBasedRefClock disabled: Bad A/V sync drifting. Noticeable after ~15mins (audio is probably ~100ms ahead the video).
    - v13 HWBasedRefClock enabled: A/V sync drifting noticeable after ~30mins.
    - v14: A/V sync OK!

    I'm not sure was it reference clock problem causing my drifting issues after all, because with the latest version (14) A/V-sync seems to be ok even if I set HWBasedRefClock disabled. Maybe it was some other change you made to this version..?
    Need to do more testing (say 3h movie) to be sure, but it seems this version solved my sync problem :D
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    second image same point and HWBasedRefClock=0.
    the audio was awfully out of synch. the video and the sub was in synch. the audio was delayed.
    Why 25.576 fps?

    Should it be:

    HWBasedRefClock=1?

    In any case 1,0024541 is really alarming - it would mean that the audio and system clocks are running on really different speeds (other is 1,0024541 times faster than the other). This could be caused by few things:

    1) motheboard and HW really has those different running clocks - unlikely since the HWBasedRefClock=0 case works without drifting
    2) bug in audio renderer code related to the multiplier calculation - this could be related to the Xonar buffer size oddity

    Please check how the multiplier behaves directly after starting the playback and then how (if at all) it changes during the playback.

    If te multiplier is stable from the start (and wotn for example slide from 1.02 to the 1.002 during few minutes) I'll provide one test binary that has the infamous * / change :)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Test results (used 1:2 and and non 1:2 material):
    - v12 & v13 HWBasedRefClock disabled: Bad A/V sync drifting. Noticeable after ~15mins (audio is probably ~100ms ahead the video).
    - v13 HWBasedRefClock enabled: A/V sync drifting noticeable after ~30mins.
    - v14: A/V sync OK!

    I'm not sure was it reference clock problem causing my drifting issues after all, because with the latest version (14) A/V-sync seems to be ok even if I set HWBasedRefClock disabled. Maybe it was some other change you made to this version..?
    Need to do more testing (say 3h movie) to be sure, but it seems this version solved my sync problem :D

    There were few other improvements for the drifting correction (trying to calculate how much reference clock and audio resampling are modifying the different timelines and then resampling more / less).

    I'm sure the current code is not 100% perfect and that is why I'm working eith davidf for more accurate way to handle the different things that generate drifting during the resampling etc.
     

    red5goahead

    MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Home Country
    Italy Italy
    1) motheboard and HW really has those different running clocks - unlikely since the HWBasedRefClock=0 case works without drifting
    If te multiplier is stable from the start (and wotn for example slide from 1.02 to the 1.002 during few minutes) I'll provide one test binary that has the infamous * / change :)

    Motherboard Asus P5K and audio Asus Xonar DX. weird situation.

    I'l try that test later.
    which is the proper multiplier ?

    Also I have to test with Pal material on 50 HZ o 75 HZ refresh..
    That case was on cinema material.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    which is the proper multiplier ?

    Also I have to test with Pal material on 50 HZ o 75 HZ refresh..
    That case was on cinema material.

    Refresh rate or source material wont affect the multiplier at all. It is just the ration between the audio HW clock and system performance counter value (high accuracy time source).

    The correct one -> there is no one, but the closer the 1.0x the multiplier is the closer the audio and system clocks are advancing.
     

    red5goahead

    MP Donator
  • Premium Supporter
  • November 24, 2007
    695
    144
    Italy, North West
    Home Country
    Italy Italy
    which is the proper multiplier ?

    Also I have to test with Pal material on 50 HZ o 75 HZ refresh..
    That case was on cinema material.

    Refresh rate or source material wont affect the multiplier at all. It is just the ration between the audio HW clock and system performance counter value (high accuracy time source).

    The correct one -> there is no one, but the closer the 1.0x the multiplier is the closer the audio and system clocks are advancing.

    Ah ok. I ask you because you told us to test with 1:1 and non 1:1 material so I thought was important.

    Please remberer me why you are developing a new reference clock. Do you think will be an improve than Reclock? :D
     

    cfforce

    MP Donator
  • Premium Supporter
  • March 4, 2008
    241
    21
    Home Country
    Netherlands Netherlands
    Using V14 atm, and working fine with video's, but when i use it with LiveTV, when switching from a HD channel with stereo; to HD channel with Dolby(5.1); nothing happens, when i change back to my normal output (SPDIF) all is working fine..
     

    Users who are viewing this thread

    Top Bottom