Will a Raspberry Pi 4 function as a multichannel endpoint via HDMI to an AVR?
Yes, absolutely it will.
Raspberry Pi running almost any Linux based OS will use ALSA and ALSA supports multichannel via HDMI. Roon will see this and register the correct number of channels. The chain, very simply, is plug HDMI into AVR, ALSA will see this has a hardware device, negotiation of number of channels and capabilities will exchange, and you can see those channels using the standard ALSA CLI commands. As long as ALSA sees the correct channel count so will Roon Bridge and therefore Roon.
HDMI will also negotiate additional audio paths and these will all show-up as additional ALSA endpoints on the Pi. There may be some trial / error to match what is in Roon and which device you need to enable. Just enable 1 at a time, play something, identify if you hear anything.
Now, you might need to do some channel mapping as well. ALSA will just see multiple channels. Roon will send audio to these channels. What Roon thinks is left front, for example, may not be left front across the HDMI. This can be down in Roon with Muse / DSP.
But, don’t waste your time. Unless something has changed in the last 6 months the ALSA audio stack on a Pi only supports 16 bit depth (last time I looked into this). So, everything is converted to 16-bits. Play a 24/192 track and it gets to the Pi as 16/192. This is a Pi limitation something about an inability to keep some clock stable for higher bit-depths. Apparently Plex figured it out but that change to their audio stack can’t be mapped directly into the ALSA stack. In the end, I used a mini PC, as others stated, running Linux with a RT kernel and all is well (well, mostly, the thing died recently).
So, will it work? Yes, absolutely but you’ll want to learn how to troubleshoot ALSA and make sure you can see the audio devices. Here’s an example of a 2 channel device… I’d show you my multichannel but as stated earlier it gone and died on me…
$ sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 [HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
$ sudo cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 882
buffer_size: 1764
That number of channels, for a surround setup, should be minimum of 6 but could include every channel you have configured for ATMOS. Within Roon you can map any audio channel to any hardware channel and even combine them (for example if you don’t have a center channel tell Roon to split it in mono to channel 1 and 2 if those are your front left and front right). You’ll want to find a test track that loops through all channels individually to get this right.
EDIT: One other note… The audio clocks in HDMI follow the video clocks. Some AVRs, for this reason, require you have a video output before they will present anything at the source. To make sure this isn’t an issue…
Make sure your TV is on and the Raspberry Pi is outputting a proper video signal on that TV. Once you get things working you can turn off the TV and then hope it keeps working.