28

As Ubuntu 21.04 includes pipewire for video streams and screen sharing by default, I am wondering whether or not it is possible to replace pulseaudio completely with pipewire.

David
  • 2,101
  • 13
  • 16
  • 25
user5950
  • 6,186

4 Answers4

37

Yes indeed, this is possible and fairly simple, just follow the steps described in the Debian docs:

First install the pipewire-audio-client-libraries package.

sudo apt install pipewire-audio-client-libraries

Create this empty file:

touch /etc/pipewire/media-session.d/with-pulseaudio

Create a pipewire-pulse service by copying the example files:

cp /usr/share/doc/pipewire/examples/systemd/user/pipewire-pulse.* /etc/systemd/user/

Run these three commands as your regular user (not as root):

// Check for new service files with:
systemctl --user daemon-reload
// Disable and stop the PulseAudio service with:
systemctl --user --now disable pulseaudio.service pulseaudio.socket
// Enable and start the new pipewire-pulse service with:
systemctl --user --now enable pipewire pipewire-pulse

You can check which server is in use by, as your regular user, running:

pactl info | grep '^Server Name'

If it's using PipeWire, the server name will be "PulseAudio (On PipeWire 0.3.19)"

To makeit work I had to "mask" the PulseAudio service by running:

systemctl --user mask pulseaudio

And then restarting the PipeWire services:

systemctl --user restart pipewire pipewire-pulse

This will block the PulseAudio service from being activated outright. If you wish to restore previous functionality, you'll need to run the same command again with the "unmask" action.

user5950
  • 6,186
  • Arch has a package which does essentially this. It's surprising Debian haven't done it a in a similar fashion. – muru Apr 23 '21 at 15:45
  • Do not forget to install libspa-0.2-bluetooth or your bluetooth devices will fail to connect with "Protocol not available" – heeen Nov 11 '21 at 11:11
  • Note that on Ubuntu 21.10 I had to apt install pipewire-pulse to get this going. – logidelic Feb 11 '22 at 14:52
14

Arch User Here. But love PipeWire. Under all debian/Ubuntu {18..21}.{04,10} Version of PW is too old. That's why I am maintaining a PPA which will provide latest build of PipeWire(15-16 days of release cycle). You can track latest change on github for this PPA.

On arch linux this process is obtained by {pre,post}_{install,upgrade,remove} function under package's *.install file.

And under Ubuntu/Debian It will be achieved by some simple {pre,post}{inst,rm} scripts. I will be updated these in next release definitely. This Already had been done.

EDIT 1 -
For a detailed Installation instructions Please follow github wiki.

With PipeWire I am also packaging blueman-git (git version of blueman). It has some serious needed feature to work with PipeWire. Don't worry it also will not break anything but increase your productivity upto a level higher.

EDIT 2 -
The Launchpad PPA will work under All debian/ubuntu based distros. Don't worry! install it, test it and file bugs to upstream to help it's developers to make PipeWire even more better.

EDIT 3 -
Now PipeWire 0.3.27 and on wards will support under debian/ubuntu 18.04 also.

  • Thank you, nice work. For some reason I dont have the example file systemd/user/pipewire-pulse.* after installing this, any idea? – Vijay Prema May 01 '21 at 01:36
  • 2
    OK dont worry, I got it working after following the instructions on your github rather than whats posted above here. – Vijay Prema May 01 '21 at 01:43
  • This is the correct answer. Follow GitHub instructions and voila. – Jesús Fuentes May 07 '21 at 11:59
  • This is a positive development! Does this work with Linux Mint 20.1? – mcarans May 14 '21 at 03:43
  • @mcarans Yes, It will work on all debian/ubuntu based distros. Linux Mint 20.1 also work with the PPA. – Sourav Das May 15 '21 at 04:42
  • 1
    Too old for what? Is it buggy, or missing features, or outright doesn't work? (What does one get in exchange for adding a third party PPA instead of using the Ubuntu-sanctioned package?) – unhammer Sep 13 '21 at 07:49
  • I didn't understand the blueman-git installation step (I am quite newbie in linux). Should I install the PipeWire OR the blueman-git? I have blueman here, the apt install one. – Henrique Bruno Oct 21 '21 at 22:37
  • this is a life saver contribution! thanks, just follow the instruction till the end – diramazioni Oct 26 '21 at 15:08
8

On Ubuntu 21.10

First install the missing PipeWire packages:

sudo apt install pipewire-pulse pipewire-audio-client-libraries

If you want bluetooth audio to work you also need to install:

sudo apt install libspa-0.2-bluetooth

After that feel free to disable pulseaudio and enable PipeWire running theses commands (without root):

// Disable and stop the PulseAudio service with:
systemctl --user --now disable pulseaudio.service pulseaudio.socket
// Enable and start the new pipewire-pulse service with:
systemctl --user --now enable pipewire pipewire-pulse

And that's it! You can confirm everything worked by running:

pactl info | grep '^Server Name'

The output should be similar to this:

Server Name: PulseAudio (on PipeWire 0.3.32)

Restart Pipewire services

systemctl --user restart pipewire pipewire-pulse

Karol Wasowski
  • 190
  • 1
  • 10
-2

You need to edit: /etc/pipewire/media-session.d/media-session.conf

And un-comment at least alsa-monitor under session.modules.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83