So I’m trying to save space on my overburdened media disk by transcoding as much audio as possible from AC3 and DTS to Opus. For 2-channel sound this is trivial, or as trivial as ffmpeg incantations ever get, but the real space waste comes with DTS and 5-channel sound, so I’m particularly interested in converting that…
… and no matter what channel mapping I use, I can’t get all the channels to work at once! One channel is always missing (usually the centre channel, of course it would be the most important single channel of all). I expect figuring out channel mappings to be a complete nightmare: after all, Linux, DTS and AC3 all have different and incompatible mappings – but I don’t expect to lose a channel entirely!
My setup is simple enough: everything goes from a Raspberry Pi 3 running up-to-date OSMC (kernel 4.19.122-2-osmc) via HDMI to a Yamaha RX-V375 receiver and is then dispatched to perfectly ordinary wired speakers (video goes to a projector and works perfectly, refresh-rate-switching and all).
What does work: passthrough audio, 2-channel audio, 5.1 audio from other non-rasbpi-connected devices (like a bluray player, though that’s probably using passthrough again). From the Pi, I can emit sound on any 5 of the 6 speakers in the room by changing the ALSA channel mappings (and asking Kodi to emit through the ALSA device rather than ‘PI: HDMI’), but the centre channel is always missing. The wiring is (obviously) fine, and switching HDMI cables doesn’t help so it’s not that either.
This is obviously an ALSA problem because it fails with the same symptoms with MPD and other ALSA-using things as well, not just with Kodi: and it fails with Handbrake downmixing to Opus and also with ffmpeg transcoding existing audio via, say,
ffmpeg -i foo.mkv -acodec libopus -af aformat=channel_layouts=“5.1|stereo” -mapping_family 1 …
My current best guess ALSA config is:
but of course this doesn’t actually work because the centre channel is still missing, even though six channels are listed above and all are uniquely assigned.
Looking around the net, I find lots of people talking about this and lots of people saying oh yeah it works now, but zero people actually saying what the fix was. Does anyone know what the fix is? Is there a fix?