Skip to content

Instantly share code, notes, and snippets.

@the-spyke
Last active July 10, 2025 10:25
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'
@aglasgall
Copy link

@eygraber , the PPA only works for distributions that I have built packages for; this is something I maintain in my spare time on a best effort basis. I had not built and uploaded packages for 24.04 because I did not have time.

I have uploaded pipewire packages for 24.04 with AAC enabled; they will be available for install sometime in the next hour.

The latest Ubuntu Pipewire packages do have AptX enabled already; if aptx doesn't show up as a codec option it is because your headset does not support it.

@eygraber
Copy link

@aglasgall thank you!

To clarify, I understood the PPA wouldn't work until you got to updating it. I hope that didn't come across as complaining that it wasn't available yet.

I think my headset supports AptX, so I have more digging to do. Might just do a fresh install after struggling with this for years.

@aglasgall
Copy link

Packages for 24.04 ("Noble Numbat") are up now.

@tectrixdev
Copy link

can anyone please help me undoing this because it broke everything, i fixed it mostly, mic is now working and outpouting sound but i can't connect to my bluethooth speaker anymore pleae help me uninstall pipewire and use pulseaudio again

@wokawoka
Copy link

wokawoka commented Jul 1, 2024

Packages for 24.04 ("Noble Numbat") are up now.

I added your PPA and updated the relevant packages but LDAC and aptX codecs are not showing up for my headphones (they sopport that codecs since they correctly work on other machines and on my phone).
Is there something else I am supposed to do or that I am missing?
I' m running Kubuntu 22.04 LTS
@aglasgall Thank you very much for the very useful job you are doing and for sharing it with us!

@punit-arya
Copy link

Just wanted to thank you, @aglasgall, for maintaining the repo for Ubuntu 22.04. I've aptX now.

@m-aar-ten
Copy link

m-aar-ten commented Jul 12, 2024

@jojommeke can anyone please help me undoing this because it broke everything, i fixed it mostly, mic is now working and outpouting sound but i can't connect to my bluethooth speaker anymore pleae help me uninstall pipewire and use pulseaudio again

I am having the exact same problem, except my mic is also not working anymore.
Does anyone has any idea how to undo the installation steps?

EDIT: ended up fixing it with the following steps: https://askubuntu.com/questions/1520346/aux-port-internal-speakers-and-usb-dac-not-working/1520958#1520958

@Fly2Sirius
Copy link

Fly2Sirius commented Jul 12, 2024

I think one important thing that author haven't mentioned enough is:

REMOVE all PulseAudio related packages from your Ubuntu 22 OS.
sudo apt list -i PulseAudio
sudo apt remove ...

Anyway, with this guide, I fixed my issue about bluetooth headphone A2DP not automatically enabled.

@senthilskm983
Copy link

senthilskm983 commented Jul 26, 2024

After I did everything in my system, audio devices showed "Dummy output", after long battle I found it was because of permission issue.

● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-07-26 15:42:57 CEST; 3min 9s ago
TriggeredBy: ● pipewire.socket
   Main PID: 10061 (pipewire)
      Tasks: 2 (limit: 37885)
     Memory: 7.4M
        CPU: 166ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─10061 /usr/bin/pipewire

Jul 26 15:42:57 PF36MC4L systemd[10052]: Started PipeWire Multimedia Service.
Jul 26 15:42:57 PF36MC4L pipewire[10061]: ALSA lib conf.c:4096:(config_file_open) cannot access file /etc/alsa/conf.d/99-pipewire-default.conf

so basically when I copied the configuration file using sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/ it ended up like '-rw-r----- 1 root root 226 Jul 26 14:50 99-pipewire-default.conf'

so change permission using below command
sudo chmod 644 /etc/alsa/conf.d/99-pipewire-default.conf

@HenkBonk
Copy link

I'm running Ubuntu 22.04 LTS .

I did all the instructions listed before the messages here :

Everything seems to be working, until I tried PulseEffects, from which I'm only using the Equalizer :
It doesn't work, but that was also the case before I changed over to pipewire,
actually since I installed 22.04 LTS it doesn't work anymore .

I hoped it would work again after changing over ...

anyone some suggestions ?

Thanks in advance .

@the-spyke
Copy link
Author

@HenkBonk I don't use PulseEffects, so could not help you. For Pipewire there is a replacement: https://github.com/wwmm/easyeffects

@victormrdc
Copy link

SOLVED my issue with Ad2p not beeing present (I previously had only sBMC availble) 🔥 Now Ad2p with AAC is working well, thanks everyone :)

