protocol: improve manager socket handling

Some of the tools would like to connect to the manager socket first
because they are manager style apps. They however completely ignore any
of the configured sockets in the config and assume everything is the
default.

Fix this by adding a remote.intention = "manager" to those apps. This
instructs the protocol to first try to connect to a socket with the
-manager extension before attempting the regular configured socket.

This makes things work when you have sockets configured in /tmp
and have remote.name = /tmp/pipewire-0 in the config.
This commit is contained in:
Wim Taymans 2025-01-29 12:59:45 +01:00
parent 546de65c67
commit 516f86c329
6 changed files with 25 additions and 13 deletions

View file

@ -209,8 +209,8 @@ int main(int argc, char *argv[])
data.core = pw_context_connect(data.context,
pw_properties_new(
PW_KEY_REMOTE_NAME, opt_remote ? opt_remote :
("[" PW_DEFAULT_REMOTE "-manager," PW_DEFAULT_REMOTE "]"),
PW_KEY_REMOTE_INTENTION, "manager",
PW_KEY_REMOTE_NAME, opt_remote,
NULL),
0);
if (data.core == NULL) {

View file

@ -1604,8 +1604,8 @@ int main(int argc, char *argv[])
data.core = pw_context_connect(data.context,
pw_properties_new(
PW_KEY_REMOTE_NAME, opt_remote ? opt_remote :
("[" PW_DEFAULT_REMOTE "-manager," PW_DEFAULT_REMOTE "]"),
PW_KEY_REMOTE_INTENTION, "manager",
PW_KEY_REMOTE_NAME, opt_remote,
NULL),
0);
if (data.core == NULL) {

View file

@ -886,8 +886,8 @@ int main(int argc, char *argv[])
data.core = pw_context_connect(data.context,
pw_properties_new(
PW_KEY_REMOTE_NAME, opt_remote ? opt_remote :
("[" PW_DEFAULT_REMOTE "-manager," PW_DEFAULT_REMOTE "]"),
PW_KEY_REMOTE_INTENTION, "manager",
PW_KEY_REMOTE_NAME, opt_remote,
NULL),
0);
if (data.core == NULL) {

View file

@ -870,8 +870,8 @@ int main(int argc, char *argv[])
data.core = pw_context_connect(data.context,
pw_properties_new(
PW_KEY_REMOTE_NAME, opt_remote ? opt_remote :
("[" PW_DEFAULT_REMOTE "-manager," PW_DEFAULT_REMOTE "]"),
PW_KEY_REMOTE_INTENTION, "manager",
PW_KEY_REMOTE_NAME, opt_remote,
NULL),
0);
if (data.core == NULL) {