CowboySkippy
Posts: 9
Joined: Mon Feb 15, 2016 4:30 pm

espeak TTS ALSA Unknown PCM cards

Sun Feb 21, 2016 3:37 am

Hello RPi community,

I can't seem to run espeak text-to-speech correctly and seek advice.

When I issue the command, I get the following error:

Code: Select all

[email protected]:~/Music $ espeak "hello"
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
I am using eSpeak text-to-speech: 1.48.03 04.Mar.14

I am running Jessie on my RPi-B2.

I have set my audio output in raspi-config to "Auto". I can hear other audio from my connected HDMI monitor speakers.

It appears that I have a problem with ALSA configuration and jack server configuration, but I do not know how to resolve the issues.

Can anyone point me in the right direction?

Many thanks,
Cowboy Skippy

CowboySkippy
Posts: 9
Joined: Mon Feb 15, 2016 4:30 pm

Re: espeak TTS ALSA Unknown PCM cards

Fri Feb 26, 2016 3:40 am

Ah!

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:

Code: Select all

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.<blah blah>
To change the Alsa configuration, issue the following command:

Code: Select all

[email protected]:/ $ 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:

Code: Select all

pcm.front cards.pcm.front
Updated:

Code: Select all

pcm.front cards.pcm.default
I did this for each of the warning messages, about 15 in all. Save your file.

Problem (1) JackD server

I learned from other internet sources that JackD server is required. Issue the following command:

Code: Select all

sudo apt-get --no-install-recommends install jackd2

Code: Select all

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.

Code: Select all

espeak "Roses are Red.  Violets are Blue.  Blah Blah Blah Blah"
This example test is not approved for your Valentine lover.

isaacllarbi
Posts: 1
Joined: Wed Dec 21, 2016 4:30 pm

Re: espeak TTS ALSA Unknown PCM cards

Wed Dec 21, 2016 4:32 pm

Worked for me. Thanks

victagayun
Posts: 127
Joined: Sun Apr 15, 2012 4:01 pm
Contact: Website

Re: espeak TTS ALSA Unknown PCM cards

Wed Feb 01, 2017 2:03 am

Why do I get this error? I am running via SSH...

Code: Select all

[email protected]:~ $ espeak "test"
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

Orbital6
Posts: 140
Joined: Sat Aug 08, 2015 6:32 pm

Re: espeak TTS ALSA Unknown PCM cards

Tue Apr 18, 2017 6:46 pm

victagayun wrote:Why do I get this error? I am running via SSH...

Code: Select all

[email protected]:~ $ espeak "test"
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
I too get a similar problem

Code: Select all

[email protected]:~ $ jackd -d alsa
jackdmp 1.9.10
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Failed to connect to session bus for device reservation Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Audio device hw:0 cannot be acquired...
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server

wally333
Posts: 90
Joined: Mon Jun 06, 2016 7:09 pm

Re: espeak TTS ALSA Unknown PCM cards

Thu Oct 12, 2017 6:07 pm

CowboySkippy wrote:
Fri Feb 26, 2016 3:40 am
Ah!

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:

Code: Select all

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.<blah blah>
To change the Alsa configuration, issue the following command:

Code: Select all

[email protected]:/ $ 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:

Code: Select all

pcm.front cards.pcm.front
Updated:

Code: Select all

pcm.front cards.pcm.default
I did this for each of the warning messages, about 15 in all. Save your file.

Problem (1) JackD server

I learned from other internet sources that JackD server is required. Issue the following command:

Code: Select all

sudo apt-get --no-install-recommends install jackd2

Code: Select all

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.

Code: Select all

espeak "Roses are Red.  Violets are Blue.  Blah Blah Blah Blah"
This example test is not approved for your Valentine lover.
Unfortunately this did nothing on Raspbian Stretch, I just did the alsa.config part and these edits changed nothing :(

Not quite nothing some errors went away but I still get a bunch of ALSA lib errors

Code: Select all

ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:767:(parse_card) cannot find card '$CARD'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card '$CARD'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
I'm not worrying about the jackd untill this gets cleaned up.

hackr
Posts: 10
Joined: Fri Jan 27, 2017 10:00 pm

Re: espeak TTS ALSA Unknown PCM cards

Thu Mar 01, 2018 5:39 pm

This is great, but I think we can add a step where you make a backup copy of the file before making these changes.

topher217
Posts: 1
Joined: Wed May 30, 2018 7:21 am

Re: espeak TTS ALSA Unknown PCM cards

Wed May 30, 2018 7:24 am

wally333 wrote:
CowboySkippy wrote:
Fri Feb 26, 2016 3:40 am
Ah!

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:

Code: Select all

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.<blah blah>
To change the Alsa configuration, issue the following command:

Code: Select all

[email protected]:/ $ 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:

Code: Select all

pcm.front cards.pcm.front
Updated:

Code: Select all

pcm.front cards.pcm.default
I did this for each of the warning messages, about 15 in all. Save your file.

Problem (1) JackD server

I learned from other internet sources that JackD server is required. Issue the following command:

Code: Select all

sudo apt-get --no-install-recommends install jackd2

Code: Select all

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.

Code: Select all

espeak "Roses are Red.  Violets are Blue.  Blah Blah Blah Blah"
This example test is not approved for your Valentine lover.
Unfortunately this did nothing on Raspbian Stretch, I just did the alsa.config part and these edits changed nothing :(

Not quite nothing some errors went away but I still get a bunch of ALSA lib errors

Code: Select all

ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:767:(parse_card) cannot find card '$CARD'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card '$CARD'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
I'm not worrying about the jackd untill this gets cleaned up.
If you are not actually using them, and just trying to avoid the error messages, instead of changing all of the values you can just comment them out with a "#". That way if you need to revert to an earlier version, you can just uncomment them later. For example:

Original:

Code: Select all

pcm.front cards.pcm.front
Updated:

Code: Select all

#pcm.front cards.pcm.front

StangPi
Posts: 68
Joined: Wed Feb 24, 2016 9:26 pm
Location: Indiana, USA

Re: espeak TTS ALSA Unknown PCM cards

Sun Sep 09, 2018 6:02 am

Once I get the ALSA errors fixed, I'll do the JackD.

I tried editing the ALSA.conf file but it will not let me save the changes. And still the ALSA erors continue

Return to “Troubleshooting”