From 52af6c6c9a8ed6aa0b96ebaa698bb3b8e1e42ab5 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 21 Sep 2018 17:36:49 +0100 Subject: [PATCH] Unreference the pa stream when finished with it, so that it the sink can go idle. --- audio_pa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio_pa.c b/audio_pa.c index ac1570e0..0d3aa28b 100644 --- a/audio_pa.c +++ b/audio_pa.c @@ -147,6 +147,7 @@ static void deinit(void) { static void start(__attribute__((unused)) int sample_rate, __attribute__((unused)) int sample_format) { + debug(1,"pa start"); uint32_t buffer_size_in_bytes = (uint32_t)2 * 2 * RATE * 0.1; // hard wired in here // debug(1, "pa_buffer size is %u bytes.", buffer_size_in_bytes); @@ -275,7 +276,8 @@ static void stop(void) { audio_umb = audio_lmb + audio_size; audio_occupancy = 0; - // debug(1, "finish with stream"); + debug(1,"pa stop"); + pa_stream_unref(stream); pa_stream_disconnect(stream); }