espeak sound doesn't play correctly

Bug #354522 reported by Aleksey Sadovoy
54
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gnome-orca
Invalid
Undecided
Unassigned
portaudio19 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: espeak

i am using orca and after reboot i noticed that espeak sound started to be unrecognizable. it just cut end and start of the sound, so i am able to listen just long phrases (really the midle of them). probably, it is related to the portaudio, becouse some another program i have (which also uses portaudio) has similar problem.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: espeak 1.40.02-0ubuntu1
ProcEnviron:
 LANG=ru_UA.UTF-8
 SHELL=/bin/bash
SourcePackage: espeak
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
RCC2k9 (robertoc04) wrote :

I'm also experiencing this bug with Ubuntu 9.04 Beta (32-bit version). It makes Orca unusable. Note that I have confirmed the problem is with espeak, not with orca, because Orca runs fine with Festival. Unfortunately, Festival doesn't have as many languages as eSpeak, so we need to fix espeak, please.

Revision history for this message
Alain Kalker (miki4242) wrote :

Please try the following command:

$ LIBASOUND_DEBUG=1 espeak "This is a test."

This should speak the text. If (instead) you get lots of ALSA ERRORs, one of which is similar to:

ALSA ERROR hw_params: set (ACCESS)
           value = MMAP_INTERLEAVED : Invalid argument

then this is a known problem with libportaudio: it doesn't work with audio drivers which don't support mmap (PulseAudio in particular).

More info here:
http://www.nabble.com/-PATCH--Support-ALSA-without-mmap-(e.g.-PulseAudio)-td20403320.html

Revision history for this message
Alain Kalker (miki4242) wrote :

Nevermind the above, portaudio19 seems to have the mmap patch applied, so this must be a different problem.

Revision history for this message
Alain Kalker (miki4242) wrote :

The problem does seem to be related to portaudio.
I have rebuilt espeak against portaudio v18 (it currently uses v19), and got espeak to speak without too many hiccups.
I have tested it with orca, while navigating apps and webpages and listening for longer periods, without any crashes.
Every so often there appears to be a very short stutter at the beginning of a sentence, when espeak hasn't spoken for a while.

Please try my rebuilt packages at my PPA:

https://launchpad.net/~miki4242/+archive/ppa

Any feedback is very welcome.

Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :

>The problem does seem to be related to portaudio.
Feel free to reassign the bug.

>I have rebuilt espeak against portaudio v18 (it currently uses v19), and got espeak to speak without too many hiccups.
Thanks, but i want portaudio19 working, because i have program which depends on 19 version (i build it from source)
Also, "to speak without too many hiccups" - is confusing to me. i would like to work with clear voice, as it was a week ago.

Again thanks for your time!

Revision history for this message
Jonathan Duddington (jonsd) wrote :

Using the Ubuntu 9.04 beta live-cd, I found that doing the command:
espeak "hello world 1 2 3 4 5"

produces what sounds like very fast garbled speech on one computer occasionally, but always (every time) on another.

