Skip to content

Instantly share code, notes, and snippets.

@the-spyke
Last active May 3, 2025 13:52
Show Gist options
  • Save the-spyke/2de98b22ff4f978ebf0650c90e82027e to your computer and use it in GitHub Desktop.
Save the-spyke/2de98b22ff4f978ebf0650c90e82027e to your computer and use it in GitHub Desktop.
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

Install

Install WirePlumber as the session manager:

$ sudo apt install pipewire-media-session- wireplumber

Notice '-' at the end of 'pipewire-media-session'. This is to remove it in the same command, because 'wireplumber' will be used instead.

Start WirePlumber for your user:

$ systemctl --user --now enable wireplumber.service

Configure

ALSA

Install the ALSA plug-in:

$ sudo apt install pipewire-audio-client-libraries

And copy the config file from PipeWire docs (provided by the plug-in) into the ALSA configuration directory:

$ sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/

Check if you have other (like Pulse) configs in the /etc/alsa/conf.d/ installed by something else. You might want to remove them.

PulseAudio

Everything was done automatically by pipewire-pulse package, which should have been installed by wireplumber package as recommended. If not, install it yourself.

Bluetooth

Install the codecs and remove Bluetooth from PulseAudio, so it would be handled directly by PipeWire:

$ sudo apt install libldacbt-{abr,enc}2 libspa-0.2-bluetooth pulseaudio-module-bluetooth-

The supported codecs are SBC and LDAC.

Unfortunately, aptX and AAC are not supported because of patents and other technical reasons. aptX is available starting from 22.10 via libfreeaptx0 installed by default there (22.10 uses PipeWire by default as well). If you really need these codecs in 22.04 you may use this PPA from @aglasgall which is based on universe, but rebuilds pipewire with additional packages for aptX and AAC from multiverse. Read the discussion here.

Done

Reboot and check if it works by running:

$ LANG=C pactl info | grep '^Server Name'
@jentur-zabbeJ-8basdy
Copy link

Worked great for me on 22.04 and unbroke my RME Fireface 802 from capturing multitrack input, thanks!

@jentur-zabbeJ-8basdy
Copy link

This might help when bluetooth connects but has no audio (see bluez/bluez#157)

sudo systemctl stop bluetooth rm -rf /var/lib/bluetooth ## clear any profiles sudo systemctl start bluetooth

@jentur-zabbeJ-8basdy
Copy link

This might help when bluetooth connects but has no audio (see bluez/bluez#157)

sudo systemctl stop bluetooth rm -rf /var/lib/bluetooth ## clear any profiles sudo systemctl start bluetooth

@CourtJester011
Copy link

Attempting to install pipewire using this method took out my GUI and I'm not exactly sure how to fix it. I ended up having to use timeshift to restore it.

@CourtJester011
Copy link

The second command gave me to following error message:

sudo apt install \
  libspa-0.2-bluetooth \
  pipewire-audio-client-libraries \
  pipewire-media-session- \
  wireplumber
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libspa-0.2-bluetooth : Depends: libspa-0.2-modules (= 0.3.48-1ubuntu1) but 0.3.48-1ubuntu2 is to be installed
 pipewire-audio-client-libraries : Depends: pipewire (= 0.3.48-1ubuntu1) but 0.3.48-1ubuntu2 is to be installed
                                   Depends: libpipewire-0.3-0 (= 0.3.48-1ubuntu1) but 0.3.48-1ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

Running apt list -a showed the following:

pipewire/now 0.3.48-1ubuntu2 amd64 [installed,local]
pipewire/jammy 0.3.48-1ubuntu1 amd64

pipewire/jammy 0.3.48-1ubuntu1 i386

sudo apt install pipewire/jammy and installing pipewire's needed packages and configurations seemed to work except it took out my GUI on reboot. I ultimately had to use timeshift to restore to a previous environment. Any ideas as to why this happened?

@the-spyke
Copy link
Author

@CourtJester011 pipewire/now 0.3.48-1ubuntu2 amd64 [installed,local] It says local,which means the package is not found in current repos. Please check that your apt sources are configured properly for jammy and you don't have another PPA interfering.

@CourtJester011
Copy link

CourtJester011 commented Dec 8, 2022

Wanted to follow up as I found how to resolve my above issue:
Had to check additional packages and install with the /jammy option as there were package conflicts. Installing pipewire/jammy removed a number of packages which ended up breaking my gdm3 GUI. Next time I ran sudo apt install pipewire/jammy, I copied the package list that was to be removed and did research on them. This is what followed:
gdm3 install gdm3/jammy
gnome-shell gnome-shell/jammy
gnome-shell-extension-appindicator Leave alone
gnome-shell-extension-desktop-icons-ng install the /jammy version
gnome-shell-extension-ubuntu-dock install the /jammy version
gstreamer1.0-pipewire install /jammy
ubuntu-desktop /leave alone
ubuntu-desktop-minimal leave alone
ubuntu-release-upgrader-gtk /jammy
ubuntu-session leave alone
update-manager leave alone
update-notifier leave alone
Command I ran is as follows:

sudo apt install \
pipewire/jammy \
gdm3/jammy \
gnome-shell/jammy \
gnome-shell-extension-desktop-icons-ng/jammy \
libspa-0.2-bluetooth \
pipewire-audio-client-libraries \
pipewire-media-session- \
wireplumber

This fixed my issue with GUI becoming broken and I was able to follow the rest of this guide successfully without breaking my GUI.

Copy link

ghost commented Jan 8, 2023

Thank you everyone! Now I can use my Sony WH-1000XM4 for both listening to music and for Discord calls, and thanks @the-spyke for keeping the OP up to date.

@Danny3
Copy link

Danny3 commented Jan 21, 2023

This works on Debian 12 (Bookworm) too, except for the ALSA step.

BTW, is this for audio only?
Shouldn't the package "gstreamer1.0-pipewire" be installed too, like in this guide:
PipeWire on Ubuntu MATE 22.04
https://ubuntu-mate.org/blog/ubuntu-mate-kinetic-kudu-release-notes/

@the-spyke
Copy link
Author

@Danny3 The gstreamer1.0-pipewire is installed automatically on Ubuntu as PipeWire is used to record the screen by WebRTC

$ apt list --installed *pipewire*
gstreamer1.0-pipewire/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]
libpipewire-0.3-0/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]
libpipewire-0.3-common/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 all [installed,automatic]
libpipewire-0.3-modules/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]
pipewire-alsa/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]
pipewire-audio-client-libraries/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 all [installed]
pipewire-bin/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]
pipewire-jack/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]
pipewire-pulse/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed]
pipewire/kinetic,kinetic,kinetic,kinetic,now 0.3.58-2ubuntu1 amd64 [installed,automatic]

