Debian Bug report logs -
#406798
Segfault in Pa_OpenDefaultStream if sound device is already in use
Reply or subscribe to this bug.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, josh@freedesktop.org, Mario Lang <mlang@debian.org>:
Bug#406798; Package espeak.
(full text, mbox, link).
Acknowledgement sent to Josh Triplett <josh@freedesktop.org>:
New Bug report received and forwarded. Copy sent to josh@freedesktop.org, Mario Lang <mlang@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: espeak
Version: 1.16-2
Severity: important
With the sound card in use, espeak segfaults. Perhaps a lack of error
handling?
Ideally espeak would use ALSA if available, allowing multiple programs to use
sound simultaneously, but I'd settle for graceful failure. :)
- Josh Triplett
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.20-rc4
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages espeak depends on:
ii espeak-data 1.16-2 A multi-lingual software speech sy
ii libc6 2.3.6.ds1-10 GNU C Library: Shared libraries
ii libgcc1 1:4.1.1-21 GCC support library
ii libportaudio2 19+svn20060825-1 Portable audio I/O - shared librar
ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3
espeak recommends no packages.
-- no debconf information
Reply sent to Mario Lang <mlang@debian.org>:
You have marked Bug as forwarded.
(full text, mbox, link).
Message #8 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Hi.
I've received this bug report on eSpeak 1.16. Could
you please look at it and tell me if this is probably
already addressed in 1.19, and if not, please consider fixing this.
[Message part 2 (application/pgp-signature, inline)]
[Message part 3 (message/rfc822, inline)]
Package: espeak
Version: 1.16-2
Severity: important
With the sound card in use, espeak segfaults. Perhaps a lack of error
handling?
Ideally espeak would use ALSA if available, allowing multiple programs to use
sound simultaneously, but I'd settle for graceful failure. :)
- Josh Triplett
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.20-rc4
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages espeak depends on:
ii espeak-data 1.16-2 A multi-lingual software speech sy
ii libc6 2.3.6.ds1-10 GNU C Library: Shared libraries
ii libgcc1 1:4.1.1-21 GCC support library
ii libportaudio2 19+svn20060825-1 Portable audio I/O - shared librar
ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3
espeak recommends no packages.
-- no debconf information
[Message part 4 (text/plain, inline)]
--
Thanks,
Mario | Debian Developer <URL:http://debian.org/>
.''`. | Get my public key via finger mlang@db.debian.org
: :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
`. `'
`- <URL:http://delysid.org/> <URL:http://www.staff.tugraz.at/mlang/>
Message #9 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
On 28 Jan, Mario Lang <mlang@debian.org> wrote:
> I've received this bug report on eSpeak 1.16. Could
> you please look at it and tell me if this is probably
> already addressed in 1.19, and if not, please consider fixing this.
---- Original report
With the sound card in use, espeak segfaults. Perhaps a lack of error
handling?
Ideally espeak would use ALSA if available, allowing multiple programs
to use sound simultaneously, but I'd settle for graceful failure. :)
----
No, I have never heard of this problem before.
I haven't had a segfault from eSpeak, even though I use it very
frequently, and have often had circumstances where it failed to speak
because of the sound system being in use by another program.
I've just tried it again with the released espeak 1.19 and no segfault
occurred.
eSpeak doesn't directly use ALSA or OSS. It uses the portaudio sound
interface. Portaudio V18 (which I use here) uses OSS and will fail to
speak if the sound system is already in use. I believe portaudio V19
uses ALSA. eSpeak can be compiled to use either V18 or V19 of
portaudio, depending on which version of the portaudio.h it is
compiled with.
Perhaps the user who reported this can try espeak 1.19 from
http://espeak.sourceforge.net/ and report whether the fault still
occurs.
Changed Bug title.
Request was from Mario Lang <mlang@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Message #14 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Jonathan Duddington <jonsd@jsd.clara.co.uk> writes:
> ---- Original report
>
> With the sound card in use, espeak segfaults. Perhaps a lack of error
> handling?
>
> Ideally espeak would use ALSA if available, allowing multiple programs
> to use sound simultaneously, but I'd settle for graceful failure. :)
> ----
>
> No, I have never heard of this problem before.
>
> I haven't had a segfault from eSpeak, even though I use it very
> frequently, and have often had circumstances where it failed to speak
> because of the sound system being in use by another program.
>
> I've just tried it again with the released espeak 1.19 and no segfault
> occurred.
I can easily reproduce this here with espeak 1.19:
x2:~# gdb espeak
GNU gdb 6.5-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/espeak
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 47731865371680 (LWP 31798)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
hello
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47731865371680 (LWP 31798)]
0x00002b697020ff63 in Pa_OpenDefaultStream () from /usr/lib/libportaudio.so.2
> eSpeak doesn't directly use ALSA or OSS. It uses the portaudio sound
> interface. Portaudio V18 (which I use here) uses OSS and will fail to
> speak if the sound system is already in use.
For the Debian eSpeak package, I am using PortAudio V19.
Maybe that is the reason and the bug is actually located inside
PortAuido V19.
Thanks for your input.
--
CYa,
Mario | Debian Developer <URL:http://debian.org/>
.''`. | Get my public key via finger mlang@db.debian.org
: :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
`. `'
`- <URL:http://delysid.org/> <URL:http://www.staff.tugraz.at/mlang/>
[Message part 2 (application/pgp-signature, inline)]
Message #15 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
On 28 Jan, Mario Lang <mlang@debian.org> wrote:
> Original report:
> > With the sound card in use, espeak segfaults. Perhaps a lack of
> > error handling?
> > Ideally espeak would use ALSA if available, allowing multiple
> > programs to use sound simultaneously, but I'd settle for graceful
> > failure. :)
> I can easily reproduce this here with espeak 1.19:
Yes, I get it here also if I use portaudio V19.
There's definitely a bug in portaudio V19.
In function Pa_OpenDefaultStream() in common/pa_front.c, the call to
Pa_GetDefaultOutputDevice() returns -1 if the device is already in use.
When this -1 value is then passed to Pa_GetDeviceInfo(), that returns a
NULL pointer which causes the segfault when it looks up the device
latency setting.
Is portaudio V19 supposed to be using ALSA? I notice that the function
Pa_GetDefaultHostApi() returns value 0, which represents OSS (ALSA is
using value 1). I don't see a way to tell portaudio to use ALSA.
The segfault can probably be avoided if eSpeak uses Pa_OpenStream()
instead of the broken Pa_OpenDefaultStream().
I'm copying this to Gilles Casse who wrote wave.cpp, which is the
portaudio interface for libespeak. Gilles, have you been able to hear
speech output while the sound system is also being used by another
application?
Message #16 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
Hello,
Could you please retry this using the PortAudio devel snapshot?
http://portaudio.com/download.html
Alsa in PortAudio is getting better.
Best regards,
Gilles
--
Oralux http://oralux.org
Message #17 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
On 29 Jan, Gilles Casse <gcasse@oralux.org> wrote:
> Could you please retry this using the PortAudio devel snapshot?
> http://portaudio.com/download.html
> Alsa in PortAudio is getting better.
espeak "hello"
Produces a loud click, a pause, and then speaks "hello". Here is the
stderr output:
Expression 'GetExactSampleRate( hwParams, &defaultSr )' failed in
'src/hostapi/alsa/pa_linux_alsa.c', line: 369
-----
speak "hello"
Produces a loud click, but no speech. Here's the stderr output. The
"previous" snapshot behaves the same as the latest.
Expression 'GetExactSampleRate( hwParams, &defaultSr )' failed in
'src/hostapi/alsa/pa_linux_alsa.c', line: 369
Expression '*odev = open( odevName, flags )' failed in
'src/hostapi/oss/pa_unix_oss.c', line: 820
Expression 'OpenDevices( idevName, odevName, &idev, &odev )' failed in
'src/hostapi/oss/pa_unix_oss.c', line: 863
Expression 'PaOssStream_Initialize( stream, inputParameters,
outputParameters, streamCallback, userData, streamFlags, ossHostApi )'
failed in 'src/hostapi/oss/pa_unix_oss.c', line: 1228
Message #18 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
> espeak "hello"
>
> Produces a loud click, a pause, and then speaks "hello". Here is the
> stderr output:
>
> Expression 'GetExactSampleRate( hwParams, &defaultSr )' failed in
> 'src/hostapi/alsa/pa_linux_alsa.c', line: 369
>
Here the loud click at init time was removed when a better latency was
chosen. The patch is already in eSpeak 1.19 though.
The initial pause is probably due to pa_Initialize. This issue has been
addressed recently in the PortAudio list.
Last week, I met the initially reported issue (concurrent sounds using
Alsa + V19) on 2 machines. These issues were not reproduced using the V19
devel snapshot.
Gilles
--
Oralux http://oralux.org
Message #19 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
On 29 Jan, Gilles Casse <gcasse@oralux.org> wrote:
> Here the loud click at init time was removed when a better latency was
> chosen. The patch is already in eSpeak 1.19 though.
> The initial pause is probably due to pa_Initialize. This issue has
> been addressed recently in the PortAudio list.
So, it seems that the latest development version of portaudio V19
causes problems. In any case, Mario is packaging eSpeak for Debian and
is probably constrained to which version of portaudio is used.
I'll replace the call of Pa_OpenDefaultStream(), which is broken in
some versions of portaudio v19, in wavegen.cpp with a call of
Pa_OpenStream(). I notice that you've already done this in wave.cpp.
This fixes the segfault. Effectively, I'll include a fixed version of
Pa_OpenDefaultStream() within wavegen.cpp.
Another point is the use of the function roundl() in wave.cpp in
update_output_parameters(). This fails to compile on architecture
"hppa" because roundl() isn't defined in its <math.h>. I'll change
roundl() to round(), which I think is the correct function because it
operates on type "double" and assigns its result to type "double".
Message #20 received at 406798-forwarded@bugs.debian.org (full text, mbox, reply):
Jonathan Duddington writes:
> So, it seems that the latest development version of portaudio V19
> causes problems.
Here the pause and the glitch at init time are still reproduced using
a recent PortAudio snapshot. The PortAudio list will be contacted soon.
It will breat to know the features of the audio card or sound chip
where the sound mixing issue occurs.
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406798; Package libportaudio2.
(full text, mbox, link).
Acknowledgement sent to gnaural@users.sourceforge.net:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #25 received at 406798@bugs.debian.org (full text, mbox, reply):
My sound card:
00:1e.2 Multimedia audio controller: Intel Corporation
82801G (ICH7 Family) AC'97 Audio Controller (rev 01)
Running the standard test program patest_sine (taken
from a current PortAudio snapshot), using the current
debian unstable portaudio libs 19+svn20070125-1
segfaults:
debio:~/src/portaudio$ bin/.libs/patest_sine
PortAudio Test: output sine wave. SR = 44100, BufSize
= 64
Segmentation fault
debio:~/src/portaudio$
Running gdb produced this extra info:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211468096 (LWP 27428)]
main () at ./test/patest_sine.c:122
122 outputParameters.suggestedLatency =
Pa_GetDeviceInfo( outputParameters.device
)->defaultLowOutputLatency;
Running same by trading out
/usr/lib/libportaudio.so.2.0.0
/usr/lib/libportaudio.so.2
with same provided in the latest portaudio snapshot
(http://www.portaudio.com/download.html) works fine.
Basically, i think the solution is simply upgrading to
the latest snapshot. The problem with PortAudio 19
with ALSA is that you really need the latest snapshot
for it to deal properly with dmix (the way ALSA apps
share sound card ports when there is no available
hardware mixing); their offered "stable" version
doesn't seem to handle dmix at all, and I get the
sense that the version currently in Unstable
(20070125) was still kind of shaky on it.
Removed annotation that Bug had been forwarded to Jonathan Duddington <jonsd@jsd.clara.co.uk>.
Request was from Mark Purcell <msp@debian.org>
to control@bugs.debian.org.
(Sat, 27 Oct 2007 15:21:04 GMT) (full text, mbox, link).
Message sent on to Josh Triplett <josh@freedesktop.org>:
Bug#406798.
(full text, mbox, link).
Message #30 received at 406798-submitter@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
notforwarded 406798
thanks
Josh, Mario,
Can you confirm this bug report is still an issue with the latest upload of portaudio19 to unstable:
http://bugs.debian.org/406798
portaudio19 (19+svn20071022-2) unstable; urgency=low
* Vanilla 'dh_makeshlibs -a' does correct magic
- shlibs file incorrect: does not force dependency on libportaudiocpp0
(Closes: #447819)
* We only support upgrades from stable/etch 19+svn20060825-1, thus
libportaudio2 (>= 19+cvs20060311-1) is unnecssary
-- Mark Purcell <msp@debian.org> Thu, 25 Oct 2007 06:59:26 +0100
Thanks,
Mark
[signature.asc (application/pgp-signature, inline)]
Acknowledgement sent to Josh Triplett <josh@freedesktop.org>:
Extra info received and filed, but not forwarded.
(full text, mbox, link).
Message #35 received at 406798-quiet@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Mark Purcell wrote:
> Can you confirm this bug report is still an issue with the latest upload of portaudio19 to unstable:
> http://bugs.debian.org/406798
>
> portaudio19 (19+svn20071022-2) unstable; urgency=low
> * Vanilla 'dh_makeshlibs -a' does correct magic
> - shlibs file incorrect: does not force dependency on libportaudiocpp0
> (Closes: #447819)
> * We only support upgrades from stable/etch 19+svn20060825-1, thus
> libportaudio2 (>= 19+cvs20060311-1) is unnecssary
>
> -- Mark Purcell <msp@debian.org> Thu, 25 Oct 2007 06:59:26 +0100
With the latest version of libportaudio2, if I run espeak with the
sound device busy, I no longer get a segfault. Instead, I get this:
sh: jackd: command not found
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'ValidateParameters( outputParameters, hostApi, StreamDirection_Out )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1142
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'ValidateParameters( outputParameters, hostApi, StreamDirection_Out )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1142
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'ValidateParameters( outputParameters, hostApi, StreamDirection_Out )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1142
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'ValidateParameters( outputParameters, hostApi, StreamDirection_Out )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1142
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'ValidateParameters( outputParameters, hostApi, StreamDirection_Out )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1142
wave_open_sound > Pa_OpenStream : err=-9996 (Invalid device)
wave_open_sound > Pa_OpenStream : err=-9996 (Invalid device)
wave_open_sound > Pa_OpenStream : err=-9996 (Invalid device)
wave_open_sound > Pa_OpenStream : err=-9996 (Invalid device)
- Josh Triplett
[signature.asc (application/pgp-signature, attachment)]
Message sent on to Josh Triplett <josh@freedesktop.org>:
Bug#406798.
(full text, mbox, link).
Changed Bug submitter from Josh Triplett <josh@freedesktop.org> to Josh Triplett <josh@joshtriplett.org>.
Request was from Josh Triplett <josh@joshtriplett.org>
to control@bugs.debian.org.
(Sat, 04 Jul 2009 09:56:00 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Fri Jan 5 08:19:55 2018;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.