I recently installed a JustBoom DAC HAT on my Raspberry Pi 3, but I can't make it play a sound by using ALSA or PulseAudio. alsamixer
lets me configure the HAT, apparently without problems, but test-speaker
complains it can't access the sound device (ALSA) or can't connect to the PulseAudio server when it's running (connection refused).
Here are the steps I've taken after installing the HAT:
Removed the on-board sound device from /boot/config.txt:
dtparam=audio=off dtoverlay=justboom-dac
Used the following .asoundrc for ALSA:
pcm.!default { type hw card 0 device 0 }
ctl.!default { type hw card 0 }
…and for PulseAudio:
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 0
}
For PulseAudio, changed the /etc/pulse/default.pa file as follows:
load-module module-native-protocol-tcp load-module module-zeroconf-publish
Ran alsamixer and set volumes of both channels to 100%. For PulseAudio, I started the server as daemon (which started without errors):
pulseaudio -D
Ran
speaker-test
, which crashed both in the ALSA, and in the PulseAudio config: With PulseAudio, it said:pi@autoradio:~ $ speaker-test
speaker-test 1.0.28
Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
Playback open error: -111,Connection refused
What's wrong here? Does anybody have a hint for me? Thank you.
UPDATE: Using ALSA in debug mode (by adaprint the /etc/libao.conf file) and trying to play an OGG sound file, I get this:
pi@autoradio:/import/valen/autoradio $ ogg123 -v Emergency_Alert_System_Attention_Signal_20s.ogg
debug: Loaded driver null (built-in)
debug: Loaded driver wav (built-in)
debug: Loaded driver raw (built-in)
debug: Loaded driver au (built-in)
debug: Loading driver plugins from /usr/lib/ao/plugins-4...
debug: Loaded driver oss
debug: Loaded driver pulse
debug: Loaded driver nas
debug: Loaded driver esd
debug: Loaded driver alsa
debug: Testing drivers to find playback default...
Audio Device: Advanced Linux Sound Architecture (ALSA) output
Author: Bill Currie <[email protected]>/Kevin Cody, Jr. <[email protected]>
Comments: Outputs to the Advanced Linux Sound Architecture version 0.9/1.x
Playing: Emergency_Alert_System_Attention_Signal_20s.ogg
Ogg Vorbis stream: 1 channel, 44100 Hz
Vorbis format: Version 0
Bitrate hints: upper=-1 nominal=96000 lower=-1 window=0
Encoded by: Xiph.Org libVorbis I 20030909
Encoder: Cool Edit
ao_alsa debug: Trying to open ALSA device 'default'
ao_alsa debug: snd_pcm_hw_params_set_channels() failed.
ao_alsa debug: Unable to open ALSA device 'default'
ao_alsa ERROR: Unable to open ALSA device 'default' for playback => Invalid argument
ERROR: Cannot open device alsa.