Kodi Community Forum

Full Version: [Resolved / Workaround] 17.1 Crash on DTS Passthrough
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed this issue on 17.1, may have been present on 17.0 (can't find a simple way of downgrading to test, apt-get doesn't list 17.0 as available). Definitely was not an issue with 16.x as my system worked great for months before this.

When I play files with DTS passthrough approximately 50% of the time Kodi will stutter, freeze, and then crash. Disabling DTS passthrough allows the files to play. These same files worked without issue on previous versions of Kodi. Files are MKV containers, h.264 video. Audio streams are DTS-HD and DTS-HD MA 6.1 or 7.1 channels (I'm not sure I've triggered the issue with plain DTS yet).

Steps to Reproduce:
  1. Enable passthrough for DTS & DTS-HD
  2. Play a Video file with DTS-HD

Symptoms:
Video initializes and starts playing but audio fails to negotiate with the receiver, after ~5 seconds video begins stuttering, then freezes. If I press "Stop" it eventually drops back to the menu, then after ~5 more seconds Kodi crashes and restarts.

I use a custom X-session that kills pulseaudio to enable all passthrough options straight to ALSA.

In the Debug log it took until the 3rd video I played before it failed, it seems to be a 50/50 shot of working per video.
In the log the file playing during the failure was "Star Wars: Episode VI - Return of the Jedi (1983).mkv" but it has failed on all 3 files in previous testing.
Debug Log Leading up to Crash: https://paste.ubuntu.com/24514212/
Crash Log: https://paste.ubuntu.com/24514217/

Hardware:
Intel NUC i3 D34010WYK x86_64
Firmware v44 (Dec 14, 2016)
8GB RAM
GPU: embedded

HDMI linked to Onkyo receiver (7.2 channel, supports all passthrough options and have successfully used them for months prior to this issue)

Software:
Linux Mint 17.2 (Kernel 3.19.0-32-generic) -- Patched up-to-date May 4, 2017
Kodi from PPA - 2:17.1~git20170320.2031-final-0trusty
Default Skin (Estuary)
I have very few add-ons, this machine plays local content almost exclusively.

If anyone can explain how to downgrade to 17.0 I'll test it there. There only seems to have been 1 patch in 17.1 related to the AudioEngine so if it's not present in 17.0 that seems like it'd be a big hint as to what's happening.
sudo apt-get remove --purge pulseaudio libasound2-plugins - then reboot and try again.
It took a few more videos, but still had the same result.

I think it was the 9th video I tried (the error happens immediately during initialization--if it initializes successfully then it plays without issue). This time the video was "Moneyball (2011).mkv"

Debug Log: https://paste.ubuntu.com/24518898/
Crash Log: https://paste.ubuntu.com/24518902/

I do log in to a regular desktop session on occasion, so I'd like to have audio working there as well which was the main reason I still had pulseaudio installed. Since removing it didn't resolve the issue, I'll probably put it back.
Let me guess, if you disable "Adjust Refreshrate" you cannot reproduce right?

So In short it's a race between device enumeration (OnDeviceChange) which happens after refreshrate switching (HDMI gets enumerated newly) and the cleanup of the resampler.
That seems to be the case. With "Adjust Refreshrate" disabled I was unable to reproduce the issue. Re-enabling "Adjust Refreshrate" and setting "Delay after change of refresh rate" to 1.0 second I was also unable to reproduce the issue. So hopefully that fits with your race-condition hypothesis. Using the "Delay after change of refresh rate" is an acceptable workaround presuming it's reliable.
Jep - that also fits :-)