From ae077a4967b468e0880ef56c4de74b5c1d9ccc59 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 3 Feb 2022 17:31:01 +0100 Subject: [PATCH] doc: update with config overrides info --- doc/pipewire-daemon.dox | 14 ++++++++++++-- man/pipewire.conf.5.rst.in | 26 +++++++++++++++++++++++++- src/daemon/client-rt.conf.in | 5 +++++ src/daemon/client.conf.in | 6 +++++- src/daemon/jack.conf.in | 5 +++++ src/daemon/minimal.conf.in | 5 +++++ src/daemon/pipewire-pulse.conf.in | 5 +++++ src/daemon/pipewire.conf.in | 7 ++++++- 8 files changed, 68 insertions(+), 5 deletions(-) diff --git a/doc/pipewire-daemon.dox b/doc/pipewire-daemon.dox index d0d387e2a..f2b1ee973 100644 --- a/doc/pipewire-daemon.dox +++ b/doc/pipewire-daemon.dox @@ -62,8 +62,18 @@ for configuration files are: - `$sysconfdir/pipewire/pipewire.conf` (usually `/etc/pipewire/pipewire.conf`) - `$datadir/pipewire/pipewire.conf` (usually `/usr/share/pipewire/pipewire.conf`) -The first configuration file found is loaded, the PipeWire daemon does not -currently combine configuration files. +The first configuration file found is loaded as the base configuration. + +Next, configuration sections are collected in the directories in this +order: + +- `$datadir/pipewire/pipewire.conf.d/` (usually `/usr/share/pipewire/pipewire.conf.d/`) +- `$sysconfdir/pipewire/pipewire.conf.d/` (usually `/etc/pipewire/pipewire.conf.d/`) +- `$XDG_CONFIG_HOME/pipewire/pipewire.conf.d/` (usually `$HOME/.config/pipewire/pipewire.conf.d/`) + +They are applied to the global configuration file. Properties are overwritten +and array elements are appended. This makes it possible to make small custom customizations +or additions to the main configuration file. The environment variables `PIPEWIRE_CONFIG_DIR`, `PIPEWIRE_CONFIG_PREFIX` and `PIPEWIRE_CONFIG_NAME` can be used to specify an alternative config diff --git a/man/pipewire.conf.5.rst.in b/man/pipewire.conf.5.rst.in index afa4dc854..3e3a954b7 100644 --- a/man/pipewire.conf.5.rst.in +++ b/man/pipewire.conf.5.rst.in @@ -19,13 +19,19 @@ SYNOPSIS *@PIPEWIRE_CONFDATADIR@/pipewire.conf* +*@PIPEWIRE_CONFDATADIR@/pipewire.conf.d/* + +*@PIPEWIRE_CONFIG_DIR@/pipewire.conf.d/* + +*$XDG_CONFIG_HOME/pipewire/pipewire.conf.d/* + DESCRIPTION =========== PipeWire is a service that facilitates sharing of multimedia content between devices and applications. -On startup, the daemon reads a configuration file to configure +On startup, the daemon reads a main configuration file to configure itself. It executes a series of commands listed in the config file. @@ -34,6 +40,13 @@ The environment variables ``PIPEWIRE_CONFIG_DIR``, ``PIPEWIRE_CONFIG_PREFIX`` and ``PIPEWIRE_CONFIG_NAME`` can be used to specify an alternative config directory, subdirectory and file respectively. +Next to the configuration file can be a directory with the same name as +the file with a ``.d/`` suffix. All directories in the SYNOPSIS_ directory +search paths are traversed in the listed order and the contents of the +``*.conf`` files inside them are appended to the main configuration file +as overrides. Object sections are merged and array sections are appended. + + CONFIGURATION FILE FORMAT ========================= @@ -51,6 +64,17 @@ name = [ value1 value2 ] # an array with two entries name = [ { k = v1 } { k = v2 } ] # an array of dictionaries + +The configuration files can be expressed in full JSON syntax but for ease +of use, a relaxed format may be used where: + + * ``:`` to delimit keys and values can be substuted by ``=`` or a space. + * ``"`` around keys and string can be omited as long as no special characters + are used in the strings. + * ``,`` to separate objects can be replaced with a whitespace character. + * ``#`` can be used to start a comment until the line end + + CONFIGURATION FILE SECTIONS =========================== diff --git a/src/daemon/client-rt.conf.in b/src/daemon/client-rt.conf.in index cb0489cd0..d996a5f6a 100644 --- a/src/daemon/client-rt.conf.in +++ b/src/daemon/client-rt.conf.in @@ -2,6 +2,11 @@ # # Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes # or in ~/.config/pipewire for local changes. +# +# It is also possible to place a file with an updated section in +# @PIPEWIRE_CONFIG_DIR@/client-rt.conf.d/ for system-wide changes or in +# ~/.config/pipewire/client-rt.conf.d/ for local changes. +# context.properties = { ## Configure properties in the system. diff --git a/src/daemon/client.conf.in b/src/daemon/client.conf.in index 8f216e364..ee0c000fd 100644 --- a/src/daemon/client.conf.in +++ b/src/daemon/client.conf.in @@ -2,7 +2,11 @@ # # Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes # or in ~/.config/pipewire for local changes. - +# +# It is also possible to place a file with an updated section in +# @PIPEWIRE_CONFIG_DIR@/client.conf.d/ for system-wide changes or in +# ~/.config/pipewire/client.conf.d/ for local changes. +# context.properties = { ## Configure properties in the system. #mem.warn-mlock = false diff --git a/src/daemon/jack.conf.in b/src/daemon/jack.conf.in index ba62c3a00..594d2138a 100644 --- a/src/daemon/jack.conf.in +++ b/src/daemon/jack.conf.in @@ -2,6 +2,11 @@ # # Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes # or in ~/.config/pipewire for local changes. +# +# It is also possible to place a file with an updated section in +# @PIPEWIRE_CONFIG_DIR@/jack.conf.d/ for system-wide changes or in +# ~/.config/pipewire/jack.conf.d/ for local changes. +# context.properties = { ## Configure properties in the system. diff --git a/src/daemon/minimal.conf.in b/src/daemon/minimal.conf.in index e160a20e8..6464839a0 100644 --- a/src/daemon/minimal.conf.in +++ b/src/daemon/minimal.conf.in @@ -2,6 +2,11 @@ # # Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes # or in ~/.config/pipewire for local changes. +# +# It is also possible to place a file with an updated section in +# @PIPEWIRE_CONFIG_DIR@/minimal.conf.d/ for system-wide changes or in +# ~/.config/pipewire/minimal.conf.d/ for local changes. +# context.properties = { ## Configure properties in the system. diff --git a/src/daemon/pipewire-pulse.conf.in b/src/daemon/pipewire-pulse.conf.in index facfa3447..1cea3d11e 100644 --- a/src/daemon/pipewire-pulse.conf.in +++ b/src/daemon/pipewire-pulse.conf.in @@ -2,6 +2,11 @@ # # Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes # or in ~/.config/pipewire for local changes. +# +# It is also possible to place a file with an updated section in +# @PIPEWIRE_CONFIG_DIR@/pipewire-pulse.conf.d/ for system-wide changes or in +# ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes. +# context.properties = { ## Configure properties in the system. diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in index 912ab4efd..a948a1b9b 100644 --- a/src/daemon/pipewire.conf.in +++ b/src/daemon/pipewire.conf.in @@ -2,6 +2,11 @@ # # Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes # or in ~/.config/pipewire for local changes. +# +# It is also possible to place a file with an updated section in +# @PIPEWIRE_CONFIG_DIR@/pipewire.conf.d/ for system-wide changes or in +# ~/.config/pipewire/pipewire.conf.d/ for local changes. +# context.properties = { ## Configure properties in the system. @@ -24,7 +29,7 @@ context.properties = { #default.clock.rate = 48000 #default.clock.allowed-rates = [ 48000 ] #default.clock.quantum = 1024 - #default.clock.min-quantum = 32 + default.clock.min-quantum = 16 #default.clock.max-quantum = 2048 #default.clock.quantum-limit = 8192 #default.video.width = 640