AVR won't always switch away from DTS setting

  • Hello, I'm using 8.1.1 on a RPi2, with HDMI audio to a Sony TV, passthru via SPDIF to a Yamaha amp.

    Everything works as expected during playback, but when I play a file with a DTS track, the amp will switch, but then will remain on DTS when I press stop, and no GUI sounds will play.

    If I then go and play something old (with a 2.0 soundtrack), then no noise will be heard (I have to manually cycle the amp to find the right audio stream)

    But then if I play one of my kid's favourite shows, the amp seems to realise that it needs to switch back to Pro Logic and everything is good (and the GUI sounds return).

    The first log shows this, going from Bugs Life to Black Belt Jones to Peppa Pig.

    If I switch the Audio options so that stereo upmix is enabled, and I enable AC3 transcoding, then playing a DTS file and stopping it will mean that no GUI sounds will play, but then going to something old will cause the amp to switch to DD. The second log shows this, although the something old was One Foot In The Grave.

    I also tried to switch between optimized and best match for the output configuration and that appeared to make no difference to the problem.

    Finally, if I play a DD file, then stopping that will cause the amp to switch back to Pro Logic and the GUI sounds will work fine.

    So, is there an option I'm missing related to the amp getting a signal to switch back to Pro Logic after DTS playback stops? It seems like Kodi is reluctant to switch away from DTS.

    Or is there a handy command/function I can throw into a monitor class so that when I detect playback has stopped I can force the amp into Pro Logic mode?