[mythtv-commits] Ticket #13536: Refine AVSync2 Algorithm

MythTV noreply at mythtv.org
Tue Dec 10 00:57:09 UTC 2019


#13536: Refine AVSync2 Algorithm
-----------------------------------------+---------------------------------
     Reporter:  pletch                   |      Owner:  Peter Bennett
         Type:  Patch - Feature          |     Status:  new
     Priority:  minor                    |  Milestone:  needs_triage
    Component:  MythTV - Video Playback  |    Version:  Unspecified
     Severity:  medium                   |   Keywords:  AVSync2 AVSync sync
Ticket locked:  0                        |
-----------------------------------------+---------------------------------
 The current implementation of AVSync2 uses proportional control with a
 control loop gain of 1. The approach leverages the difference in the audio
 & video timestamps and attempts to adjust the sync exactly back to zero in
 each iteration. Clamping of the maximum adjustment is enforced using user
 configured setting (avsync2adjustms).

 However, a gain value of 1 seems to be too high for systems that
 experience audio timestamp jitter when querying the audio chain causing
 high variability in the control. This can be somewhat mitigated through
 the use of the minimum allowable adjustment (1ms) but this lengthens time
 to achieve initial syncronization and can still cause control instability.

 A patch is proposed which revises the sync adjustment calculations to use
 a proportional gain of 0.04 and eliminate the clamp limits. This value was
 found to provide a good balance of rapid initial syncronization and
 control stability in the presence of jitter once syncronization is
 achieved.

 In addition, the patch includes necessary revisions to make AVSync2 the
 exclusive audio / video syncronization method, eliminate code associated
 with the legacy AVSync routine, and remove the configuration settings
 associated with AVSync2 in the mythfrontend UI as there are no longer any
 user configurable settings. These additional changes were provided by Mark
 Kendall per 9-Dec-2019 discussion on the mythtv-dev mailing list.

-- 
Ticket URL: <https://code.mythtv.org/trac/ticket/13536>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list