summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <git@arunraghavan.net>2015-11-18 08:26:47 +0530
committerArun Raghavan <git@arunraghavan.net>2015-12-15 17:09:31 +0530
commit12b5e7c87365e4dbbc4c5fdd8a3579099e5902b5 (patch)
treefa46f02cf6a0861355d3acb26e2fbe8d34aa6d60
parent2c2c2676eeb44300622d28898859967b5ef5a3a0 (diff)
downloadpulseaudio-12b5e7c87365e4dbbc4c5fdd8a3579099e5902b5.tar.gz
echo-cancel: Don't skip canceller when sink is inactive
This forces the canceller engine to be invoked even if playback is not currently active. We need to do this for cases where the engine provides additional processing that is independent of playback, such as noise suppression and AGC. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83557
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index acf43e99a..18fe5dce4 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -791,7 +791,7 @@ static void do_push_drift_comp(struct userdata *u) {
/* This one's simpler than the drift compensation case -- we just iterate over
* the capture buffer, and pass the canceller blocksize bytes of playback and
- * capture data.
+ * capture data. If playback is currently inactive, we just push silence.
*
* Called from source I/O thread context. */
static void do_push(struct userdata *u) {
@@ -877,12 +877,6 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
return;
}
- if (PA_UNLIKELY(u->source->thread_info.state != PA_SOURCE_RUNNING ||
- u->sink->thread_info.state != PA_SINK_RUNNING)) {
- pa_source_post(u->source, chunk);
- return;
- }
-
/* handle queued messages, do any message sending of our own */
while (pa_asyncmsgq_process_one(u->asyncmsgq) > 0)
;
@@ -939,8 +933,8 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
u->sink_skip -= to_skip;
}
- /* process and push out samples */
- if (u->ec->params.drift_compensation)
+ /* process and push out samples, do drift compensation only if the sink is actually running */
+ if (u->ec->params.drift_compensation && u->sink->thread_info.state == PA_SINK_RUNNING)
do_push_drift_comp(u);
else
do_push(u);