Mailing List Archive

Ticket #13383: AVSync2 catch-up problem
#13383: AVSync2 catch-up problem
-----------------------------------------+---------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Keywords:
Ticket locked: 0 |
-----------------------------------------+---------------------------
AVSync2 catch-up of audio sync is not quick enough especially when jumping
around a lot.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

Other issues:

I have noticed another artifact on the shield with playback of 23.98p fps
material at 1.2x on a 4k60hz p display. every second or so you see an old
frame where the motion jitters. I suspect this is frame stretching but the
page buffer is still flipped

Ive seen another avsync2 artefact (on shield). I was watching a program
(1080i 25fps) at 1.2x on 60Hz TV. Smooth playback for 5 secs then about 2
secs of drop every 2nd frame. Note 25*2*1.2 == 60Hz so there must be some
synchrony issue.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:1>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190201_1637_catchup.patch" added.

Proposed patch to catch up synchronization faster when off by more than
200 ms

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

There are a couple of bugs in the AVSync2 code that were not noticed until
I tried running it at 2x speed. At 2x speed it goes crazy, accelerating
and stopping repeatedly after a jump.

The audio reset I included in this patch is causing some rather weird
behavior.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:2>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190204_1416_catchup.patch" added.

Updated patch that fixes AVSync2 bugs and takes out the audio reset. This
should give a better experience, especially in speedup cases.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190206_1447_catchup.patch" added.

Next iteration, hopefully the last. Eliminates the judder after a jump and
successfully discards excess audio that was causing irritating artifacts.
Also works with speedup.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

Patch number 3 did not work very well. I expect this one to be a big
improvement.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:3>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190207_1442_catchup.patch" added.

Next attempt - I have changed it to better cater for the case where audio
is ahead of video. Pause audio to let video catch up. Also it seems that
the drop frame logic was conflicting with the audio adjustment logic so I
reinstated the check I had removed.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190208_1644_catchup_plus.patch" added.

This adds some suggestions from Mark S: (1) Avsync delta (and
GetAudioTime() should be measured just after wait_for_time() or Show() and
saved for next pass, where it is acted upon. (2) remove the test for >
40ms and use the amount specified in AVSyncIncrementMS as the maximum but
no minimum.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

With this change, on my system, the audio difference (ms) stays between -5
and +5, instead of between -40 and +40. Will anybody notice the
difference?

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:4>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190212_1721_catchup_plus_fixed.patch" added.

New version of patch that fixes LiveTV. When starting live TV there may be
a few short pauses while recording catches up with playback, then it will
be smooth.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* status: new => accepted


--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:5>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by mspieth):

patch 6 looks fine

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:6>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190213_1544_catchup_plus.patch" added.

Adds a setting (Setup->Video->Playback->General->Live TV wait. Setting a
vaule in there causes a pause for that number of milliseconds when
starting Live TV. Also reduce the number of Live TV catch-up messages.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

The number of milliseconds delay for Live TV defaults to 0. Setting a
value of around 4000 allows Live TV to start without any stuttering. If no
value is set, it will catch up but may take a minute or so of occasional
stutter.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:7>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190214_1507_catchup_plus.patch" added.

The Live TV Wait is now applied when starting Live TV, changing channels
or changing inputs. Also the maximum Live TV wait is now 10 seconds

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

I have committed a fix 6b402ca5a3b8c45c9ee190aaaf0e63a0d5548855 for
avsync2 improvements.

There is a seperate commit 90b4ec347fd01e40f97427de8ab261f74e9b2d68 for
LiveTV stutter.

I have not committed the change to add a Live TV delay setting.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:8>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* Attachment "20190215_1358_liveTV_delay.patch" added.

Patch for Live TV delay setting.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------

Comment (by Peter Bennett):

This patch is bad - it fails when changing channels using the program
guide. Please disregard it.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:9>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: closed
Priority: minor | Milestone: needs_triage
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution: Fixed
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Peter Bennett):

* status: accepted => closed
* resolution: => Fixed


Comment:

Base problems are fixed. Live TV delay is not committed as it did not work
and is controversial.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:10>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13383: AVSync2 catch-up problem [ In reply to ]
#13383: AVSync2 catch-up problem
-------------------------------------+-------------------------------
Reporter: Peter Bennett | Owner: Peter Bennett
Type: Bug Report - General | Status: closed
Priority: minor | Milestone: 31.0
Component: MythTV - Video Playback | Version: v30-fixes
Severity: medium | Resolution: Fixed
Keywords: | Ticket locked: 0
-------------------------------------+-------------------------------
Changes (by Stuart Auchterlonie):

* milestone: needs_triage => 31.0


--
Ticket URL: <https://code.mythtv.org/trac/ticket/13383#comment:11>
MythTV <http://www.mythtv.org>
MythTV Media Center