Linux程序报错:ALSA Unknown PCM cards
#程序报错
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.<blah blah>
I solved my issue and want to share:
There are two specific problems: (1) Alsa.conf and (2) JackD server
Problem (1) Alsa.conf
All of the warning messages can be fixed by making a change to the Alsa configuration.
This will resolve all of the warning messages of the type:
To change the Alsa configuration, issue the following command:
pi@rpib2-1:/ $ sudo nano /usr/share/alsa/alsa.conf
Scroll down the file until you see text for the pcm defintion. For each pcm replace the text at the end of the definition with default. I will illustrate:
Original:
pcm.front cards.pcm.front
Updated:
pcm.front cards.pcm.default
I did this for each of the warning messages, about 15 in all. Save your file.
Problem (2) JackD server
I learned from other internet sources that JackD server is required. Issue the following command:
sudo apt-get --no-install-recommends install jackd2
jackd -d alsa
This starts the server. Keep your terminal window open.
THEN, open a new terminal. You can then use espeak and you will hear the synthesized voice output through your HDMI speakers.
espeak "Roses are Red. Violets are Blue. Blah Blah Blah Blah"
This example test is not approved for your Valentine lover.
转载:https://www.raspberrypi.org/forums/viewtopic.php?t=136974