I'm currently struggling with the following scenario: I'd like to make my Raspi (3B) play a short MP3 jingle and then, after a 250 µsec pause, speak a short text by using an add-on sound card (JustBoom DAC HAT). Both mpg123, and eSpeak are running separately, buth all attempts to run them one after another from a C++ client app, were futile 'cause eSpeak complained about sound card #1 not working. My HAT, however, is card #0 in the alsa config file, and on-board sound has been kicked out of the config:
pcm.!default {
type plug
slave {
pcm "hw:0,0"
format S32_LE
channels 2
rate 192000
}
}
ctl.!default {
type hw
card 0
}
hw:0,0
is my JustBoom card:
pi@autoradio:/import/valen/autoradio $ aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: sndrpijustboomd [snd_rpi_justboom_dac], Gerät 0: JustBoom DAC HiFi pcm512x-hifi-0 []
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
Here is the error message:
ALSA lib confmisc.c:768:(parse_card) cannot find card '1'
An obvious alternative would be PulseAudio, but I've never managed to make it play anything, as client code keeps on complaining about a refused connection.
So is there a method to make bith mpg123, and eSpeak coexist peacefully and play their sounds one after the other without conflicts? Thank you.
hw0,0
as there is only one active sound card, which features only one device. I haven't changed anything to the eSpeak config. – Neppomuk Dec 28 '18 at 13:18