DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
JCieh
Posts: 2
Joined: Fri Mar 06, 2020 11:31 am

DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Post by JCieh »

Hi folks,

first I want to say hello to all forum members. This forum is really helpful for me until now.
But after installing DietPi to attach my two Onkyo AV reveivers (PR-SC5509 and TX-NR3009) to my roon core which is running on a MacMini 2012 (Win10 on Bootcamp) I did run into the following problem:
AV 1 is connected directly to the MacMini core via HDMI. AV 2 is in another room and connected to a RPi4 with 4GB running DietPi and roon bridge also via HDMI.
I was able to set up the very helpful roon-extension-onkyo service to integrate both AV-receivers in parallel for remote control via roon.
But using roon with AV 2 shows, that the RPi4 with DietPi and roon bridge downsample all 24bit audio to 16bit audio, which means a huge loss of quality.
Did I make my settings in DietPi or the RPi4 wrong or does the RPi4 (I did try it also with an RPi3b) simply not support 24bit audio via HDMI?

HDMI from the MacMini to AV 1 works up to 192kHz/24bit with no problems.

I do hope there is a solution and somebody out there will be able to help!
Thanks in advance.
Jan
JCieh
Posts: 2
Joined: Fri Mar 06, 2020 11:31 am

Re: DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Post by JCieh »

Hey guys,
so many view but no one coming up with an idea? Please, I still do need some help! :cry:
greetings, Jan
skilzor
Posts: 5
Joined: Thu May 07, 2020 10:47 am

Re: DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Post by skilzor »

'consumed' Raspbian Light (most recent download) to a clean small scale sd card at that point booted my Raspberry Pi off it. Signed in the Pi at that point ran the three lines of the Express introduce for example curil… , chmod… , sudo… These seemed to go fine and the last line made the product introduce (arm form). The Pi shows up as a Roon gadget however just 44.1k and 48k are green and the remainder of the frequencies are red. I have my Pi associated with my Marantz processor by HDMI. As anyone might expect give the above Roon downsamples anything above 48k and 16 piece. At the point when I utilize a sd card with PiCoreplayer introduced all the HD accounts play at full definition as affirmed by the processor. I have additionally attempted the entire procedure yet with full Raspbian yet the outcome is the equivalent Would you be able to please prompt what I am fouling up?
chris_ka
Posts: 2
Joined: Mon May 11, 2020 6:46 pm

Re: DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Post by chris_ka »

24bits via Alsa driver on the Raspberry Pi 2,3,4 is a very dark chapter in the history of the raspberry pi.

There are no technical restrictions but since over 6 years nobody cared to enable this in the stable version of the Raspbian linux kernel and as it looks like neither with the DietPi based Linux kernel.

However it is possible to recompile the kernel with activated 24bit and support for sample rates up to 192khz. I just tried this with a RPI 2 and a RPI 4 last week and was successful for Stereo 2 channel signals. With multichannel 5.1 setup and Flac 24/96 6 channel files I got crackling and wrong channel assignments out of the box.
Here a careful fine tuning of buffer sizes seems necessary by the "kernel guys" which are obviously not in a hurry to get active since more than 5 years!

If 2 channel support is sufficient for you I can point you to the steps necessary for the RPI 2 and 3:
see here: https://www.diyaudio.com/forums/pc-base ... ost5710184
I verified last week that these steps worked on a RPI 2 with Raspbian Lite. I assume that this also works with DietPI

To do this with a RPI 4 you have to make some changes:
the section in bcm2835-pcm.c has to look like this

Code: Select all

static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
                 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
                 SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR),
        .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE,
        .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_44100 |
        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
        .rate_min = 44100,
        .rate_max = 192000,
        .channels_min = 2,
        .channels_max = 8,
        .buffer_bytes_max = 512 * 1024,
        .period_bytes_min = 1 * 1024,
        .period_bytes_max = 512 * 1024,
        .periods_min = 1,
        .periods_max = 128,
};
and the KERNEL variable needs to be set to kernel7l instead of kernel7 in the build_kernel.sh script

ensure that in /boot/config.txt the hdmi audio support is activated with this line

Code: Select all

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
and plan for some time. The recompilation of the kernel takes roughly 2h on a PI
User avatar
Joulinar
Posts: 2023
Joined: Sat Nov 16, 2019 12:49 am

Re: DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Post by Joulinar »

neither with the DietPi based Linux kernel.
Just to avoid any misunderstanding. There is no DietPi kernel. DietPi did not and will not create own kernel. For Raspberry Pi devices, DietPi is using Raspbian Lite as base image, including the kernel. Means, it is the exact same kernel as on standard Raspbian Lite.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
chris_ka
Posts: 2
Joined: Mon May 11, 2020 6:46 pm

Re: DietPi (on RPi 3 and 4) no 24bit audio output via HDMI

Post by chris_ka »

Thanks for this clarification. Then this solution should work exactly the same as on Raspbian
Post Reply