Roon Bridge on Raspberry Pi 4 performs bit depth conversion 24 bit to 16 bit when playing to HDMI audio output

Hi Alex, just a thought: is there a way in your kernel recompile to swap the 24bit around (i.e. from big-endian to little-endian or vice-versa, S24_LE vs S24_BE)?
I’m wondering if playing 24bit music to a DAC that’s expecting one but getting the other would sound exactly like what you’re currently getting, i.e. a lot of noise, and very faintly in the background your music.
My theory: noise is coming from the least-significant 8 bits being played instead as the top 8 most significant bits, and the top 8 bits most significant bits being played mistakenly as the least significant 8 bits allows you to very faintly hear your music… I may of course be spitting complete nonsense here :).

I’ve only tried S24_LE because the 16 bit support was also little endian only. But I’ll just try using big endian and then we’re sure :slight_smile:

(O, and I had tried S32_LE, same result)

Too bad… S24_BE gives me static only. Not even faint music…

I have Intel® Core™ i5-7400 CPU and MSI B250m motherboard and can get 24/192 at 7.1 channels for listening to 5.1 and 7.1 audio files on the HDMI connection. It also supports 4k video 3840x2160.
It doesn’t sound as good as my DAC but does let me enjoy the odd multi channel recording. Do use exclusive mode so some windows sound doesn’t interrupt the listening session. Watch the CPU video card support some don’t include one others are limited in video and audio capability

I have tried the same with my Pi4b and also found it could only do 16bit (sounded like a noisy FM radio station). Never mind HDMI CEC playing havoc with settings on HDMI connected devices. It is running the wifes DAC. Without an HDMI connection running Ropieee…with it’s LPS sounds great for her.

Stay safe enjoy the music

Thanks Alex, for your trouble and for giving this a go! So we’re still experimenting to find the answer…

SOLVED!

Thanks everyone for your help so far. I’ve got this to work, but the solution is to use PiCorePlayer as the transport, not Roon Bridge.

My OP post above described the requirement I was trying to solve for. Paraphrased, my requirement is: “How can I play Tidal MQA to my Denon AVR-X4400H Receiver, using Roon to do the first unfold to 96kHz/24bit, via a Raspberry Pi 4 running Roon Bridge, over the HDMI cable?”

The answer is: “You can do this, but don’t use Roon Bridge on the Raspberry Pi 4. Use PiCorePlayer instead.”

tl/dr;

RoonBridge on Raspberry Pi, whether running on Ubuntu 20.04 LTS, or on Volumio, forces a down-convert of 24 bit MQA unfolded stream to 16 bit, even thought the Raspberry Pi 4 HDMI interface fully supports 24 bit audio.

The following does NOT work:
Tidal MQA music -> Roon Server on Mac -> Roon Server does first MQA unfold on Mac, to 96KHz/24bit -> Raspberry Pi 4 + Ubuntu 20.04 LTS 64bit + Roon Bridge armv8 -> Raspberry Pi HDMI Audio output -> Denon AVR-X4400H Receiver
… this shows a 24 bit to 16 bit down-conversion

This doesn’t either:
Tidal MQA music -> Roon Server on Mac -> Roon Server does first MQA unfold on Mac, to 96KHz/24bit -> Raspberry Pi 4 + Volumio + Roon Bridge plugin -> Raspberry Pi HDMI Audio output -> Denon AVR-X4400H Receiver
… same 24 bit to 16 bit down-conversion

This is how I managed to get 96kHz/24bit MQA first-unfold stream working into my Denon via HDMI:
Tidal MQA music -> Roon Server on Mac -> Roon Server does first MQA unfold on Mac, to 96KHz/24bit -> Roon Server has “Enable Squeezeboox Support” switched on -> Raspberry Pi 4 + PiCorePlayer -> Raspberry Pi HDMI Audio output -> Denon AVR-X4400H Receiver.

Working beautifully! Here’re some screenshots confirming the full 96kHz/24bit stream, and associated settings:





And PiCorePlayer is set up with no special settings other than selecting HDMI Audio as the output:

3 Likes

I think this is something that might be a useful feature request for the Roon team to add into Roon Bridge in a future version. How can I make a feature suggestion to the Roon folk?

1 Like

Post it in the Feature Request catagory.

1 Like

Sorry for not mentioning picoreplayer. I was aware that pcp was able to use higher bit depths. I also tried installing Roon bridge on pcp. Strangely roon is then still only able to play 16 bit. But: it was possible to play 5.1 channels. That is not possible with squeezelite on pcp.

I just gave up on the Pi. It’s now back in use to feed my usb dac+headphone apmplifier. I bought a second hand NUC for 100 euro, installed linux and the roon bridge, and everything is working like a charm: up to 32(?) bit, 192kHz and 5.1, all at the same time :slight_smile:

