Hi everyone,
I wasted a bunch of time getting audio working on my headless Raspberry Pi with a HiFiBerry Amp2. Here's my experience to hopefully save you some trouble!
boss@pi:~ $ uname -a #latest Raspberry OS 64b lite
Linux pi 6.6.28+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64 GNU/Linux
cat ~/.bash_history
1 echo 'export LC_ALL="en_GB.UTF-8"' >> ~/.bashrc
2 sudo reboot
3 sudo apt -y update && sudo apt -y full-upgrade
4 sudo reboot
5 sudo nano /boot/firmware/config.txt
6 sudo apt install mc mpd mpc -y
7 sudo nano /etc/mpd.conf
8 mkdir ~/mpd
9 mkdir ~/mpd/music
10 mkdir ~/mpd/playlists
13 sudo systemctl enable mpd.service
14 sudo reboot
15 mpc volume 35; mpc play
16 mpc add http://86.94.213.59:8000
17 mpc play # we have SOUND and a volume set to 35
1, dont bother whit it, i have a locale issue need to sort that still out
5 {- sudo nano /boot/firmware/config.txt -} see below; it is for a headless setup (server mode)
gpu_mem=32
arm_64bit=1
dtoverlay=hifiberry-dac
dtoverlay=vc4-kms-v3d,noaudio
#more testing needs to be done, there is more in this file then is here
7, {- sudo nano /etc/mpd.conf -} see below
music_directory "~/mpd/music"
playlist_directory "~/mpd/playlists"
db_file "~/mpd/database"
state_file "~/mpd/state"
user "boss"
bind_to_address "localhost"
audio_output {
type "alsa"
name "My ALSA Device"
device "hw:0,0"
mixer_type "software" }
auto_update "yes"
filesystem_charset "UTF-8"
and thats all, we have sound and volume controle, I was folowing this guide https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/ so i did do the asound.conf asound.conf <--- thats where it all went down hill
Also; dont trust what you see; As you can see no Hihiberry card listed at all Dont Use dacplus or dacplus-std they will not work ( atleast for me)
boss@pi:~ $ lsmod | grep snd
snd_soc_hdmi_codec 20480 0
snd_soc_rpi_simple_soundcard 20480 1
snd_soc_pcm5102a 12288 1
snd_soc_bcm2835_i2s 16384 2
snd_soc_core 307200 5 snd_soc_bcm2835_i2s,vc4,snd_soc_pcm5102a,snd_soc_hdmi_codec,snd_soc_rpi_simple_soundcard
snd_compress 20480 1 snd_soc_core
snd_bcm2835 24576 0
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_pcm 151552 8 snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_hdmi_codec,snd_compress,snd_soc_core,snd_soc_rpi_simple_soundcard,s
nd_pcm_dmaengine
snd_timer 36864 1 snd_pcm
snd 122880 7 snd_bcm2835,snd_soc_hdmi_codec,snd_timer,snd_compress,snd_soc_core,snd_pcm
yeah aplay -l and aplay -L give some good output
But i was using AI to to solve it, and a AI wants to see a driver/firmware loaded, ohboy
boss@pi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0]
Subdevices: 0/1
Subdevice #0: subdevice #0
boss@pi:~ $ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
hw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Hardware device with all software conversions
default:CARD=sndrpihifiberry
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Default Audio Device
sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Direct sample mixing device
so what happend i was not testing if mpc play would produse sound, i was looking for volume controls in alsamixer, Me the NOOB...
Below is the old OP;
-----------------------------------------------------------------------------------------------------
Need some help;
cat /boot/firmware/config.txt
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d,noaudio
# Run in 64-bit mode
arm_64bit=1
disable_overscan=1
arm_boost=1
dtdebug=1
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap
dtoverlay=i2c-mmap
dtparam=i2c1=on
dtparam=i2c_arm=on
-
cat /etc/asound.conf
pcm.!default {
type hw card 0 }
ctl.!default {
type hw card 0 }
-
alsamixer tell me no sound controls,
only dtoverlay=hifiberry-dac
will give me;
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
dacplus dacplus-std
aplay -l
aplay: device_list:274: no soundcards found...
-
aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default
hw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Hardware device with all software conversions
sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
Direct sample mixing device
Linux pi 6.6.28+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64 GNU/Linux