Debian Codegraph @

docs/rst/daemon/running.rst

raw
1 .. _daemon_running:
2
3 Running the WirePlumber daemon
4 ==============================
5
6 Systemd
7 -------
8
9 WirePlumber comes with a systemd unit, ``wireplumber.service``, which should
10 be enabled on your user session:
11
12 .. code:: console
13
14 $ systemctl --user --now enable wireplumber
15
16 .. note::
17
18 On non-systemd systems, you just need to ensure that wireplumber is started
19 after pipewire.
20
21 Run from the PipeWire source tree
22 ---------------------------------
23
24 PipeWire's build system comes with an option to build WirePlumber together
25 with PipeWire and allows executing them together without installing either of
26 them.
27
28 To make this work, configure PipeWire with the
29 ``-Dsession-managers="[ 'wireplumber' ]"`` option on the meson command line.
30
31 When compiling PipeWire, the build system will now also clone and compile
32 WirePlumber as a subproject.
33
34 To execute the whole stack without installing, simply execute ``make run``
35 after compiling.
36
37 Synopsis:
38
39 .. code:: console
40
41 $ meson -Dsession-managers="[ 'wireplumber' ]" build
42 $ ninja -C build
43 $ make -C build run
44
45 Run independently or without installing
46 ---------------------------------------
47
48 If you wish to debug WirePlumber, it may be useful to run it separately from
49 PipeWire or run it directly from the source tree without installing.
50 To do so:
51
52 1. Ensure that neither *WirePlumber* nor *pipewire-media-session*
53 are running or started together with PipeWire
54
55 - If any of those is started by systemd,
56
57 - Stop the relevant systemd service, ``wireplumber.service``
58 or ``pipewire-media-session.service``
59 - Disable that service as well if you intend to restart PipeWire
60 (so that the session manager is not restarted with it)
61
62 - If any of those is started from pipewire.conf,
63
64 - Kill it, in order to stop it temporarily: ``killall wireplumber``
65 or ``killall pipewire-media-session``
66 - Comment out with ``#`` the relevant ``{ path = "..." args = "" }``
67 line from the ``context.exec`` section in ``pipewire.conf``,
68 if you intend to restart PipeWire
69
70 2. Ensure that PipeWire is running
71
72 3. Without stopping PipeWire, run WirePlumber.
73
74 - if it is installed, execute ``wireplumber``
75 - if it is **not** installed, execute ``make run`` in the source tree,
76 or use the ``wp-uninstalled.sh`` script:
77
78 .. code:: console
79
80 $ ./wp-uninstalled.sh wireplumber
81
82 Replacing pipewire-media-session
83 --------------------------------
84
85 Older versions of PipeWire used to be distributed with an example session
86 manager (pipewire-media-session) that you needed to disable and replace with
87 WirePlumber.
88
89 .. warning::
90
91 These instructions are only relevant to older versions of PipeWire
92
93 systemd
94 ^^^^^^^
95
96 In most cases, ``pipewire-media-session`` is started by a systemd service unit,
97 ``pipewire-media-session.service``.
98
99 To switch to WirePlumber, you will first need to disable that service:
100
101 .. code:: console
102
103 $ systemctl --user --now disable pipewire-media-session
104
105 ... and then, enable and use ``wireplumber.service`` in its place:
106
107 .. code:: console
108
109 $ systemctl --user --now enable wireplumber
110
111 pipewire.conf
112 ^^^^^^^^^^^^^
113
114 On some systems, ``pipewire-media-session`` is not started by systemd, but it
115 is started by pipewire itself via a configuration option in ``pipewire.conf``
116
117 To switch to wireplumber, you will need to edit
118 **/etc/pipewire/pipewire.conf** in an existing installation or
119 **src/daemon/pipewire.conf.in** in the PipeWire git tree
120 and change the appropriate line in the ``exec`` section:
121
122 .. code:: diff
123
124 --- /etc/pipewire/pipewire.conf.bak
125 +++ /etc/pipewire/pipewire.conf
126 @@ -204,7 +204,7 @@ context.exec = [
127 # but it is better to start it as a systemd service.
128 # Run the session manager with -h for options.
129 #
130 - #{ path = "/usr/bin/pipewire-media-session" args = "" }
131 + { path = "wireplumber" args = "" }
132 #
133 # You can optionally start the pulseaudio-server here as well
134 # but it is better to start it as a systemd service.
135
136 .. code:: diff
137
138 diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in
139 index bbafa134..16ef687b 100644
140 --- a/src/daemon/pipewire.conf.in
141 +++ b/src/daemon/pipewire.conf.in
142 @@ -220,7 +220,7 @@ context.exec = [
143 # but it is better to start it as a systemd service.
144 # Run the session manager with -h for options.
145 #
146 - @comment@{ path = "@media_session_path@" args = "" }
147 + { path = "wireplumber" args = "" }
148 #
149 # You can optionally start the pulseaudio-server here as well
150 # but it is better to start it as a systemd service.
151
152 This setup assumes that WirePlumber is *installed* on the target system.