Thanks Alex, this confirms that Roon Bridge is the weak link here. If I use Roon Server -> Squeeze transport -> PiCorePlayer on Raspberry Pi, I get 96/24. But, if I use Roon Server -> RAAT -> Roon Bridge running with PiCorePlayer on Raspberry Pi, I only get 96/16.

This is a serious limitation in Roon Bridge which I think the Roon folk need to fix, to avoid the need for their customers to have to use 3rd party pieces of software to plug this gap. I’ve raised a feature request for this at: Please fix Roon Bridge on Raspberry Pi 4 down-converting 1st-unfolded 96kHz/24bit MQA stream to 16bit when using the HDMI audio out.

How did you get piCorePlayer to output 24-bit over HDMI? When I checked the actual output with something like “ cat /proc/asound/card1/pcm0p/sub0/hw_params” it was locked to 16-bit no matter which settings I tried. No such issue with a USB DAC.

No luck with Ropieee?

Well… actually I did not check hw_params. I only saw that Roon was outputting 24 bit. So that could be the explanation: it seems that pcp is 24 bit capable because that’s what it is reporting too Roon, but on the background it ditches the least significat 8 bits.

On the other hand, picoreplayer states

  • Supports HDMI audio up to 24 bit/192 khz.

on the page with pcp features. And on their news page it says:

High resolution audio through HDMI:

Thanks to the suggestion from giantpopples from the Squeezbox forum and the work by tghewett from the Raspberry Pi forum it is now possible to stream high resolution audio through the HDMI cable. Before the Raspberry Pi would down-sample everything to 48 kHz. But we modified the bcm2835-pcm.c and build the kernel. Now it is possible to stream 88.1 kHz and 96 kHz through HDMI. It might be possible even to use up to 192 kHZ, but I have not received any report on this.
Original:

.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
Changed to:

.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,
.rate_min = 8000,
.rate_max = 192000,
.channels_min = 1,
.channels_max = 2,

Yes, it outputs the correct sample rate but it’s truncating everything to 16-bit in ALSA. It appears to be a driver, firmware or hardware limitation. I tried to force Squeezelite to direct hardware access in 24-bit mode but got no output whatsoever.

Hmm… not sure though. They did add SNDRV_PCM_FMTBIT_S32_LE and although I did not check the contents of hw_params on pcp, I also tried compiling the kernel with this part added. And when I had done that, I did check hw_params which was indicating 24 bit output at that time. The result was mainly noise, though :frowning: (in my case)

Sigh… thanks Brandon (and Alex for your help too!). Yes, I’ve just confirmed the same - I was looking at what Roon “said” it was playing, but doing a cat on the card0 hw_params file showed S16_LE too. When I changed the PiCorePlayer settings to use my HifiBerry Digi+ Pro HAT, then doing a cat on card1 showed S24_LE. So it does seem like the Raspberry Pi 4 still has a hardware (or kernel) challenge with the built in HDMI ports…

Playing out the HDMI:

Playing out the HifiBerry Digi+ Pro HAT (over SPDIF):

I have a bit off topic question after reading this thread. I have both a RPI4 (for Roon extensions) and an Intel NUC i7 as my ROCK. I would like to use either to feed a soundbar as another Roon endpoint to listen to music … is it best to use the RPI4 or NUC i7 to send to soundbar, and which output to use from either? The soundbar accepts optical, coax, and analog. Hope this isn’t a stupid question :slight_smile: … thanks!

I think an RPi4 should work, but it only has USB output (HDMI does not work with RoPieee). You would need to purchase and install a RPi4 HAT to give you optical, coax, or RGB output. I assume you would want to use the DAC included in your soundbar, so optical or coax to keep it digital until it reaches the soundbar.

1 Like

Hi timmo, I agree with Jim_F. A Rpi4 would work very well for this, but you need a HAT to plug in to your RPi. Here are some options:

  1. If you are going to use the internal DAC in your sound bar, then you need a HAT that can give you SPDIF over coax or Toslink. Here are two (I have the HifiBerry Digi+ Pro, which feeds my Denon Receiver, and it works a treat). Both of these can output SPDIF up to 192/24:
  1. If you want to provide your own DAC, and feed the sound bar an analog stereo signal over 2x RCA cables, then you could use a DAC HAT. Again, two great options:

There are many other manufacturers too beyond these. To get it all to work together you just need to run Ropieee on the RPi, which is the easiest way to create a Roon endpoint for this purpose.

2 Likes

Or, RoPieeeXL if you ever want to send Apple Music from your iPhone, etc. Messing with Raspberry Pi is fun and easy.