On the computer where the fault occurs always, I then changed to the Kububtu 9.04 beta live-cd and added the same eSpeak and portaudio files (Kubuntu doesn't include eSpeak on the live-cd). The problem did not occur with Kubuntu 9.04.

I also added the same eSpeak and Portaudio files to the installed version of Linux (Kubuntu 8.04) and the problem did not occur.

So it seems that this problem occurs in Ubuntu 9.04 beta, but not if the same eSpeak and Portaudio files are copied onto Kubuntu 9.04 beta, or Kubuntu 8.04.

Is this a clue?

On Kubuntu, I did notice a click sound at the start of some speech (depending on the initial word) when using the eSpeak which is compiled to use libportaudio.so.2 which does not occur with eSpeak which uses libportaudio.so.0. For example:
espeak -veo "e".

It is not present if the eSpeak speech is output to a WAV file (espeak -w out.wav -veo "e"). This may be related, or it may be a separate problem with eSpeak/portaudio/alsa.

Revision history for this message
Alain Kalker (miki4242) wrote :

Aleksey,
Mixing applications which use portaudio v18 or v19 on the same system should be no problem, because the shared libraries have different 'sonames': /usr/lib/libportaudio.so.0 (for v18) versus /usr/lib/libportaudio.so.2 (for v19), and the linker will find the right portaudio shared library to go with a particular application.
However, you should take care when rebuilding applications which use portaudio from source, because there can only be one portaudio*-dev package installed at one time.

Jonathan,
Very interesting, I will look into that.

Revision history for this message
Steve Langasek (vorlon) wrote :

If this happens with Ubuntu but not with Kubuntu, then one relevant difference is the use of pulseaudio by default on Ubuntu only. I'm subscribing Luke Yelavich to this bug to have a look, since he's our a11y and audio expert.

Also, FWIW I'm unable to reproduce the problem in question here, so this is probably a hardware-dependent problem.

affects: espeak (Ubuntu) → portaudio19 (Ubuntu)
Changed in portaudio19 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :

Alain Kalker:
>Mixing applications which use portaudio v18 or v19 on the same system should be no problem, because the shared
>libraries have different 'sonames': /usr/lib/libportaudio.so.0 (for v18) versus /usr/lib/libportaudio.so.2 (for v19),
>and the linker will find the right portaudio shared library to go with a particular application.
yes, but if portaudio19 doesn't work this makes no sence.

I updated my system with aptitude full-upgrade and problem still exists. Other system sounds are playied correctly, including totem player and gnome sound effects. So probably it is bug in portaudio, not in pulseaudio for my hardvare. Also, note than when i firstly installed ubuntu 9.04 alpha6 this problem didn't exist for me.

Revision history for this message
Aleksey Sadovoy (lex-onm) wrote : apport-collect data

Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: lex 3313 F.... mixer_applet2
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xfe0f8000 irq 20'
   Mixer name : 'Realtek ALC883'
   Components : 'HDA:10ec0883,14623ff3,00100002 HDA:11c11040,11c10001,00100200'
   Controls : 27
   Simple ctrls : 16
DistroRelease: Ubuntu 9.04
Package: alsa-base 1.0.18.dfsg-1ubuntu8
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 LANG=ru_UA.UTF-8
Uname: Linux 2.6.28-11-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :
Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :

with guidance of Dtchen on ubuntu-devel i tried running espeak without pulseaudio (pasuspender -- espeak "hello world 1 2 3") and installing a test kernel with alsa fixes, both without success.

Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :

Is there any progress on this issue? Really, espeak is unusable in ubuntu jaunty. As i noted above, in alpha6 this issue didn't exist, so we can just downgrade to previous portaudio ubuntu package.

Also, why this bug isn't noted in jaunty's release notes?

Revision history for this message
linuxrules (linuxrules) wrote :
Revision history for this message
edgar-rft (edgar-rft) wrote :

Hello all,

I think I have the same problem with espeak on Ubuntu Jaunty i386
with Gnome.

With orca or espeak on the command line I only get farting noises
out of my speakers (sorry, but this exactly is what it sounds like).

I already did what is written in Part A of:
Ubuntu HOWTO - PulseAudio Fixes & System-Wide Equalizer Support
(http://ubuntuforums.org/showthread.php?t=789578)

I also compiled several versions of espeak-1.40.02 myself
by changing the Makefile to one of these:

AUDIO = portaudio
AUDIO = pulseaudio

with portaudio18 and portaudio19 (Ubuntu versions), together with
exchanging the "portaudio.h" in "espeak-1.40.02/src" to the
appropriate versions.

All-in-all I compiled four different versions, but no success,
neither with pulseaudio, portaudio18 nor portaudio19.

I tried to compile espeak-1.40.02 with a portaudio19 SVN snapshot
(May 5th 2009) but instantly got overloaded with ALSA errors so I
decided to dump it.

I would be willing to do further investigations but need some
hints where to search next.

Here's what I get with espeak-1.40.02 on the command line:

--- xterm output ---
bash$> LIBASOUND_DEBUG=1 espeak "This is a test."
ALSA ERROR hw_params: set (FORMAT)
           value = S32_LE : Invalid argument
ACCESS: MMAP_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: [32 96]
CHANNELS: [2 6]
RATE: [48000 96000]
PERIOD_TIME: (31 341334)
PERIOD_SIZE: [3 16384]
PERIOD_BYTES: [32 65536]
PERIODS: [1 1024]
BUFFER_TIME: (31 341334)
BUFFER_SIZE: [3 16384]
BUFFER_BYTES: [32 65536]
TICK_TIME: ALL
ALSA ERROR hw_params: set (FORMAT)
           value = S32_BE : Invalid argument
ACCESS: MMAP_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: [32 96]
CHANNELS: [2 6]
RATE: [48000 96000]
PERIOD_TIME: (31 341334)
PERIOD_SIZE: [3 16384]
PERIOD_BYTES: [32 65536]
PERIODS: [1 1024]
BUFFER_TIME: (31 341334)
BUFFER_SIZE: [3 16384]
BUFFER_BYTES: [32 65536]
TICK_TIME: ALL
ALSA ERROR hw_params: set (ACCESS)
           value = MMAP_INTERLEAVED : Invalid argument
ACCESS: RW_INTERLEAVED
FORMAT: U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW
SUBFORMAT: STD
SAMPLE_BITS: [8 32]
FRAME_BITS: [8 1024]
CHANNELS: [1 32]
RATE: [1 192000]
PERIOD_TIME: (5 4294967295)
PERIOD_SIZE: [1 1398102)
PERIOD_BYTES: [128 1398102)
PERIODS: [3 1024]
BUFFER_TIME: (15 4294967295]
BUFFER_SIZE: [3 4194304]
BUFFER_BYTES: [384 4194304]
TICK_TIME: ALL
--- end of xterm output ---

More information on request, this is already long enough. :-)

Thanks,

- edgar

Revision history for this message
linuxrules (linuxrules) wrote :

yes it does, couldn't say it beter myself

Revision history for this message
edgar-rft (edgar-rft) wrote :
Download full text (3.4 KiB)

Hi all,

I only wanted to tell that after several days of reading all
the pulseaudio/portaudio/alsa specs over and over again I got
orca and espeak working on Ubuntu-9.04-i386 with Gnome.

The problem is that I have fiddled so much in the Ubuntu audio
configuration that at the moment I still have no EXACT idea what
the real problem was. But everything looks as if it has something
to do with the Ubuntu pulseaudio setup and NOT with portaudio.

I still will have to test the whole stuff again with a plain
Ubuntu installation, but this still will last some more days.

However, you will need to re-compile espeak yourself to make
it work. Here are the most important steps I did:

Download the ORIGINAL espeak source code from:

http://espeak.sourceforge.net/download.html

and unpack it into a sub-folder of your home directory.

Ignore the espeak "ReadMe" file because the instructions there
are rather useless and misleading for Ubuntu and pulseaudio.

In particular, you DO NOT NEED to adapt the "portaudio.h" files
in the "espeak/src" directory to compile espeak with pulseaudio.

I can compile espeak on Ubuntu with all "portaudio[xx].h" files
in the "espeak/src" directory deleted what makes me assume that
the Ubuntu problems have nothing to do with portaudio at all.

Now go into the "espeak/src" directory and modify the Makefile:

bash$ cd /.../espeak-1.40.02-source/src
bash$ gedit Makefile

Change the AUDIO setting in the Makefile from "portaudio" to
"pulseaudio" as shown below and save the modified Makefile
back to disk:

--- /espeak-1.40.02-source/src/Makefile ---
#AUDIO = portaudio
AUDIO = pulseaudio
#AUDIO = sada
--- end of /espeak-1.40.02-source/src/Makefile ---

Espeak will use the Ubuntu "/usr/include/pulse/pulseaudio.h"
file by default, you do not need to change anything else but
the Makefile (and maybe the Ubuntu pulseaudio setup, what
still needs to be verified by testing on a plain Ubuntu
install during the next days).

Now, in the "espeak/src" directory, type "make":

bash$ make

1. NOTE: espeak will NOT work correctly if started after "make"
from the "/espeak/src" directory, because it still loads the
non-working Ubuntu "/usr/lib/libespeak.so.1.1.40" library.

2. NOTE: First I had espeak installed in "/usr/local/bin" by
modifying the PREFIX setting in the Makefile but it didn't
work neither. The only way to make it work correctly seems
to install espeak in "/usr/bin" (where it finally worked).

3. BEWARE: "make install" will OVERWRITE the Ubuntu files
and there is no "uninstall" target defined in the Makefile!

The affected Ubuntu files are:

/usr/bin/espeak
/usr/lib/libespeak.so.1 # link to libespeak.so.1.1.40
/usr/lib/libespeak.so.1.1.40
/usr/share/espeak-data # the entire directory

Either copy the files to a safe backup-location before you type
"make install" or in case something goes wrong, you can restore
the original Ubuntu files by re-installing the packages:

espeak
espeak-data
libespeak1

The self-compiled espeak will also install the files:

/usr/lib/libespeak.a
/usr/lib/libespeak.so # also a link to libespeak.so.1.1.40

In case of an un-installation you may have to delete these files
yourself manually on the bash command line...

Read more...

Revision history for this message
edgar-rft (edgar-rft) wrote :

Hi all,

Preface: I hope this is the last and final mega-post on this page.

Note to the developers: this bug has NOTHING to do with portaudio
and there is NO NEED to change the Ubuntu audio setup.

It was the wrong information in the espeak "ReadMe" file which made
me assume that this could have something to do with portaudio.

Everything looks as if the Ubuntu espeak packages have just been
copied from Debian without checking for pulseaudio compatibility.

Here is how I fixed espeak on Ubuntu-9.04-i386 with Gnome.

--- How to compile espeak with PulseAudio support on Ubuntu-9.04 ---

Using an Ubuntu-9.04-i386 DVD I did a Ubuntu "Desktop" installation
including a subsequent package update (May 11th 2009).

For a test I started orca by typing "orca" into the Gnome terminal
but instead of speech I got only weird noises.

I copied the ORIGINAL espeak source code from
http://espeak.sourceforge.net/download.html
into a sub-folder of my home directory:

bash ~/$ mkdir -p downloads/espeak
bash ~/$ cp espeak-1.40.02-source.zip ~/downloads/espeak

I unzipped the espeak source package and changed the working directory
to ".../espeak-1.40.02/src":

bash ~/$ cd downloads/espeak
bash ~/downloads/espeak$ unzip espeak-1.40.02-source.zip
bash ~/downloads/espeak$ cd espeak-1.40.02-source/src/
bash ~/downloads/espeak/espeak-1.40.02-source/src$

I modified the Makefile in the espeak "src" directory by typing:

bash ~/downloads/espeak/espeak-1.40.02-source/src$ gedit Makefile

With gedit I changed the AUDIO settings in the Makefile as shown below
and saved the modified Makefile back to disk.

--- espeak-1.40.02-source/src/Makefile line 27-29 ---
#AUDIO = portaudio
AUDIO = pulseaudio
#AUDIO = sada
--- end of espeak-1.40.02-source/src/Makefile ---

To be able to compile espeak with pulseaudio support I needed
the following Ubuntu packages to be installed:

build-essential
libpulse-dev (including all dependencies)

Then I typed "make", "sudo make install" and "sudo ldconfig":

bash ~/downloads/espeak/espeak-1.40.02-source/src$ make
bash ~/downloads/espeak/espeak-1.40.02-source/src$ sudo make install
bash ~/downloads/espeak/espeak-1.40.02-source/src$ sudo ldconfig

Now, if I type "orca", I get speech instead of weird noises.

There is NO NEED to change anything in the Ubuntu-9.04 audio setup.

------------------------- Emergency Rescue ----------------------------

Because there is no "uninstall" target defined in the espeak Makefile,
here is how to remove a self-compiled espeak from a Ubuntu system:

sudo rm -f /usr/bin/espeak
sudo rm -f /usr/lib/libespeak.a
sudo rm -f /usr/lib/libespeak.so
sudo rm -f /usr/lib/libespeak.so.1
sudo rm -f /usr/lib/libespeak.so.1.1.40
sudo rm -f /usr/include/espeak_lib.h
sudo rm -rf /usr/share/espeak-data

Then re-install the following Ubuntu packages:

espeak
espeak-data
libespeak1

If I now type "orca" I get exactly the same weird noises as before. :-)