$ apt-rdepends -r gstreamer1.0-pipewire
gstreamer1.0-pipewire
  Reverse Depends: gnome-shell (>= 43.1-0ubuntu1)
  Reverse Depends: ubuntu-budgie-desktop (0.103)
  Reverse Depends: ubuntu-mate-core (1.285)
  Reverse Depends: ubuntu-mate-desktop (1.285)

@apomili
Copy link

apomili commented Mar 6, 2023

You saved my day! With Ubuntu 22.04 my bluetooth headphones did not stop making noise.

@AntonyOnScript
Copy link

thank you!!!

@driventub
Copy link

This should come out of the box, why it isn´t?

@aglasgall
Copy link

@driventub , as discussed in https://gist.github.com/the-spyke/2de98b22ff4f978ebf0650c90e82027e?permalink_comment_id=4321083#gistcomment-4321083, the relevant libraries have patent/IP problems and Ubuntu policy prevents packages in the base distribution ('main') from depending on them.

@alex-tikh
Copy link

After switching to Pipewire, did anyone get the mSBC codec (for a microphone) working out of the box?

I had only the CVSD codec and it's like going back in time. Fixed it with this guide
https://wiki.archlinux.org/title/PipeWire#Low_audio_quality_on_Bluetooth

/etc/wireplumber/bluetooth.lua.d/51-bluez-config.lua (or ~/.config/wireplumber/bluetooth.lua.d/51-bluez-config.lua)
bluez_monitor.properties = {
  ["bluez5.enable-sbc-xq"] = true,
  ["bluez5.enable-msbc"] = true,
}

@luispabon
Copy link

It worked for me out of the box yes when I installed it back in 22.04 without any tweaks, just installing packages and removing pulseaudio. I did a clean 22.10 install later on, which already comes with pw out of the box, and it also worked without any tweaks.

@n8-mills
Copy link

n8-mills commented Apr 5, 2023

I got "dummy output" in my audio after a clean Ubuntu install. Using HDMI to my TV. Tried this method, no change to the end result. pipewire-media-session wasn't installed and I did that, no change.

@the-spyke
Copy link
Author

@n8-mills pipewire-media-session is an outdated session manager that was replaced by WirePlumber and should not be installed. In the instruction we explicitly remove it. I don't have a TV, so I haven't tested HDMI sound. Try installing Helvum, maybe you just need to direct sound to the right place

@n8-mills
Copy link

n8-mills commented Apr 6, 2023

@n8-mills pipewire-media-session is an outdated session manager that was replaced by WirePlumber and should not be installed. In the instruction we explicitly remove it. I don't have a TV, so I haven't tested HDMI sound. Try installing Helvum, maybe you just need to direct sound to the right place

Helvum shows that I have no devices at all. lspci -vnn shows this, though:

