From 7eac9874f00d900b699d7851977da334e5d9a44d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 14 Jan 2021 15:06:24 +0100 Subject: [PATCH] daemon: add nofail option to the modules section Use nofail on rtkit when it's not available. --- src/daemon/main.c | 5 ++++- src/daemon/pipewire.conf.in | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/daemon/main.c b/src/daemon/main.c index a9c1bff6d..f79fc5bcb 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -122,10 +122,13 @@ static int load_module(struct data *d, const char *key, const char *args, const if (errno == ENOENT && flags && strstr(flags, "ifexists") != NULL) { pw_log_debug(NAME" %p: skipping unavailable module %s", d, key); - } else { + } else if (flags == NULL || strstr(flags, "nofail") == NULL) { pw_log_error(NAME" %p: could not load module \"%s\": %m", d, key); return -errno; + } else { + pw_log_info(NAME" %p: could not load module \"%s\": %m", + d, key); } } return 0; diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in index e052fa374..5f00d0793 100644 --- a/src/daemon/pipewire.conf.in +++ b/src/daemon/pipewire.conf.in @@ -40,12 +40,16 @@ spa-libs = { modules = { ## = { [args = "= ..."] - # [flags = ifexists] } + # [flags = [ifexists]|[nofail]} # - # Loads a module with the given parameters. Normally failure is - # fatal if the module is not found, unless -ifexists is given. + # Loads a module with the given parameters. + # If ifexists is given, the module is ignoed when it is not found. + # If nofail is given, module initialization failures are ignored. # - libpipewire-module-rtkit = { "#args" = "rt.prio=20 rt.time.soft=200000 rt.time.hard=200000" flags=ifexists } + libpipewire-module-rtkit = { + "#args" = "rt.prio=20 rt.time.soft=200000 rt.time.hard=200000" + flags = ifexists|nofail + } libpipewire-module-protocol-native = null libpipewire-module-profiler = null libpipewire-module-metadata = null