hifiberry_and_mpd_on_raspberry_pi
I set up my Raspberry Pi 4 with Arch Linux 1. Having totally forgotten how to make it work with the Hifiberry DAC+ XLR audio shield I had to google, read and understand everything again. In order to avoid this hassle and not waste so much fucking time again (and hopefully help some lost souls on the internet in the process) I’m writing everything down here.
enabling the audio-shield
For the DAC2-Pro XLR in the “/boot/config.txt” file add the following lines:
#hifiberry shield DAC+ XLR
dtoverlay=hifiberry-dacplus
device_tree_param=spi=on
(If you are using a different audio shield, hifiberry has a list of all the parameters 2.)
allowing your user access to the raspberry pi’s audio card
Access to the audio-card by default (at least on Arch Linux (ARM)) is allowed only to the root user. If you run any audio-related commands they will fail or return unsatisfying results. For example if you want to list all of the Raspberry Pi’s audio devices by running the command
aplay -l
It will not return the expected list of devices.
In order to make it possible for your user (the account that you are logged into) to access the audio devices we have to add the user to the group “audio” by running the command
sudo usermod -G audio -a [your username]
I had to restart my raspberry pi for the changes to take effect. Now you should be able to run commands that make sound through the Hifiberry. mpd now suddenly worked after I scratched my head for a day trying everything out. cheers.
setting up mpd3 as a system service
by setting up mpd