Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-14 Thread Luke Yelavich
tags 707912 pending
thanks

On Tue, May 14, 2013 at 10:41:36AM EST, Jason White wrote:
 The problem turned out to be that we were building libespeak.a without
 AUDIO=runtime enabled, as required for the debian installer according to the
 Git history. We then built the shared library with AUDIO=runtime set, but the
 object files weren't regenerated.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-13 Thread Reece Dunn
On 13 May 2013 00:34, Jason White ja...@jasonjgw.net wrote:

 Reece Dunn mscl...@googlemail.com wrote:
  Are you sure the AUDIO=runtime flags are being set during the build?
 
  In line 30 of src/Makefile, espeak sets AUDIO=portaudio. This could be
  overriding the AUDIO setting like CXXFLAGS were being overrided in bug
  #707925.
 
  If AUDIO=runtime is built correctly, both wave.cpp and wave_pulse.cpp
  should be compiled and -DUSE_PULSEAUDIO -DUSE_PORTAUDIO should be passed
 to
  the compiler (see lines 37-39).

 Yes, indeed, and that's exactly what I see in the output of make during the
 compilation.

 It appears that variables specified on the make command line are treated
 differently from those brought in from the environment.


Then that should work...

The src/wave.cpp file contains the AUDIO=portaudio and AUDIO=runtime logic
and the src/wave_pulse.cpp file contains the AUDIO=pulse logic.

If both USE_PULSEAUDIO and USE_PORTAUDIO are defined, the wave API is
renamed from wave_xyz to wave_port_xyz for the portaudio bindings
(src/wave.cpp, lines 182-193) and to wave_pulse_xyz for the pulseaudio
bindings (src/wave_pulse.cpp, lines 80-91).

The AUDIO=runtime logic then uses the wave_xyz functions defined in
src/wave.cpp, lines 94-179 that uses either pulseaudio or portaudio.

The wave_init function calls is_pulse_running which returns 1 if calling
pa_simple_new returns a non-NULL pointer. If pulseaudio is running, the
wave_pulse_xyz APIs are called (which will call pa_context_new via
wave_pulse_init/pulse_open) otherwise the wave_port_xyz APIs are called
(which will call Pa_Initialize via wave_port_init).

Thus, with pulseaudio working you shoulds have the calls:
wave_init
is_pulse_running
pa_simple_new
wave_pulse_init
pulse_open
pa_context_new
and with pulseaudio not working, you should have the calls:
wave_init
is_pulse_running
pa_simple_new
wave_port_init
Pa_Initialize


Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-13 Thread Jason White
The problem turned out to be that we were building libespeak.a without
AUDIO=runtime enabled, as required for the debian installer according to the
Git history. We then built the shared library with AUDIO=runtime set, but the
object files weren't regenerated.

Here's a proposed patch for this. Anyone with a better solution is welcome to
offer it.

From d47ee05d303762567f27c4aae2729d297c52f0f5 Mon Sep 17 00:00:00 2001
From: Jason White ja...@jasonjgw.net
Date: Tue, 14 May 2013 10:33:51 +1000
Subject: [PATCH] Rebuild object files with AUDIO=runtime after building static
 library without it.

---
 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index 8b38a4b..1afb1a7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,6 +32,9 @@ build-stamp:
 
cp src/portaudio19.h src/portaudio.h
cd src  CXXFLAGS=$(CXXFLAGS) $(CFLAGS) $(MAKE) 
DATADIR=$(ESPEAK_DATA)/espeak-data libespeak.a
+   # Remove object files so we can rebuild them with
+   # AUDIO=runtime enabled
+   rm -f src/*.o
cd src  CXXFLAGS=$(CXXFLAGS) $(CFLAGS) $(MAKE) 
DATADIR=$(ESPEAK_DATA)/espeak-data espeak AUDIO=runtime
 
# Build static speak binary
-- 
1.8.1.3


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-12 Thread Jason White
Having built with debug symbols, I can confirm this bug: we're invoking
PortAudio even when Pulse is active.

Maybe the best solution at this point would be to ask upstream to sort out the
code in src/wave.cpp.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-12 Thread Reece Dunn
Are you sure the AUDIO=runtime flags are being set during the build?

In line 30 of src/Makefile, espeak sets AUDIO=portaudio. This could be
overriding the AUDIO setting like CXXFLAGS were being overrided in bug
#707925.

If AUDIO=runtime is built correctly, both wave.cpp and wave_pulse.cpp
should be compiled and -DUSE_PULSEAUDIO -DUSE_PORTAUDIO should be passed to
the compiler (see lines 37-39).

The code in src/wave.cpp is doing the right thing, as I have built eSpeak
with AUDIO=runtime (not through this package) and it does not invoke
Pa_Initialize, but does invoke pa_simple_new.


Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-12 Thread Jason White
Reece Dunn mscl...@googlemail.com wrote:
 Are you sure the AUDIO=runtime flags are being set during the build?
 
 In line 30 of src/Makefile, espeak sets AUDIO=portaudio. This could be
 overriding the AUDIO setting like CXXFLAGS were being overrided in bug
 #707925.
 
 If AUDIO=runtime is built correctly, both wave.cpp and wave_pulse.cpp
 should be compiled and -DUSE_PULSEAUDIO -DUSE_PORTAUDIO should be passed to
 the compiler (see lines 37-39).

Yes, indeed, and that's exactly what I see in the output of make during the
compilation.

It appears that variables specified on the make command line are treated
differently from those brought in from the environment.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#707912: espeak: the AUDIO=runtime compilation ption does not invoke PulseAudio as intended

2013-05-11 Thread Jason White
Package: espeak
Version: 1.47.07-1
Severity: normal

This might explain some of the issues that people have been experiencing with
ESpeak lately.

Debian properly enables the AUDIO=runtime compilation option, but gdb shows
that even when PulseAudio is running on my system, PortAudio functions (e.g.,
Pa_Initialize()) are invoked. If ALSA is configured to invoke PulseAudio
anyway (the default under Debian with PA installed), Alsa issues warnings
about underruns on my system.

I've looked at the preprocessor directives in src/wave.cpp of ESpeak and it
isn't clear how this is supposed to work; it seems to me that the wrappers
may not be applied as the author intended.

I'm going to rebuild this with proper debugging information and investigate
further.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org