# Void Linux! And getting the sound to work This is a tutorial on how to make Pipewire work on Void Linux. ## Prerequisite What you'll need to install: ``` xbps-install dbus pipewire wireplumber elogind turnstile psmisc ``` Make sure you do not have anything else start pipewire, for example if you have your desktop environment configured to autostart pipewire, turn that off. Alternatively, you can remove every .desktop file that starts pipewire or wireplumber in `~/.config/autostart` or `/etc/xdg/autostart` If you configured your window manager to start pipewire with a command in the config, comment out or delete that too. Basically make sure pipewire doesn't autostart by any other means ## Configuring turnstile What is turnstile for? Turnstile makes user services work on non-systemd distros such as Void. This is important for dbus and pipewire to work Change the following option in the config to "no": `/etc/turnstile/turnstiled.conf` ``` manage_rundir = no ``` This option is already in the config so don't add it yourself and use the search function in your text editor to find it ## Enabling the user services Ensure these system services are running: ``` ln -s /etc/sv/dbus /etc/sv/turnstiled /var/service ``` You'll need to logout and log back in to make turnstile create this directory: `~/.config/service/turnstile-ready` and then create a file with the following contents: `~/.config/service/turnstile-ready/conf` ``` core_services="dbus" ``` Make sure these directories exist: ``` mkdir -p ~/.config/service/dbus ~/.config/service/pipewire ~/.config/pipewire/pipewire.conf.d ``` Then link these files: ``` ln -s /usr/share/examples/turnstile/dbus.run ~/.config/service/dbus/run ln -s /usr/share/examples/turnstile/dbus.check ~/.config/service/dbus/check ln -s /usr/share/examples/wireplumber/10-wireplumber.conf ~/.config/pipewire/pipewire.conf.d ln -s /usr/share/examples/pipewire/20-pipewire-pulse.conf ~/.config/pipewire/pipewire.conf.d ``` What are these files for? Linking the first two files will make the user dbus service work. Last two are for making the pipewire service run Now you'll have to create two scripts for the pipewire user service to work: `~/.config/service/pipewire/run` ``` #!/bin/sh exec chpst -e "$TURNSTILE_ENV_DIR" pipewire ``` `~/.config/service/pipewire/finish` ``` #!/bin/sh killall pipewire wireplumber ``` And of course make sure those scripts are executable: ``` chmod 744 ~/.config/service/pipewire/run ~/.config/service/pipewire/finish ``` Pipewire needs to have certain variables for it to work, they are typically provided by your desktop or window manager Turnstile has a command to add these variables to pipewire: ``` turnstile-update-runit-env WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP ``` You should make this command run after your environment starts. For example, if you're using a window manager, then you should put that command in your config ## Managing the services To manage the dbus and pipewire services you can use this command: ``` SVDIR=~/.config/service sv ``` You can create an alias for it, mine is "usv": ``` alias usv='SVDIR=~/.config/service sv' ``` You can use the start, stop, restart and check subcommands to do the respective actions, for example: ``` usv restart pipewire ``` And that's it, pipewire should work now! Hope this helps :3