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

eSpeak Problems

Sun Sep 09, 2018 3:22 pm

Recently i discovered the espeak program. Working on integrating it into my program(s), and it has been giving me errors.
Errors:

Code: Select all

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
Using a similar thread post: https://www.raspberrypi.org/forums/view ... p?p=913285, i was able to fix most of the errors by commenting them out. The JackD solution did nothing.

I still have a couple that I have yet to figure out:

Code: Select all

ALSA lib  pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection Refused

ALSA lib  pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection Refused

Cannot connect to socket server err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
I can hear the voice speaking what i typed, but my program puts out visuals as well and i would rather not have to see the errors.

Still doing research, but any help would be appreciated.

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

Re: eSpeak Problems

Sun Sep 09, 2018 9:53 pm

troubleshooting Update:

Did some more reading and attempted text-to-speech through the os import

Code: Select all

os.system('espeak -ven+f3 "{0}" >/dev/null'.format(something))
Still gives me the same errors as described in first posting.

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Mon Sep 10, 2018 1:10 am

What espeak packages have you installed? You can find out with:

Code: Select all

$ dpkg -l | grep espeak
ii  espeak                                1.48.04+dfsg-5                    armhf        Multi-lingual software speech synthesizer
ii  espeak-data:armhf                     1.48.04+dfsg-5                    armhf        Multi-lingual software speech synthesizer: speech data files
ii  espeak-ng-data:armhf                  1.49.0+dfsg-11                    armhf        Multi-lingual software speech synthesizer: speech data files
ii  libespeak-ng1:armhf                   1.49.0+dfsg-11                    armhf        Multi-lingual software speech synthesizer: shared library
ii  libespeak1:armhf                      1.48.04+dfsg-5                    armhf        Multi-lingual software speech synthesizer: shared library
ii  python3-espeak                        0.5-1+b2                          armhf        Python bindings for eSpeak
ii  speech-dispatcher-espeak              0.8.6-4+deb9u1                    armhf        Speech Dispatcher: Espeak output module
ii  speech-dispatcher-espeak-ng           0.8.6-4+deb9u1                    armhf        Speech Dispatcher: Espeak-ng output module
I may have installed these using sudo apt install espeak python3-espeak speech-dispatcher-espeak. I don't get the error messages you mention.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: eSpeak Problems

Mon Sep 10, 2018 4:13 pm

I didnt know there were different packages.

I just installed it via:

Code: Select all

Sudo apt-get install espeak
Will attempt your input when I can, and let ya know.

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

Re: eSpeak Problems

Sat Sep 15, 2018 2:41 am

@scruss

I attempted your solution. I purged my original espeak install, and have tried many variations of your suggestion, but I do not think ive been entering them correctly:

Code: Select all

Sudo apt-get install espeak python3
Sudo apt-get install espeak speech
Sudo apt-get install espeak dispatcher

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: eSpeak Problems

Sat Sep 15, 2018 7:05 am

You are missing hyphens (-).

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Sat Sep 15, 2018 11:54 am

also ‘Sudo’ won't work: it's ‘sudo’. Case matters to Linux, unfortunately
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: eSpeak Problems

Sat Sep 15, 2018 2:54 pm

@scruss
That was reply using my phone, and it auto caps.

@ghans

Code: Select all

espeak-python3
espeak-speech
espeak-dispatcher
Like so?

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Sat Sep 15, 2018 4:56 pm

copypasta exactly what I typed:

Code: Select all

sudo apt install espeak python3-espeak speech-dispatcher-espeak
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: eSpeak Problems

Sun Sep 16, 2018 2:20 am

@scruss

tried entering, word for word, the command line. Did not work, even on a fresh install of raspbian.

Gives the error:

Code: Select all

E: Unable to locate package speech-dispatcher-espeak

User avatar
Joel_Mckay
Posts: 289
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: eSpeak Problems

Sun Sep 16, 2018 2:50 am

Try this first:
sudo apt-get update

Then:
sudo apt-get install flite-dev flite

I have linked flite's lib into programs before, and the voices can be adjusted as needed.
Flite is also written with small cpus in mind, the render delay is negligible, and there is a TTS TTY version around for blind users.

#play some TTS
flite -t "hello world"

#render a low cpu cost cached phrase (fast, but takes up more room)
flite -t "hello world" -o hello.wav
cvlc hello.wav

Cheers,
~J~

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Sun Sep 16, 2018 2:45 pm

StangPi wrote:
Sun Sep 16, 2018 2:20 am

Code: Select all

E: Unable to locate package speech-dispatcher-espeak
You'll need to

Code: Select all

sudo apt update
to get your fresh install in line with the repositories. Then try the line I suggested before.

Do you have to use espeak? What the application? I'd normally recommend flite, just as Joel_Mckay did, but really only because I've used it for years, it tends to work (as there's not much to it to go wrong) and its default voice is Scottish, like mine.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: eSpeak Problems

Sat Sep 22, 2018 12:24 am

@scuss

same error as mentioned before.

If it helps, i am using Raspbian Jessie.

Will attempt flite now. Update post soon.

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

Re: eSpeak Problems

Sat Sep 22, 2018 1:52 am

@scruss

I am writing a movie inspired security program/device. The program has selections and I/Os that will have voiced reactions/responses for every choice and action initiated by the user(s).

@Joel_McKay

Thank you for the advice on using flite. It is working perfectly and is simple to code into my program.

Thank you both for your help, i will post updates about finished product.

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Sat Sep 22, 2018 3:32 pm

StangPi wrote:
Sat Sep 22, 2018 12:24 am
If it helps, i am using Raspbian Jessie.
I can't help you if you choose an obsolete distro, sorry. This is why all my commands didn't work for you.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: eSpeak Problems

Mon Sep 24, 2018 4:14 pm

What do you mean obsolete

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Mon Sep 24, 2018 6:40 pm

obsolete as in superseded: it's not on the downloads page. While it might get some security updates until 2020, it doesn't get any firmware upgrades.

Since it costs nothing to upgrade (beyond your time) and you get new features and improved security, many people keep their Raspberry Pis upgraded to the latest release, Stretch. If someone asks for help here and doesn't specify that they're running Jessie, it's assumed that they're running Stretch. It would have been a good detail to put in your question. The packages I suggested are from Stretch. When you said you'd done a fresh install of Raspbian, that means Stretch.

I don't think Jessie has the packages I mentioned. Flite probably works, because it's been around for decades.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: eSpeak Problems

Mon Sep 24, 2018 11:00 pm

I understood what obsolete meant.

I just didnt know that it wasn't receiving firmware updates anymore.

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: eSpeak Problems

Tue Sep 25, 2018 9:53 am

Firware in the context of the Raspberry Pi means start.elf/bootcode.bin, which are unrelated to the 30,000 or so packages in Raspbian. Incidentally, the firmware itself has been packaged and by staying on Jessie you will indeed not recieve firmware upgrades.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

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

Re: eSpeak Problems

Thu Sep 27, 2018 1:46 am

So...is it a bad thing that i have not upgraded to stretch?

User avatar
scruss
Posts: 2632
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: eSpeak Problems

Thu Sep 27, 2018 2:27 am

Yes. The packages I suggested don't exist on Jessie, so if you ask for help you might not be able to apply what other people suggest
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Return to “Troubleshooting”