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'
@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.

@robodan
Copy link

robodan commented Apr 27, 2023

@the-spyke Thanks for following up. I install Ubuntu 23.04 from scratch and now everything just works. Pipewire has replaced pulseaudio at that point.

@pkit
Copy link

pkit commented May 10, 2023

Nice guide, everything works! But no sound, lol.
Probably need to wait till bugs are fixed in piperwire...

@JoseAP89
Copy link

sudo apt -y install wireplumber && systemctl --user enable --now wireplumber.service

I did everything, including that and still I have only the dummy output in output sound and nothing shows on input sound device, for ubuntu 22.04.

@starapple2
Copy link

starapple2 commented May 27, 2023

This guide is the only complete instruction I have found to enable PipeWire on Ubuntu 22.04. All the others leave out a step. [(https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/)]

@MasterCATZ
Copy link

This guide is the only complete instruction I have found to enable PipeWire on Ubuntu 22.04. All the others leave out a step. [(https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/)]

I think that is the one I followed when mine started working as well

@xlabd
Copy link

xlabd commented Jun 13, 2023

This guide is the only complete instruction I have found to enable PipeWire on Ubuntu 22.04. All the others leave out a step. https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/

This worked for me. 👍

@the-spyke
Copy link
Author

@starapple2 @MasterCATZ @xlabd It is identical. I don't include JACK because it's used only by sound producers.

@Rintse
Copy link

Rintse commented Jun 28, 2023

For me, the conf files that the above guide says should come from pipewire-alsa, came from pipewire-audio-client-libraries. Besides copying the ALSA conf from there, I also had to remove some pulseaudio ALSA conf files that were in the same directory, since they had equal priority (99-...)

@the-spyke
Copy link
Author

@Rintse pipewire-audio-client-libraries is a metapackage which installs 2 other packages: pipewire-alsa and pipewire-jack. In the history you may see that in the past it was in this gist as well, until I removed JACK because only few people use it. Removing ALSA config is not on Debian wiki and PipeWire worked for me without that even on 21.10. I have no idea where your config is coming from.

@Rintse
Copy link

Rintse commented Jun 28, 2023

@Rintse pipewire-audio-client-libraries is a metapackage which installs 2 other packages: pipewire-alsa and pipewire-jack. In the history you may see that in the past it was in this gist as well, until I removed JACK because only few people use it. Removing ALSA config is not on Debian wiki and PipeWire worked for me without that even on 21.10. I have no idea where your config is coming from.

I mention this because pipewire-alsa is not found by my apt (unable to locate package), whereas the metapackage is.

I also have no idea where those configs came from, but I never really did anything with my audio config, so perhaps others have the same issue.

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