Audio - Sawangg/dotfiles GitHub Wiki

In this section we're going to add audio to our system. We're going to setup a better way than pulseaudio using pipewire and wireplumber. For this to work properly, you must setup dinit user services first.

Packages

We're going to install these packages

doas pacman -S pipewire pipewire-dinit wireplumber wireplumber-dinit pipewire-alsa pipewire-jack

Once installed, let's enable our 2 user services with dinit (don't use DOAS). If you haven't setup dinit user services yet, follow this.

dinitctl enable pipewire
dinitctl enable wireplumber

Handle the lack of systemd and elogind

We need to disable some configs to support our systemd and elogind free system.

mkdir -p ~/.config/wireplumber/{bluetooth.lua.d,main.lua.d}
touch ~/.config/wireplumber/bluetooth.lua.d/80-disable-logind.lua

Then edit 80-disable-logind.lua and add

-- Disable arbitration of user allowance of bluetooth via D-Bus user session
bluez_monitor.properties["with-logind"] = false

And create ~/.config/wireplumber/main.lua.d/80-disable-dbus.lua with

-- 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

Exit your session and login. You should see all the services running using dinitctl list. If all the services are up and running, you should now have sound on your system!

Usefull commands

You can check all your sources and more using

wpctl status

You'll maybe want to change your default sink (input), you can do so using

wpctl set-default ID

To get your current volume, run

wpctl get-volume @DEFAULT_AUDIO_SINK@

More info here: https://wiki.archlinux.org/title/WirePlumber.

Media support

To be able to pause a media and more, we're going to install the playerctl package in the extra Arch Linux repository. If you don't have setup this repository yet, follow this.

doas pacman -S playerctl

Now you're able to use the playerctl commands such the pause command to pause the audio currently playing.

playerctl pause