#### Beyond Linux® From Scratch (System V Edition) - Version 12.3

### Chapter 42. Multimedia Libraries and Drivers

- Prev

  v4l-utils-1.28.1

- Next

  x264-20250212

- Up
- Home

# Wireplumber-0.5.8

## Introduction to Wireplumber

The Wireplumber package contains a session and policy manager for Pipewire.

This package is known to build and work properly using an LFS 12.3 platform.

### Package Information

- Download (HTTP): https://gitlab.freedesktop.org/pipewire/wireplumber/-/archive/0.5.8/wireplumber-0.5.8.tar.bz2

- Download MD5 sum: a2cbfe6885da8dcbeacbba05f62bcf67

- Download size: 412 KB

- Estimated disk space required: 89 MB (with tests)

- Estimated build time: 0.3 SBU (with tests)

### Wireplumber Dependencies

#### Required

elogind-255.17, GLib-2.82.5, and pipewire-1.2.7

#### Recommended

Lua-5.4.7

#### Optional

Doxygen-1.13.2, lxml-5.3.1, sphinx-8.2.1, sphinx_rtd_theme-3.0.2, and Breathe

## Installation of Wireplumber

Install Wireplumber by running the following commands:

    mkdir build &&
    cd    build &&

    meson setup --prefix=/usr --buildtype=release -D system-lua=true .. &&
    ninja

To test the results, issue: ninja test.

Now, as the `root` user:

    ninja install

Finally, rename the documentation directory to a versioned directory as the `root` user:

    mv -v /usr/share/doc/wireplumber{,-0.5.8}

## Command Explanations

`--buildtype=release`: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

`-D system-lua=true`: This switch enables using the system version of Lua. Omit this switch if you have not installed Lua, but note that meson will download and install it's own version.

## Configuring Wireplumber

### Configuration Information

In order for Wireplumber to be used by Pipewire, Wireplumber and Pipewire must be configured to start when a desktop environment is started.

Pipewire now provides it's own Pulseaudio server implementation, which causes runtime conflicts with the server provided by Pulseaudio itself. This generally presents itself by applications hanging or malfunctioning when trying to play or record audio and video. First, prevent Pulseaudio from starting it's own server implementation by running the following commands as the `root` user:

    rm -vf /etc/xdg/autostart/pulseaudio.desktop         &&
    rm -vf /etc/xdg/Xwayland-session.d/00-pulseaudio-x11 &&
    sed -e '$a autospawn = no' -i /etc/pulse/client.conf

Next, create a shell script that will start Wireplumber and Pipewire in the correct order as the `root` user:

    cat > /usr/bin/pipewire-launcher.sh << "EOF"
    #!/bin/sh
    # Begin /usr/bin/pipewire-launcher.sh

    # First, kill any previous instances of pipewire, wireplumber, or pipewire-pulse
    # that are running. Multiple instances of the daemon can not be run at the same
    # time, and this helps prevent possible errors if a user logs out or logs in
    # too fast, and restores audio if Pipewire hangs and needs to be reset.

    pkill -u ${USER} -fx /usr/bin/pipewire-pulse
    pkill -u ${USER} -fx /usr/bin/wireplumber
    pkill -u ${USER} -fx /usr/bin/pipewire

    # Start Pipewire first.
    exec /usr/bin/pipewire &

    # Next, we need to wait until pipewire is up before starting wireplumber.
    # This prevents a possible race condition where pipewire takes too long
    # to start, as some users have run into.
    while [ $(pgrep -f /usr/bin/pipewire) = "" ]; do
       sleep 1
    done

    # Start Wireplumber now that Pipewire has been started.
    exec /usr/bin/wireplumber &

    # Start the Pulseaudio server included with Pipewire.
    exec /usr/bin/pipewire-pulse &

    # End /usr/bin/pipewire-launcher.sh
    EOF

Next, make this shell script executable as the `root` user:

    chmod +x /usr/bin/pipewire-launcher.sh

Finally, create an XDG Autostart file that will run /usr/bin/pipewire-launcher.sh when a desktop environment is started, as the `root` user:

    cat > /etc/xdg/autostart/pipewire.desktop << "EOF"
    [Desktop Entry]
    Version=1.0
    Name=Pipewire
    Comment=Starts the Pipewire and Wireplumber daemons
    Exec=/usr/bin/pipewire-launcher.sh
    Terminal=false
    Type=Application
    EOF

Now that Wireplumber is configured to start when a desktop environment is started, it is recommended that you log out of your session and log back in again.

## Contents

Installed Programs: wireplumber, wpctl, and wpexec
Installed Libraries: libwireplumber-0.5.so
Installed Directories: /usr/include/wireplumber-0.5, /usr/lib/wireplumber-0.5, /usr/share/wireplumber, and /usr/share/doc/wireplumber-0.5.8

### Short Descriptions

wireplumber | is a session and policy manager for Pipewire
wpctl | controls and queries information from Wireplumber
wpexec | executes Wireplumber scripts, which are often written in Lua
`libwireplumber-0.5.so` | contains functions that allow other programs to control Wireplumber

- Prev

  v4l-utils-1.28.1

- Next

  x264-20250212

- Up
- Home