diff --git a/doc/plugins.rst b/doc/plugins.rst index f97b78c5c..40d629bbe 100644 --- a/doc/plugins.rst +++ b/doc/plugins.rst @@ -1084,6 +1084,9 @@ Connect to a `PipeWire `_ server. Requires - Link to the given target. If not specified, let the PipeWire manager select a target. To get a list of available targets, type ``pw-cli dump short Node`` + * - **remote NAME** + - The name of the remote to connect to. The default is + ``pipewire-0``. .. _pulse_plugin: diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index cf623a1cb..73b4cf0c8 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -54,6 +54,7 @@ static constexpr Domain pipewire_output_domain("pipewire_output"); class PipeWireOutput final : AudioOutput { const char *const name; + const char *const remote; const char *const target; struct pw_thread_loop *thread_loop = nullptr; @@ -185,6 +186,7 @@ inline PipeWireOutput::PipeWireOutput(const ConfigBlock &block) :AudioOutput(FLAG_ENABLE_DISABLE), name(block.GetBlockValue("name", "pipewire")), + remote(block.GetBlockValue("remote", nullptr)), target(block.GetBlockValue("target", nullptr)) { if (target != nullptr) { @@ -366,6 +368,10 @@ PipeWireOutput::Open(AudioFormat &audio_format) PW_KEY_APP_NAME, "Music Player Daemon", PW_KEY_NODE_NAME, "mpd", nullptr); + + if (remote != nullptr && target_id == PW_ID_ANY) + pw_properties_setf(props, PW_KEY_REMOTE_NAME, "%s", remote); + if (target != nullptr && target_id == PW_ID_ANY) pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target);