I think I;ve got this set right but wanted to check.
Connection is PI HDMI -> TV -> Soundbar
Soundbar is connected to ARC input on TV.
When set to 5.1, I get no sound for AAC 5.1 files. If I set to 2.0, I get sound but it seems to come out of the soundbar as 2.0 (limited info on Soundbar, all I can tell is it defaults subwoofer to Level 2 for 2 channel and Level 3 for multi channel), and with 2.0 the 5.1 AAC shows as level 2.
If I enable Dolby Digital transcoding, it goes to level 3. Is the 5.1 AAC being converted to 5.1 DD despite the channels being set to 2, or is it simply 2 channel DD?
This is down to what the TV and soundbar support.
It is very unlikely that the TV and soundbar support multichannel PCM, so you must set “number of channels” to 2.0.
Note, this is physical channels, not number of speakers, so multichannel audio is still possible with AC3 (aka DD) and DTS.
So with passthrough enabled you may get (if supported by TV/soundbar) multichannel from AC3 and/or DTS (AC3 is supported more widely than DTS).
If you want to play 5.1 AAC (for which direct passthrough doesn’t exist), you will need to enable AC3 transcoding which will allow multichannel audio to arrive at soundbar. Yes, the audio will be decoded from AAC to PCM, encoded to AC3 then sent to TV/soundbar where soundbar will decode it to PCM again.
Soundbar supports both DD and DTS so I have passthrough on them (which works flawlessly!). The soundbar suggests it supports Multichannel PCM, but I suspect the TV does not, so it’s doing something to the multichannel between the Pi and Soundbar, rather than just passing it on.
Enabling AC3 transcoding seems to have done the trick, and I’ve confirmed its coming through as multi-channel (I chucked a 2.0 DD track at the soundbar and it showed Level 2 for stereo, vs Level 3 for the transcoded AAC)
It sounds like the soundbar has a hdmi input (but not hdmi output).
You could set up 5.1 channel PCM with passthrough disabled, which presumably gives no sound,
and while playing unplug hdmi from TV and plug directly into soundbar.
If that gives multichannel audio, then it proves the the soundbar supports multichannel PCM and the TV is the limitation.
But AC3 transcoded audio is likely to be indistinguishable from PCM (you’d need a good ear and good equipment to hear a difference), so it may be best not to worry about it.
I’m tempted to test it as you say but ac3 transcoding as you say will work, especially when speakers in question is a soundbar!