HDR + TrueHD + passtrough = crashes



Hi,

whenever i try to play a video that is HDR and a lossless format that is passtrough-able (TrueHD in this instance) weird and bad things happen: it can be either of the following:

  • video starts, audio does not. audio driver crashes, AVR goes crazy and begins flashing PCM on and off indefinitely. Have to reboot windows to get it back to working state
  • tv loses signal. no video or audio. Kodi is still running, and i can blindly stop it and the GUI pops back
  • video starts, but is totally glitched. Audio may or may not work.
  • in very, very,very rare cases, everything works as expected. Video works, and audio gets correctly passed through to the AVR.

the setup is as following:

Kodi 21/nightlies (no difference) 
i3 13100 mini pc (win10) ->DP 1.4 to HDMI 2.1 adapter (VMM7100)->TV (samsung Q80) -> AVR (yamaha RX-v685)

i’ve narrowed the issue down to the combination of HDR and lossless passtrough, because if kodi does not switch HDR or the audio is not TrueHD the issue does not occur.

i have a few logs, this one for example
https://paste.kodi.tv/bupokawone.kodi

it seems to me that the order in which kodi sets up the playback is the culprit: first it sets the refresh rate, then waits the configurable delay, then open audio sink and then switches HDR on… and immediately starts playback. this causes the TV to lose signal and get data while not yet ready to receive stuff, causing weird behaviours. Perhaps the HDR switch should be performed right after the refresh rate switch and before the delay and opening of audio sink…