Audio ahead of video (out of sync) with Milhouse Build 910 and above

  • Symptom:

    Watching Live TV with vdr server and vnsi client on libreelec9 milhouse builds, the audio starts to get out of sync and video lags behind.

    While with builds 909 and earlier this gets "auto-fixed" after 10-25 seconds, it does not (always) get re-synced with builds 910 and newer.

    On earlier versions (909 and before), the audio stops for a second after 20 seconds or so and everything is back in sync.

    On newer versions (910 and after) this does not always happen (it does happen on an SD channel with multiple audio carriers, but not on an 1080p channel, I have also seen it failing on an SD channel with a single audio stream, but maybe I had not waited long enough. That was with bild 1023 I think).

    Anyway, let's get back to the reproducable facts:

    You can _manually_ cause the audio/video to resync by selecting another audio stream.

    I have taken debug logs with both builds 909 and 910.

    Steps to reproduce:

    on 909:

    Launched a TV channel

    (Audio got out of sync)

    Waited 20+ seconds

    (Audio back in sync)

    on 910:

    Launched a TV channel

    (Audio got out of sync)

    Waited 20+ seconds

    (Audio back in sync)

    Launched another TV channel

    (Audio got out of sync)

    Waited 20+ seconds

    (Audio still out of sync)

    Selected another audio stream

    (Audio back in sync)

    What I can see from the logs are entries like

    Code
    DEBUG: CRBP::AdjustHDMIClock(VALUE1) = VALUE2

    while the audio is out of sync, VALUE1 and VALUE2 are >=1.00000

    whenever the audio stream gets back in Sync VALUE1 and VALUE2 are <= 0.99900

    The logs can be found here: Milhouse logs on my Onedrive

    Hardware used: Raspberry Pi2 with USB Soundcard.

    I have not seen this behaviour on x86 with audio bitstream passthrough