202.4. wireplumber-0.5.17
PipeWire's session manager — device policy, routing and Bluetooth profiles
| Version | 0.5.17, release 1 |
| Shelf | audio-io — The sound stack: ALSA, PipeWire and WirePlumber, PulseAudio client, and portable audio I/O APIs |
| Phase | 42_graphics (Graphics Stack), 57 of 189 in build order |
| Licence | MIT |
| Homepage | https://pipewire.pages.freedesktop.org/wireplumber/ |
| Build time | 0.8 SBU |
| Installed size | 2.1 MiB in 164 files |
| Recipe | ports/core/audio-io/wireplumber/kpkgbuild |
About
WirePlumber is PipeWire’s session manager: the policy half of the audio stack. It finds sound cards, cameras and Bluetooth devices and creates their nodes, decides which sink or source a new stream is linked to, picks a Bluetooth headset’s profile, and remembers and restores volumes. Its policy is written in Lua scripts run by an embedded Lua interpreter. pipewire is built with no session manager of its own, and its daemon routes nothing without one, so on KDOS WirePlumber is what makes sound work at all. The session starts it right after pipewire and before pipewire-pulse; see Audio.
Why it is in KDOS
The comment above it in script/phases/42_graphics/packages.d/audio-io.txt:
PipeWire builds no session manager of its own, and the daemon routes nothing without one: device discovery, which sink a stream lands on and a headset's profile are all policy. media-session, its old in-tree example, is dead upstream.
Sources
wireplumber-0.5.17.tar.bz2(521.0 KiB)
sha256c50988232457858e14ecb95ebc9f552df7780f0049d5633f957e82675ae5f05f
upstream: https://gitlab.freedesktop.org/pipewire/wireplumber/-/archive/0.5.17/wireplumber-0.5.17.tar.bz2
archive copy: sources-1/audio-io--wireplumber-0.5.17.tar.bz2
Dependencies
Depends on: meson, ninja, pipewire, glib, lua, elogind.
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install wireplumber'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/audio-io/wireplumber.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/audio-io/wireplumber
echo 'c50988232457858e14ecb95ebc9f552df7780f0049d5633f957e82675ae5f05f wireplumber-0.5.17.tar.bz2' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/wireplumber
SRC=$SRC_ROOT/wireplumber-0.5.17
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wireplumber-0.5.17.tar.bz2 -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
--buildtype=release \
-Dsystem-lua=true \
-Dsystem-lua-version=5.5 \
-Delogind=enabled \
-Dsystemd=disabled \
-Ddoc=disabled \
-Dtests=false \
-Dintrospection=disabled
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
The switches, and why each is set:
-Dsystem-lua=true— Link the tree’s lua instead of building the copy of Lua upstream bundles as a meson subproject and links statically, which would put a second Lua on the image and needs a subproject the offline build does not fetch.-Dsystem-lua-version=5.5— Look for Lua 5.5 by name, through thelua5.5.pcthe lua port installs, and stop the configure step if it is missing. Left atauto, upstream tries 5.5, 5.4 and 5.3 in turn and builds against the first it finds, so a missing 5.5 would give a WirePlumber linked to an older Lua with no error.-Delogind=enabled— Buildlibwireplumber-module-logindagainst elogind’slibelogind. It reports whether the user running WirePlumber has the active session on a seat, and the Bluetooth monitor follows it: with seat monitoring on, which is upstream’s default, Bluetooth audio devices are taken by the user at the machine and released when that user’s session goes to the background, so after a user switch the headset moves to the session now in front.enabledmakes a missing elogind a setup error, whereautowould turn the module off without a word.-Dsystemd=disabled— No systemd units and nolibsystemd; KDOS has no systemd, and logind comes from elogind through the flag above.-Ddoc=disabled— Build no documentation.-Dtests=false— Build no test suite.-Dintrospection=disabled— Generate no GObject introspection bindings forlibwireplumber.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/wireplumber, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf wireplumber-0.5.17-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/wireplumber, and runs the triggers its paths call for.
Contents
Installed programs: wireplumber, wpctl, wpexec.
Installed libraries: libwireplumber-0.5.so.
Installed directories: /usr/include/wireplumber-0.5, /usr/lib/wireplumber-0.5, /usr/share/doc/wireplumber, /usr/share/licenses/wireplumber, /usr/share/wireplumber.
Short descriptions
wireplumber-0.5.pc |
wireplumber: wireplumber-0.5 |
Notes
kdos-oomd, the KDOS daemon that chooses what to kill when memory runs out, protects some processes by name, and names wireplumber on its own: the pipewire prefix that covers pipewire and pipewire-pulse does not match it, and killing it leaves a running graph with nothing routed. See Daemons.