- edgar

Revision history for this message
Aleksey Sadovoy (lex-onm) wrote :

Hi edgar,

The actual portaudio bug in question exists, you found just a workaround: compile espeak with pulseaudio backend instead of portaudio backend. You've got a working espeak, but portaudio still doesn't work correctly. You can test it with other programs, which use portaudio for sound output. However, i tested only with one of such apps (besides espeak)

Revision history for this message
edgar-rft (edgar-rft) wrote :

Alexey: The portaudio bug exists, you found just a workaround...

Thanks to Alexey for this clarifivation. :-)

I'm somehow involved in the Audacity project (if you type "edgar-rft" into
Google you'll get several pages of my stupid talking) and also work with
lots of other (port-) audio software.

I'm mainly workíng with Common Lisp and I'm a rather bad C/C++ programmer
but if anybody can give me a list of software with similar portaudio
problems I would be willing to do further investigations.

- edgar

Revision history for this message
ogobeone (biofuelwatcher) wrote :

I'm a newbie to Ubuntu and I'm no programmer, at least not at the level I'm seeing here. But I just set up an Ubuntu computer and have tried to do the same things I do in Windows XP for recreation, one of which is to read a lot. And I get tired of reading. So I get Says Me to do it for me. I tried to get eSpeak and Festival to work all day today. I see it's a current concern. I can't get either one to say a word. espeak makes clipped grunts (as does Orca) and Festival says nothing. I tried edgar-rft's compile method of original source code and it just gave me errors. I used gksudo instead of sudo. I may have to keep using Says Me in Windows. Too bad. I feel a little safer being on line in Linux.

So, folks, I hope Ubuntu figures this out and lets me download an update for it that works, because it's hard to read after a hard day of work.

Revision history for this message
alej0 (alej0varas) wrote :

This is not a bug-fix, but is a simple solution for some cases. You can try this:

$ espeak --stdout "Hello, World" | aplay

It works fine for me and there is not need to compile or install. Whit -f (man espeak) you can read from files.

The magic here is "--stdout" and "| aplay".
Fom espeak man page:
" --stdout
              Write speech output to stdout"
From bash man page
"Pipelines
       A pipeline is a sequence of one or more commands separated by the character |"

HTH

Revision history for this message
David Sugar (dyfet-deactivatedaccount) wrote :

In Jaunty we have: portaudio19-19+svn20071207
In Karmic we currently have: portaudio19_19+svn20090620

Offhand, I do not know if this finally fixes these specific issues, however. Also rebuilding the newer Karmic package on Jaunty may break abi's, depending on what is different in these svn snapshots, so it's not as simple unless all dependent apps are also rebuilt & updated...

Changed in gnome-orca:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.