[pulseaudio-discuss] [RFC] Add configure option to specify default autospawn behavior

Felipe Sateler fsateler at debian.org
Sat Nov 29 13:04:22 PST 2014


Dbus integration with systemd user sessions is not complete yet. This means
that a socket-activated pulseaudio daemon will not be able to access the session
bus, and thus breaking several modules.

This means that distributions should not yet enable the systemd units by default
until that problem is solved. However, this does not mean that the units cannot be
provided for the users that choose to experiment with them.

Therefore, I propose to separate the decision to support socket activation from the
decision to default to autospawn or not, via a separate configure switch
 --enable-autospawn-default. This way one could build socket activation, and not ship
it by default.

---
 configure.ac            | 10 +++++++++-
 src/pulse/client-conf.c |  6 +++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index fe8423f..172115b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1229,8 +1229,16 @@ AS_IF([test "x$enable_systemd_daemon" != "xno"],
 AS_IF([test "x$enable_systemd_daemon" = "xyes" && test "x$HAVE_SYSTEMD_DAEMON" = "x0"],
     [AC_MSG_ERROR([*** Needed systemd daemon support not found])])
 
-AS_IF([test "x$HAVE_SYSTEMD_DAEMON" = "x1"], [ PA_DEFAULT_AUTOSPAWN=no ], [ PA_DEFAULT_AUTOSPAWN=yes ])
+AC_ARG_ENABLE([autospawn-default],
+    AS_HELP_STRING([--enable-autospawn-default], [Enable autospawn by default (default is to disable when socket activation is enabled)]))
+
+PA_DEFAULT_AUTOSPAWN="$autospawn_default"
+
+AS_IF([test "x$HAVE_SYSTEMD_DAEMON" = "x1" && test "x$PA_DEFAULT_AUTOSPAWN" = "x"], [ PA_DEFAULT_AUTOSPAWN=no ], [ PA_DEFAULT_AUTOSPAWN=yes ])
 AC_SUBST(PA_DEFAULT_AUTOSPAWN)
+AS_IF([test "x$PA_DEFAULT_AUTOSPAWN" = "xyes"],
+    AC_DEFINE(PA_DEFAULT_AUTOSPAWN, 1, [Whether autospawn is enabled by default])
+    )
 
 AC_SUBST(HAVE_SYSTEMD_DAEMON)
 AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = x1])
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index 80ddae0..250d38b 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -65,10 +65,10 @@ static const pa_client_conf default_conf = {
     .cookie_from_x11_valid = false,
     .cookie_file_from_application = NULL,
     .cookie_file_from_client_conf = NULL,
-#ifdef HAVE_SYSTEMD_DAEMON
-    .autospawn = false,
-#else
+#ifdef PA_DEFAULT_AUTOSPAWN
     .autospawn = true,
+#else
+    .autospawn = false,
 #endif
     .disable_shm = false,
     .shm_size = 0,
-- 
2.1.3



More information about the pulseaudio-discuss mailing list