﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
13536	Refine AVSync2 Algorithm	pletch	Mark Kendall	"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."	Patch - Feature	closed	minor	31.0	MythTV - Video Playback	Master Head	medium	Fixed	AVSync2 AVSync sync		0
