Audio downmix issue with v17?

This week, my Raspberry PI B automatically updated to Krypton. My PI is connected via HDMI to an Onkyo AV Amplifier (5.1 channels) that supports DD and DTS. The amp then connects to the TV that is used as a screen only.

Almost all my films are direct “rips” of DVDs or BluRays. I don’t transcode them, I just decrypt the disk and save the original video and audio tracks as an MKV file. Hence, some of my films are DTS, some are DD and some have 7.1 HD audio. Most films have multiple audio tracks so may have both DD + DTS, or 7.1 HD + DTS, or …

Now, with earlier versions of Kodi / OSMC, it all “just worked”. I never needed to worry about the audio - I got lovely surround sound out. I did have audio pass-through enabled, but I didn’t ever notice whether the audio was DTS, DD or PCM. It all “just worked” from a user’s perspective.

Now, with v17, I have different behaviour. Some films come out with DD or DTS audio just fine. Others come out with PCM audio but I’m missing parts of the audio (usually the speech). This seems to happen when the selected audio stream i 7.1 channel HD. The amp only has 5.1 channels so somewhere I seem to be losing two channels… I don’t know if the PI is sending 7.1 channels to the amp and the amp is just dropping two of them or if the PI is dropping two channels and sending 5.1 channels to the amp. What I’d like to happen is the PI downmixes from 7.1 to 5.1 then sends the 5.1 channels to the amp…

I can go into each film and manually select a working audio stream (if the film has DD or DTS) but that’s a PITA (especially if the kids start to watch a film that I haven’t checked and then complain about the sound being wrong) and it used to “just work”.

I’ve double-checked that I’ve selected the amp as 5.1 in OSMC but I can’t see any controls anywhere to configure the audio downmix.

I’ve changed the defaults for the audio channel to “DTS” but that doesn’t help if the film’s audio streams are DD + 7.1 HD.

Am I missing something very obvious?

Thanks in advance for all suggestions.

Revert this back to 2.0. When you are using passthrough to send untouched data to the AVR, changing that setting will cause issue.

No, that’s only an issue for spdif (optical/toslink) connections.
Setting output to 5.1 for a device that handles multichannel PCM (e.g. Onkyo over HDMI) should be fine.

@Roger_Lucas a debug log when playing a file with the problem may help.
Also what happens if you disable passthrough? Is everything good or bad?

I stand corrected then. My experience was just that this never needed to be adjusted in my use cases.

Thanks for the quick responses, all. I’ll do some more investigations tonight and post the results.

@popcornmix Do you know any way to control the downmix? I assume that this is where the problem lies…

It would be nice if there was some kind of preferences for the audio selection (e.g. DTS -> DD -> PCM downmix to 5.1) but I can’t see that… just a single default choice. Am I missing this somewhere?

Did you [arrow/d-pad left] and enable expert settings in the settings menus?

It should all just work.

I have an Onkyo with 5.1 speakers.
If passthrough is disabled and I set Kodi to 7.1 then:
5.1 audio will be output as 5.1. Onyo will play to the 6 speakers.
7.1 audio will be output as 7.1. Onyo will downmix to the 6 speakers.

If passthrough is disabled and I set Kodi to 5.1 then:
5.1 audio will be output as 5.1. Onyo will play to the 6 speakers.
7.1 audio will be downmixed by kodi to 5.1. Onyo will output to the 6 speakers.

If passthrough is enabled and audio is DTS or AC3 (DDP) then audio will be passed through to onkyo and it will handle all decode/mixing necessary.

Yes, I get a similar view to Kodi Audio Settings: understanding the audio options | SHB (although not with the Confluence skin any more). This where I’ve configured the audio output to HDMI and 5.1 channels.

Thanks @popcornmix, I’ll copy your settings and see if I can get it to work like yours…

Well, it looks like the magic thing to do is disable audio passthrough. With passthrough enabled, DTS and DD go through as expected but everything else is sent from the PI as 2.0 channel PCM and doesn’t appear to be downmixed even though the PI audio output is set as 5.1.

