Skip to content

The audio output might take too long to initialize the master clock

cf. #26825 (closed)

Depending on the audio device (specially with BT ones), video might get glitchy (one or few frame drops) when starting.

Here is the reason: at the beginning of playback:

  • The input pushes a lot of data at the beginning of the playback
  • But the audio time_get might return an error since the audio buffer has not started yet.
  • Therefore, it is not possible to have a valid master audio clock during that first input burst.

The problem is that the next data burst might come later (after more than 1 seconds), resulting on the audio master to not be updated.

The only valid solution I see is to call the audio output time_get callback when a slave clock is trying to convert its pts, to update the master clock offset ASAP.

This strategy could be triggered only:

  • when starting the playback
  • and if the audio clock has not been initialized.
Edited by Thomas Guillem
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information