A couple of days back, I received an email from one of my readers, and he asked me to help him because he was not able to install PipeWire on his Debian distribution by following the steps which were specifically written for Ubuntu and Ubuntu-based distributions and not for Debian because the installation steps are slightly different in both distributions.
And that’s the reason he was not able to install PipeWire on his system.
If you are also facing some problems during installation or you want to ditch PulseAudio and experience PipeWire, then your favourite search engine has redirected you to the right place where you will learn how to install PipeWire on Debian along with steps to revert.
So, without wasting your time, open your terminal and execute the command as per the given sequence.
Install or Enable PipeWire on Debian 11
According to the official documentation, you will find that PipeWire is installed on your system, especially on Debian 10, 11, and 12, but it will not be in an active state to be used on your system.
So in order to make PipeWire the default audio service, you will need to make some changes to your system, which will enable and replace the PulseAudio server with PipeWire.
Before that, let me confirm whether PipeWire is installed or not. To check that, you can use the apt policy
command, which will show you the required applications and dependencies that are already installed, as in the below-attached image.
Also read: How to use APT Package Manager with Examples
Prior to that, execute the below code:
$ sudo apt policy pipewire pipewire-audio-client-libraries
The behaviour of the above command
Check PipeWire application is installed
For any reason, if the above utilities are not present on your system, then do copy and paste the below code into your terminal window to start the installation.
$ sudo apt install pipewire pipewire-audio-client-libraries
Replace PulseAudio with a PipeWire server on Debian
Once you are aware of the required applications and libraries being installed on your system, then you are bound to replace PulseAudio with PipeWire by invoking the following commands.
Step 01: Create an empty file
So first of all, create an empty file in /etc/pipewire/media-session.d using the below command:
$ sudo touch /etc/pipewire/media-session.d/with-pulseaudio
Step 02: Create a pipewire-pulse service
After that, create a pipewire-pulse service by copying the example files from /usr/share/doc/pipewire/examples/systemd/user/pipewire-pulse.* has two different files, pipewire-pulse.service and pipewire-pulse.socket, to /etc/systemd/user/ to manage them using the systemctl
command.
$ sudo cp /usr/share/doc/pipewire/examples/systemd/user/pipewire-pulse.* /etc/systemd/user/
Step 03: Reload the daemon file
Once the above step is performed successfully, execute the below command, which will reload the new service that we have created just now.
$ systemctl --user daemon-reload
Step 04: Disable PulseAudio service
After that, execute the below code to disable the currently running PulseAudio service.
$ systemctl --user --now disable pulseaudio.service pulseaudio.socket
The behaviour of the above command
Disable PulseAudio service in Debian 11
Step 05: Enable and start the PipeWire service:
Once you have disabled the PulseAudio server, execute the below code, which enables and starts the pipewire-pulse service.
$ systemctl --user --now enable pipewire pipewire-pulse
The behaviour of the above command
Enable PipeWire on Debian 11
Verify Changes
After following the above steps, your system is now fully configured to use PipeWire over to PulseAudio, but how do I know whether my system is using PulseAudio or PipeWire? It is pretty simple to execute the pactl info
command, which will list out the server name.
$ pactl info
Debian 11 using PipeWire
Persist Changes even after Reboot
As of now, your system is currently using PipeWire, but once you restart your computer, it will automatically change the current audio server to PulseAudio, which means you have to manually enable PipeWire every time you restart your computer, which is not acceptable at all for anyone.
To prevent this kind of situation, you can mask the pulseaudio.service which will disable the PulseAudio service to use by default.
To make these changes permanent, execute the below code:
$ systemctl --user mask pulseaudio
After executing the above command, restart your system to implement the new changes.
$ sudo reboot
Replace PipeWire with PulseAudio server on Debian
Currently, PipeWire is not reliable to use as the default audio service, and even the official guide does not suggest you use PipeWire as a default audio service, which may give you unexpected results.
As per Simon McVittie, “This is not a supported scenario for Debian 11, and is considered experimental.”
It may break certain applications, lack certain functionality, or not work at all.
If you too face any kind of audio issue while using it, then you can follow the below steps, which will disable the PipeWire and enable the PulseAudio back.
Step 01: Unmask PulseAudio
If you have masked the PulseAudio server in the above step, then don’t forget to unmask it first. Otherwise, subsequent commands will throw an error.
$ systemctl --user unmask pulseaudio
Step 02: Disable PipeWire
After that, you can execute the below code to stop PipeWire.
$ systemctl --user --now disable pipewire pipewire-pulse
Step 03: Enable PulseAudio
Lastly, run the final command which will enable the PulseAudio service to be used as normal.
$ systemctl --user --now enable pulseaudio.service pulseaudio.socket
The behaviour of the above command
Enable PulseAudio
Step 04: Check Status
Once the above command is performed successfully execute pactl info
command to check audio server if the output display the “pulseaudio” as a server name, then you are work is completed here.
PipeWire to PulseAudo
And for any reason, if you get an error like “Connection failure: Connection refused pa_context_connect() failed: Connection refused”, then, first of all, try to restart your system, and even if that doesn’t get fixed, then you can comment down your query below. We will be happy to give you a hand.
Till then, I’m signing off!
A man with a tech effusive who has explored some of the amazing technology stuff and is exploring more. While moving towards, I had a chance to work on Android development, Linux, AWS, and DevOps with several open-source tools.