diff --git a/src/modules/module-pipe-tunnel.c b/src/modules/module-pipe-tunnel.c index 3f9aaa86f..77344197a 100644 --- a/src/modules/module-pipe-tunnel.c +++ b/src/modules/module-pipe-tunnel.c @@ -40,6 +40,7 @@ * ## Module Options * * - `tunnel.mode`: the desired tunnel to create. (Default `playback`) + * - `tunnel.may-pause`: if the tunnel stream is allowed to pause on xrun * - `pipe.filename`: the filename of the pipe. * - `stream.props`: Extra properties for the local stream. * @@ -55,6 +56,12 @@ * When `tunnel.mode` is `source`, a source node is created. Samples read from * the the pipe will be made available on the source. * + * `tunnel.may-pause` allows the tunnel stream to become inactive (paused) when + * there is no data in the fifo or when the fifo is full. For `capture` and + * `playback` `tunnel.mode` this is by default true. For `source` and `sink` + * `tunnel.mode`, this is by default false. A paused stream will consume no + * CPU and will resume when the fifo becomes readable or writable again. + * * When `pipe.filename` is not given, a default fifo in `/tmp/fifo_input` or * `/tmp/fifo_output` will be created that can be written and read respectively, * depending on the selected `tunnel.mode`. @@ -86,6 +93,7 @@ * { name = libpipewire-module-pipe-tunnel * args = { * tunnel.mode = playback + * #tunnel.may-pause = true * # Set the pipe name to tunnel to * pipe.filename = "/tmp/fifo_output" * #audio.format= @@ -128,6 +136,7 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME); "( audio.channels= ) " \ "( audio.position= ) " \ "( tunnel.mode=capture|playback|sink|source )" \ + "( tunnel.may-pause= )" \ "( pipe.filename= )" \ "( stream.props= ) " @@ -898,6 +907,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) res = -EINVAL; goto error; } + if ((str = pw_properties_get(props, "tunnel.may-pause")) != NULL) + impl->may_pause = spa_atob(str); if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL) pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");