If I disable passthrough, the PI sends decodes DD and DTS, downmixing to 5.1 channel PCM as necessary which it then sends to the amp.

As a bonus, with passthrough enabled, switching between DD, DTS or PCM audio tracks meant restarting the playback to get the amp to re-sync. With passthrough disabled and the decoding on the PI, switching between the DD, DTS and PCM audio tracks is immediate and works as expected.

@popcornmix Thanks for the working config!

OK, so this problem is back with a recent uptadate OSMC but I haven’t had a chance to report it until now.

Same setup as above - Raspberry PI 2 via HDMI into Onkyo AV amp to Samsung TV. Passthrough is disabled and audio channels selected as 7.1 the output configuration as “Fixed”. Auto is always kept alive. Audio output is via HDMI.

The problem is that I have the configured the frame-rate to automatically adjust to the video source rate to get the best playback quality. When the video framerate changes, the audio format out via HDMI changes from 7.1 to 5.1. I then lose some of the channels. If I change the audio stream then the audio format jumps back to 7.1 and I get all the channels again.

I’ve tried other audio output speaker settings - 7.0, 5.1, 5.0 even 3.1 and they all have the same problem. The only one that “works” is 2.0. If I select this, I don’t get the lost channels.

My guess is that the video frame rate change is causing the audio to be partially reset. If I don’t allow the framerate to adjust to the video, the problem disappears.

Does this make sense to anyone?

I’ve not posted logs yet because I’m not sure what would be wanted. Just let me know what more you need and I’ll post it.

Thanks in advance for all suggestions…

HI,

Do you get the issue, if you set adjust display refresh rate to: On start / stop ?

Thanks Tom.

HI @Tom_Doyle,

Yes - when I set the display rate change to “On start/stop” then I can see the amp responding to a quick succession of audio changes around when the HDMI frame rate changes and it ends up on 5.1… which has the missing channels.

If I don’t do the display rate change, I don’t get the HDMI updates and I keep the 7.1 surround with all the channels present.

Thanks,

Roger

HI,

Logs showing the issue, will probably help resolve.

Thanks Tom.

https://paste.osmc.tv/iqufirapey.vhdl

Line 874 (19:20:15.626) is the first play of “Frozen” with refresh rate changes disabled. Audio is output at 7.1 with all channels.
I then reconfigure it with refresh rate to “Start / Stop”
Line 1693 (19:21:45.346) is the second play. The HDMI audio is coming out 5.1 with missing channels.
I then toggle the audio streams starting at line 1938, briefly selecting the DTS 5.1 stream, which comes out properly at 7.1 with all channels present then back to the HD 7.1 audio again. This now comes out properly at 7.1 with all channels.

Thanks,

Roger

(edited to add timestamps as well as line numbers)
Source material is “Frozen” from the BluRay that I own and captured with MakeMKV, no modification or transcoding applied.

HI,

Apologies maybe its just been a long week; but I can’t see anything in the logs; thats any different for audio on either tests.

does re-enabling passthrough make any difference?

Thanks Tom.

I don’t think the code is deliberately trying to set 5.1 channels… I’ve looked and I can’t see it changing to 5.1 either. If it’s there then we’ve both missed it :slight_smile:

I think it might be a bug in the HDMI output configuration code that is (for some reason) not properly restoring the audio configuration when the screen resolution is changed. I’ve no idea how to dig deeper to investigate this, however.

Hi,

I can’t advise on bugs in the code, as I’m not osmc developer; I’m user like your self. Being as I couldn’t see any thing in logs, I suggested enabling passthrough again; because even if it didn’t yield a positive result. It may give the development team more to go on, as to what the issue is.

Being as this issue maybe related adjust refresh rate, it may also help to know the rest of your setup in settings, player ?

Thanks Tom.

I’ve tried it with passthrough enabled as you suggested. If the audio source is passthrough capable, it works perfectly even with frame rate adjustment. If the audio isn’t suitable for passthrough then the same issue exists if the HDMI frame rate is adjusted to match the video source.

Hi,

Please advise on the other settings for video, under: settings, player?

Thanks Tom.