[pulseaudio-discuss] [PATCH] always-sink: Don't unload ourselves if a filter sink shows up

arun at accosted.net arun at accosted.net
Wed Jun 10 04:49:04 PDT 2015

From: Arun Raghavan <git at arunraghavan.net>

If we don't do this, autoloading a filter module on top of the null sink
results in an infinite loop of:

  1. Load null sink since there are no real sinks
  2. Load filter sink when a stream wants it
  3. We have a (filter) sink, unload null sink
  4. Goto 1
 src/modules/module-always-sink.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/modules/module-always-sink.c b/src/modules/module-always-sink.c
index a5f6bb3..b5721bf 100644
--- a/src/modules/module-always-sink.c
+++ b/src/modules/module-always-sink.c
@@ -114,6 +114,10 @@ static pa_hook_result_t put_hook_callback(pa_core *c, pa_sink *sink, void* userd
     if (sink->module && sink->module->index == u->null_module)
         return PA_HOOK_OK;
+    /* We don't count filter sinks since they need a real sink */
+    if (pa_sink_is_filter(sink))
+        return PA_HOOK_OK;
     pa_log_info("A new sink has been discovered. Unloading null-sink.");
     pa_module_unload_request_by_index(c, u->null_module, true);

More information about the pulseaudio-discuss mailing list