Did not work

forgetting the device, repairing

worked

sudo cp -r /var/lib/bluetooth /var/lib/bluetooth_BACKUP
sudo systemctl stop bluetooth
sudo rm -rf /var/lib/bluetooth/*
sudo systemctl start bluetooth
sudo reboot

then re-pair the device


Ty buddy, thats the only thing that workd
My BT is not finding any devices, now it works!

@aglasgall
Copy link

I have uploaded pipewire packages with AAC enabled for Ubuntu 24.10 "oracular" to my PPA. They should work.

@vschroeter
Copy link

I did this a while ago for Ubuntu 24.04 on a Raspberry Pi 5 and summarised the steps here:
https://gist.github.com/vschroeter/2fba1ca3dae52992d919dbf83411ebbb

@Mohit2917
Copy link

working, thanks buddy

@elmagio
Copy link

elmagio commented May 3, 2025

I have uploaded pipewire packages with AAC enabled for Ubuntu 24.10 "oracular" to my PPA. They should work.

It seems like the Oracular package is not provided anymore?

image

@ashl1
Copy link

ashl1 commented May 14, 2025

@elmagio Looks like Oracular EoL is July 2025, so only two and half months are left. I think it'll be better to rollback for LTS 24.04 Noble or upgrade to the newest 25.04 Plucky. Anyway you would choose the way you're opt in the next 3 months

@the-spyke
Copy link
Author

Looks like AAC will be enabled by default in Ubuntu 25.10: https://bugs.launchpad.net/ubuntu/+source/pipewire/+bug/1991936/comments/9

@aglasgall
Copy link

I will pull the source from that upload and confirm or deny this. I really hope so; doing this twice a year is not hard, but is rather tedious

@the-spyke
Copy link
Author

@aglasgall Thanks!

The next challenge would be LE Audio and LC3 support. I have already a pair of headphones with LC3, while cheap models from Chinese brands will be available this year globally. Unfortunately, the support is not yet ready: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/LE-Audio-+-LC3-support

@aglasgall
Copy link

Yes, I can confirm that pipewire in questing (25.10) DOES have AAC enabled and you will NOT need this ppa on 25.10. That means that this PPA will be retired once 25.10 comes out.

I will not delete any existing packages, but I will not be adding new ones as of October. There haven't been significant SRUs to any of the past versions of pipewire in LTS releases, so this should not affect anyone.

Thanks to everyone for your patience and understanding over the last few years.

@aglasgall
Copy link

@the-spyke Ubuntu pipewire has (or will have in 25.10) LC3 enabled, but liblc3plus (for LC3+) isn't even in Ubuntu and Fraunhofer's litigious reputation honestly scares me too much to want to try packaging it myself.

LC3 being enabled means LE audio might work! I just haven't tried it, and if it doesn't it's a problem needing actual development work in pipewire and bluez, not just re-enabling a dependency :)

@aglasgall
Copy link

One last thing... The actual upload adding AAC support in 25.10 is:

pipewire (1.4.2-1ubuntu2) questing; urgency=medium

  * d/control, d/libspa-0.2-bluetooth.install,
    d/libspa-0.2-modules-extra.install, d/rules:
    - enable the aac bluetooth codec, libfdk-aac is in universe for now
      (MIR #1977614) but it's a separate .so which can be included in the
      new libspa-0.2-modules-extra binary (lp: #1991936)

 -- Sebastien Bacher <seb128@ubuntu.com>  Thu, 19 Jun 2025 17:19:35 +0200

i.e. you will have to ALSO install libspa-0.2-modules-extra for AAC support in 25.10, not just libspa-0.2-modules-bluetooth

@aglasgall
Copy link

Also, seb128 is the person who's done the real legwork here, drop him a line thanking him for it :)

@the-spyke
Copy link
Author

@aglasgall Thanks for the confirmation! I've already made a note to myself to avoid forgetting installing libspa-0.2-modules-extra after the upgrade 😄

Last time I've been checking the LE Audio status it didn't work together with the classic stack, so I would loose my Bluetooth mouse and keyboard. There are fresh notes As of 2025-06-12 on the wiki, but I would probably wait till 25.10 release. Finally having a microphone without switching the profiles and degrading the audio would be so awesome.

@aglasgall
Copy link

@the-spyke one thing to note is that if you rely on "multipoint audio" (having more than one device paired to your headphones and active at a time), that may not work with LE yet. At least, my Sony earbuds explicitly say they won't do both at once, anyway.

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