01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] [1002:aab0]
Subsystem: Micro-Star International Co., Ltd. [MSI] Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] [1462:aab0]
Flags: bus master, fast devsel, latency 0, IRQ 28
Memory at fea60000 (64-bit, non-prefetchable) [size=16K]
Capabilities:
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel

I just did a whole new install an hour ago, the only thing I installed was VLC to test video files. I did the above process and installed helvum. Thoughts?

@the-spyke
Copy link
Author

@n8-mills Have you configured ALSA for PipeWire? My HDMI sinks are in-place, but I'm on 22.10:

$ wpctl status

Audio
 ├─ Devices:
 │      46. Alder Lake PCH-P High Definition Audio Controller [alsa]
 │  
 ├─ Sinks:
 │      49. Alder Lake PCH-P High Definition Audio Controller HDMI / DisplayPort 3 Output [vol: 1.00]
 │      50. Alder Lake PCH-P High Definition Audio Controller HDMI / DisplayPort 2 Output [vol: 1.00]
 │      51. Alder Lake PCH-P High Definition Audio Controller HDMI / DisplayPort 1 Output [vol: 1.00]
 │  *   52. Alder Lake PCH-P High Definition Audio Controller Speaker + Headphones [vol: 0.40 MUTED]

@n8-mills
Copy link

n8-mills commented Apr 6, 2023

That's likely it:

Audio
├─ Devices:
│ 40. Built-in Audio [alsa]

├─ Sinks:
│ * 33. Dummy Output [vol: 1.00]

I did the ALSA step above but maybe that didn't do anything

@the-spyke
Copy link
Author

@n8-mills Yeah, this doesn't looks right. Maybe some driver issue. I'm sorry, but I don't know how to help you. Try AskUbuntu.

@n8-mills
Copy link

n8-mills commented Apr 6, 2023

No worries, thx

@MasterCATZ
Copy link

lost my audio going to kernel 6 using SB X-Fi Surround 5.1 Pro

and assuming its pipewire related

how do I get my alsa working again for spdif / dts pass-through etc , all aslamixer see's now is the "Power LED"

http://alsa-project.org/db/?f=6c219de3b8530319df9d983ba25af87d94eaeb42

@aglasgall
Copy link

aglasgall commented Apr 16, 2023

I've rebuilt pipewire 0.3.65 from Lunar (23.04) with AAC re-enabled and uploaded them to the same PPA. Enjoy.

As a general rule, asking for help in this thread is only going to be productive if it's related specifically to these packages, Bluetooth audio, or the additional Bluetooth audio codecs enabled by these packages. Pipewire has been the default audio server on Ubuntu for several releases now and is supported through normal Ubuntu channels (e.g. Ubuntu's Discourse forum).

"Audio over HDMI doesn't work" is not something that could possibly have been caused by these packages; the only thing I changed was the set of shared libraries Pipewire is built against. If it's not related to Bluetooth audio SPECIFICALLY, I ask that you not post your requests for help here out of respect for what is already a very long thread.

@aglasgall
Copy link

Packages for lunar are now live, joining the ones for jammy and kinetic.

@Jeansen
Copy link

Jeansen commented Apr 18, 2023

I am on debian (unstable/sid). When I switched from pulse audio to wireplumber, I lost my bluetooth sound devices. 'wpctl status' only shows me the build-in audio device, but none of my BT devices. But in blueman I can see my audio device is connected and audio profiles are enabled. Anyway, it does not show as a sink.

My headset is a different story. I have to systemctl --user restart wireplumber.service to get them listed. But then, only low quality (hands free) profiles are available. I am a bit lost how to track this issue down to its root cause ... ;-(

Looks like some older :i386 packages were the culprits.... after removing them, it now works.

@aglasgall
Copy link

It is only going to be productive to ask for help here if you:

  1. are using Ubuntu jammy, kinetic, or lunar
  2. have installed the pipewire packages from my PPA (or are trying to)
  3. are now having problems with bluetooth audio via pipewire on your system

I am not a PW developer and have no particular insight into pipewire problems in general; there are much better general fora (e.g. the Ubuntu Discourse forum, AskUbuntu, the Debian mailing lists, heck, the Arch Linux wiki...) for getting help with them. I'm happy to share the results of the work I did to be able to have higher-quality audio via my Bluetooth earbuds on Linux and to help people who have problems with something I suggested they do, but I am decidedly not a subject matter expert in this area in general.

@robodan
Copy link

robodan commented Apr 21, 2023

Where does /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf come from?
My system (Pop_OS 22.04 with KDE desktop on amd64) doesn't have it.

apt list pipewire-doc
pipewire-doc/jammy,jammy,now 0.3.69168191103322.04~bb4229c all [installed]

@the-spyke
Copy link
Author

the-spyke commented Apr 21, 2023

@robodan Hm, it came from pipewire-audio-client-libraries. If you don't use JACK, you could install just pipewire-alsa and copy the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment