diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in index 05915c27c..fd1549c6d 100644 --- a/src/daemon/pipewire.conf.in +++ b/src/daemon/pipewire.conf.in @@ -105,7 +105,7 @@ context.modules = [ { name = libpipewire-module-protocol-native args = { # List of server Unix sockets, and optionally permissions - #sockets = [ { name = "pipewire-0" }, { name = "pipewire-manager-0" } ] + #sockets = [ { name = "pipewire-0" }, { name = "pipewire-0-manager" } ] } } diff --git a/src/daemon/systemd/system/pipewire.socket b/src/daemon/systemd/system/pipewire.socket index 2e3cb719f..296fd374b 100644 --- a/src/daemon/systemd/system/pipewire.socket +++ b/src/daemon/systemd/system/pipewire.socket @@ -1,9 +1,10 @@ [Unit] -Description=PipeWire Multimedia System Socket +Description=PipeWire Multimedia System Sockets [Socket] Priority=6 ListenStream=%t/pipewire/pipewire-0 +ListenStream=%t/pipewire/pipewire-0-manager SocketUser=pipewire SocketGroup=pipewire SocketMode=0660 diff --git a/src/daemon/systemd/user/pipewire.socket b/src/daemon/systemd/user/pipewire.socket index 232bbb8cc..16e23a7b6 100644 --- a/src/daemon/systemd/user/pipewire.socket +++ b/src/daemon/systemd/user/pipewire.socket @@ -1,9 +1,10 @@ [Unit] -Description=PipeWire Multimedia System Socket +Description=PipeWire Multimedia System Sockets [Socket] Priority=6 ListenStream=%t/pipewire-0 +ListenStream=%t/pipewire-0-manager [Install] WantedBy=sockets.target diff --git a/src/modules/module-protocol-native.c b/src/modules/module-protocol-native.c index 4ebb9bb7d..486eb5561 100644 --- a/src/modules/module-protocol-native.c +++ b/src/modules/module-protocol-native.c @@ -79,8 +79,10 @@ PW_LOG_TOPIC(mod_topic_connection, "conn." NAME); * * Array of Unix socket names and (optionally) owner/permissions to serve, * if the context is a server. If not absolute paths, the sockets are created - * in the default runtime directory. If not specified, one socket with - * a default name is created. + * in the default runtime directory. + * + * Has the default value `[ { name = "CORENAME" }, { name = "CORENAME-manager" } ]`, + * where `CORENAME` is the name of the PipeWire core, usually `pipewire-0`. * * The permissions have no effect for sockets from Systemd socket activation. * Those should be configured via the systemd.socket(5) mechanism. @@ -131,7 +133,7 @@ PW_LOG_TOPIC(mod_topic_connection, "conn." NAME); *\code{.unparsed} * context.modules = [ * { name = libpipewire-module-protocol-native, - * args = { sockets = [ { name = "pipewire-0" }, { name = "pipewire-1" } ] } } + * args = { sockets = [ { name = "pipewire-0" }, { name = "pipewire-0-manager" } ] } } * ] *\endcode */ @@ -1565,7 +1567,19 @@ static int create_servers(struct pw_protocol *this, struct pw_impl_core *core, struct spa_json it[3]; if (sockets == NULL) { - if (add_server(this, core, &props->dict, NULL) == NULL) + struct socket_info info = {0}; + spa_autofree char *manager_name = NULL; + + info.name = (char *)get_server_name(&props->dict); + if (add_server(this, core, &props->dict, &info) == NULL) + return -errno; + + manager_name = spa_aprintf("%s-manager", info.name); + if (manager_name == NULL) + return -ENOMEM; + + info.name = manager_name; + if (add_server(this, core, &props->dict, &info) == NULL) return -errno; return 0;