I installed MPD (yMPD) on DietPi and tried to play a 96kHz file, but there was no sound. 48kHz may be the limit. ![]()
Did you try it with the ALSA auto conversion plugin?
For the script, simply copy & paste it into your SSH console.
The ALSA auto conversion plugin is turned on in dietpi-config.
When I run the script, I get the following error
-bash: warning: command substitution: ignored null byte in input
Yes, I see the same, but the intended path of the matching symbol is printed as well, so it generally works. You can mute the errors:
for i in /proc/device-tree/__symbols__/*; do [[ $(<$i) == '/soc/i2s@1c22000' ]] 2> /dev/null && echo "$i"; done
I copied and pasted the script to SSH and executed it, but the sound reproduction is up to 48kHz / 24bit and not 96kHz.
Whicb code do you mean? The above is only to find out the symbole for the I2C device path. If it doesn’t output anything, then there doesn’t seem to be a symbol. But not a problem when the path works and doesn’t change.
I’ll check back about 48 kHz, probably it can be enabled somehow with the device tree overlay, when the DAC itself supports higher rates. But just to be sure: You can play audio sources/files with 96 kHz format, but the final output will be (thanks to auto-conversion) 48 kHz, right?
auto-conversion doesn’t seem to work.
96KHz without conversion All the above music files have no sound. Currently, the playable format is up to 24bit of 44.1 / 48KHz.
When I searched for an old ubuntu-core and tried it, I succeeded in playing 192kHz / 24bit with squeezelite. I2C1 was disabled when I2S0 was enabled. Is it something to do with it?
Do you use the default ALSA audio device with Squeezelite so that /etc/asound.conf applies or do you define it manually via command-line parameter? The auto-conversion plugin only applies to the “default” device. It can be also explicitly defined by using e.g. plughw:0,0 as PCM/ALSA device name, in this case for card 0 > device 0 wrapped into “plug” (auto-conversion) plugin.
ALSA audio device is used only with squeezelite. No MPD is used.
I tried installing a new version of Squeezelite (1.9.8-1317), but the situation did not change.
I connected Raspberry Pi B + and nano hat pcm5102a with I2S and tried to see if it works.
The software used piCorePlayer (squeezelite).
As a result, the sound was only produced up to 192kHz / 24bit. Results may differ with MPD.

In our Squeezelite package, we use this command to start it from the systemd service
squeezelite -a 4096:1024:16:0:0 -C 5 -n 'DietPi-SqueezeLite'
Since no explicit audio device is passed, it uses the default which uses the ALSA auto-conversion plugin. Not sure about the other parameters, “-C 5” defines a timeout so that the ALSA device is not shown “busy” for other possible players after Squeezelite didn’t play audio for 5 seconds. “-a” defines bufferSize:periodCount:sampleFormat:mmapUsage:openALSAdeviceTwice, that may be something to play with (especially the sample format, changing to 24 (bit)), or leave it empty to use defaults. These values were taken from what we used since a long time, I simply didn’t want to touch what worked well before, but probably we should skip the “-a” option completely to make it more compatible.
Hi,
You can now play 96KHz / 24bit audio files on the nano Pi Neo’s squeezelite. thank you!
However, the sample rate higher than that cannot be played yet.
squeezelite -C 5 -n "DietPi-SqueezeLite" -o hw:CARD=I2Smaster,DEV=0 -a 4096:1024:16:0:0 -b 40000:100000 -s 192.168.1.5
Awesome!
Was actually the correct card ID for the I2S cart applied to /etc/asound.conf? Compare card X with the output of aplay -l, then -o hw:CARD=I2Smaster,DEV=0 could be skipped. What was the required squeezelite command-line option to make it work?
I wonder what the difference between “4096” in “-a” and “-b” values is
.
root@DietPi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: I2Smaster [I2S-master], device 0: 1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0 [1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
A 96kHz / 24bit audio file could be played with the value 16 of the -a command.
It could not be played with other values (24,24_3,32).
squeezelite User Commands
https://ralph-irving.github.io/squeezelite.html
I guess then the hardware still does not support 24 bit and Squeezelite only forces (converts) the stream to 16 bit with this option. I’m still confused that ALSA with auto-conversion doesn’t do this
. Can you show your:
cat /etc/asound.conf
root@DietPi:~# cat /etc/asound.conf
pcm.!default {
type plug
slave.pcm {
type hw
card 0
device 0
}
}
ctl.!default {
type hw
card 0
}
That looks good. And omitting -o hw:CARD=I2Smaster,DEV=0 does not allow to play sources with higher bitrates?
As always, you can only play up to 96KHz / 24-bit files.
By the way, I tried to make the setting value of -a command and -b command the same as the setting value of piCorePlayer of Raspberry Pi.
The music file used is downloaded from 2L music store / test bench.
http://www.2l.no/hires/
squeezelite -C 5 -n “DietPi-SqueezeLite” -a 160:4:16:1:0 -b 20000:40000 -s 192.168.1.5
I tested the Nanohat pcm5102a again.
I installed Raspberry Pi OS Lite (64-bit) and squeezelite on Raspberry Pi 4 and connected to I2S.
This time, I was able to play a 352kHz / 24-bit FLAC file without any problems.
On RPi I2S is well and natively integrated, so that is expected. Should work in DietPi RPi images just the same. On NanoPi with the Armbian/mainline kernel the problem is that there are no “official” well tested device tree overlays (or device trees) for I2S, but it is all based on 1.5 volunteers to played a bit around.
Generally I would try to not force any -a, -b and -o values for best compatibility.
The output format can be btw forced as well with the ALSA auto-conversion plugin. Sadly there seems to be no max/limit setting to only do downsampling but that seems to include upsampling as well: https://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_plug