I recently purchased a Pi4 and a HiFiberry DAC+ADC as an external sound card. I followed this link HiFiberry Config to set up the hardware. However, even tho aplay -l
listed the hardware, the system still cannot produce sound.
In /boot/config.txt
, the audio related part is set up as the following:
#dtparam=audio=on
dtoverlay=hifiberry-dacplusadc
I also set up /etc/asound.conf
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}
I obtained the following information for debugging:
$ cat /etc/os-release
Raspbian Linux 10 (buster)
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplusadc], device 0: HiFiBerry DAC+ADC HiFi multicodec-0 [HiFiBerry DAC+ADC HiFi multicodec-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
$ aplay -D default test.wav
aplay: main:828: audio open error: No such file or directory
I also installed SoX on the Pi and I was able to use SoX to send out sine waves after I set up the audio environment:
export AUDIODEV=hw:0,0
export AUDIODRIVER=alsa
Thus I am sure that the sound card works fine, and the problem should be ALSA not working quite well with the hardware.
I am not quite familiar with Linux audio so I'd appreciate any hints and pointers. Thank you guys in advance. I'd be happy to provide more information!