clock: fix audio/video synchronisation issues
This MR aim to fix #27023 (closed)
I decided to report more precise timing points from all audio outputs instead of trying to use a different mathematical function to "smooth" the clock average. This solution might be possible, but will always be less precise.
This MR is divided in two parts:
- The core part
- PulseAudio changes
I also tested it with all main aout modules (apple, android AAudio, Wasapi). If accepted, I will implement aout_TimingReport for all these modules.
The result ! Clock offset measurement in most common situation with this MR:
A/V sync is perfect and quick to stabilize, even with BT devices, no video drops reported in logs.
Compare with #27023 (closed)
PulseAudio with a BT device, playing a 25fps video (23ms audio sample)
PulseAudio with a BT device, playing a 60fps video (10ms audio sample)
PulseAudio with a speaker, playing a 25fps video (23ms audio sample)
PulseAudio with a speaker, playing a 60fps video (10ms audio sample)
Merge request reports
Activity
changed milestone to %4.0
added Component::Core: Clock label
requested review from @typx
assigned to @tguillem
- Resolved by Thomas Guillem
Remove the last commit !2018 (4d5870c2) That deserve its own MR/issue.
added 24 commits
- 0024412e - clock: trace the calculated offset
- 9ffcc974 - aout: move/hide aout_TimeGet implementation
- e3716dc2 - aout: dec: don't require a valid time_get cb
- f6c53c7d - aout: file: don't implement time_get
- 264972a9 - aout: amem: don't implement time_get
- 73334660 - aout: remove (now) unused aout_TimeGetDefault
- ebc24f12 - aout: rename aout_TimeGet to stream_TimeGet
- b3550a2c - aout: rework stream_RequestRetiming
- 9c9a3caa - aout: dec: factor discontinuity in a new function
- b7ff6e61 - aout: initialize the stream members earlier
- 66423717 - aout: fix possible data-race
- 1f387157 - aout: add a reworked timing_report event
- 570ec033 - aout: add vlc_aout_stream_UpdateLatency()
- 5d9de6bd - aout: signal an external condition on new timing
- b5770fd9 - decoder: update the audio stream clock more regularly
- b2ba4148 - clock: add vlc_clock_SetCoeffAvgRange
- dcf46056 - clock: avg: optimize when the range is 1
- 4860f1ad - aout: dec: disable clock moving average if the source is stable
- ab4f6e7e - aout: dec: reset the stream after the flush
- ae2f42d8 - aout: assert that we don't receive points while flushed
- b692c35e - pulse: wait for the stream to stop
- b7ac66e6 - pulse: use aout_TimingReport
- 32f65dee - pulse: don't interpolate timing
- 1c1b1292 - WIP: vout: reduce redisplay delay (TEST ONLY)
Toggle commit listadded MRStatus::Reviewable label
- Resolved by Thomas Guillem
added MRStatus::InReview label and removed MRStatus::Reviewable label
- Resolved by Thomas Guillem
- Resolved by Thomas Guillem
- Resolved by Thomas Guillem
- Resolved by Thomas Guillem
- Resolved by Rémi Denis-Courmont
- Resolved by Thomas Guillem
- Resolved by Rémi Denis-Courmont
- Resolved by Thomas Guillem
- Resolved by Thomas Guillem
- Resolved by Thomas Guillem
- Resolved by Thomas Guillem