Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Guide: Getting Wireplumber to work without D-Bus (Read 2426 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Guide: Getting Wireplumber to work without D-Bus

Had some struggles getting Wireplumber and Pipewire to properly behave on my laptop running greetd (which launches sway via a script) after an update to Wireplumber a few months ago. Finally got off my butt to find out why that was and thought it might be useful to share in-case other people are suffering like I was.

The Problem: Wireplumber added configuration options which assume the system is running in environment where D-Bus is available, these were largely undocumented until a later commit. They are part of the lua configuration files which are a bit of a funky system where you can override certain parts of the configs by changing them in a file with a later number than the one who first initialized them.

Solution: Adding two configuration files under $HOME/.config/wireplumber/ disabling the D-Bus requiring options.

  • Create the config file directories:
    Code: [Select]
    mkdir -p ~/.config/wireplumber/{bluetooth.lua.d,main.lua.d}
  • Disable user arbitration logind functionality for bluetooth by adding a file under the newly created bluetooth.lua.d directory called for example 80-disable-logind.lua[1]
    Code: [Select]
    touch ~/.config/wireplumber/bluetooth.lua.d/80-disable-logind.lua
    which should contain:
    Code: [Select]
    -- Disable arbitration of user allowance of bluetooth via D-Bus user session
    bluez_monitor.properties["with-logind"] = false
  • Disable flatpak portal and reserving devices via D-Bus user session by adding a file under ~/.config/wireplumber/main.lua.d  directory called for example 80-disable-dbus.lua[2]
    Code: [Select]
    touch ~/.config/wireplumber/main.lua.d/80-disable-dbus.lua
    which should contain:[3]
    Code: [Select]
    -- Disable reserving devices via D-Bus user session
    alsa_monitor.properties["alsa.reserve"] = false
    -- Disable use of flatpak portal integration
    default_access.properties["enable-flatpak-portal"] = false

To verify that the configuration files are loaded you can start wireplumber in the following way:
Code: [Select]
WIREPLUMBER_DEBUG=4 wireplumber
and search for the m-lua-scripting section to see if your newly created files are loaded.

Code: [Select]
...
I 13:53:14.673581    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/00-functions.lua
I 13:53:14.673716    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/20-default-access.lua
I 13:53:14.673775    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/30-alsa-monitor.lua
I 13:53:14.673839    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/30-libcamera-monitor.lua
I 13:53:14.673904    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/30-v4l2-monitor.lua
I 13:53:14.673953    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/40-device-defaults.lua
I 13:53:14.674027    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/40-stream-defaults.lua
I 13:53:14.674086    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/50-alsa-config.lua
I 13:53:14.674159    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/50-default-access-config.lua
I 13:53:14.674218    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/50-libcamera-config.lua
I 13:53:14.674268    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/50-v4l2-config.lua
I 13:53:14.674319    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /home/curious/.config/wireplumber/main.lua.d/80-disable-dbus.lua
I 13:53:14.674359    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/main.lua.d/90-enable-all.lua
...
I 13:53:14.677784    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/bluetooth.lua.d/00-functions.lua
I 13:53:14.677874    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/bluetooth.lua.d/30-bluez-monitor.lua
I 13:53:14.677928    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/bluetooth.lua.d/50-bluez-config.lua
I 13:53:14.678003    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /home/curious/.config/wireplumber/bluetooth.lua.d/80-disable-logind.lua
I 13:53:14.678048    m-lua-scripting ../wireplumber/modules/module-lua-scripting/api/config.c:104:load_file: loading config file: /usr/share/wireplumber/bluetooth.lua.d/90-enable-all.lua
D 13:53:14.678163    m-lua-scripting ../wireplumber/modules/module-lua-scripting
...

Once you have verified it works you can simply start wireplumber on login either by adding to your .xinitrc, sway config or wherever else you launch programs on login.

Hope this helps! <3
It is important the file starts with a number larger than 40 and less than 90.
Same naming rules apply to this one as the other config file.
The minimal config you need to get going is to disable the alsa.reserve option.