Skip to content

Instantly share code, notes, and snippets.

@the-spyke
Last active May 3, 2024 13:19
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'
@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.

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

@the-spyke
Copy link
Author

the-spyke commented Jun 28, 2023

@Rintse You're right, it's not in 22.04. It was added in 22.10. My bad. Looks like I've tweaked the gist after distro-upgrade. Thanks for the help! I've fixed the step.

@jpvonhemel
Copy link

Thank you very much. This fixed my no sound/dummy output issue on Linux Mint 21.2 Vera installed on my Beelink SER5. As I read through the comments, it seems like my problem was due to Pipewire being only half installed/configured from the upstream Ubuntu distro and not a driver issue. I wish I understood what was wrong and how the fix worked. Still learning.

@starapple2
Copy link

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

Maybe that was my issue: I use JACK. I'm a good few thousand miles away from my system at present so I can't recreate the situation that resulted in some missing config files that were subsequently installed when I included a step frim the Ubuntu Handbook instructions.

@fir3-1ce
Copy link

Thank you, this worked perfectly. Do you know how I can change the sampling rate to s24le 192000? It's what I had with pulse in my ~/.pulse/daemon.conf file

@shadyueh
Copy link

shadyueh commented Jul 31, 2023

Thanks for share. I would add a --force when enabling wireplumber due sometimes there are pipewire-session-manager leftovers:

Failed to enable unit: File /home/user/.config/systemd/user/pipewire-session-manager.service already exists
and is a symlink to /usr/lib/systemd/user/pipewire-media-session.service.

@fir3-1ce
Copy link

After some time using this, I'm wondering what is the difference between pipewire-pulse and Pipewire in general? Am I missing some functionality over if I were using a distro that ships with Pipewire by default? My pactl info says I'm using this:

Server Name: PulseAudio (on PipeWire 0.3.48)

Why is Pulse even involved at all anymore? Hope this makes sense, I'm still learning about Linux audio and the Linux ecosystem in general

@the-spyke
Copy link
Author

the-spyke commented Sep 16, 2023

@fir3-1ce With pipewire-pulse your PulseAudio server is disabled and Pipewire takes its place. So, pactl thinks it connects to PA, but it's PW in disguise.

@Dephrilibrium
Copy link

Dephrilibrium commented Sep 16, 2023

Heyho,

had exactly that problem with my setup and this solution worked for me.

  • Ubuntu Server 22.04
  • with kde-plasma-desktop on top
  • trying to connect a UE Megaboom 3 via bluetooth

Thanks a lot.

Kind regards,
Deph

@aglasgall
Copy link

I have built and uploaded packages for Ubuntu 23.10 "mantic", which entered beta today, to the PPA.

@basert
Copy link

basert commented Oct 1, 2023

You are the MVP @aglasgall! Thanks for your awesome work! You have a link to buy you a coffee, pizza or beer?

@aglasgall
Copy link

@basert I suppose I can dig up a venmo or something if you really insist, but I really don't want to incur an obligation here. I build these packages when I have time; I cannot promise I will be able to do so indefinitely!

That being said, the source packages with my changes are available from the PPA, so if I ever do drift away from this, you just need to find someone who knows how to do Debian packaging.

@aglasgall
Copy link

I missed something in the packages I initially uploaded to the PPA for 23.10, and they lacked AAC support as a result. I've uploaded new ones that do have AAC support; if you have the PPA enabled, you'll get them the next time you do a package update.

@unoexperto
Copy link

Hi folks,

I'm on Ubuntu 23.04. I'm unable to install pipewire-audio. I get following errors. Any idea how to fix it ?

The following packages have unmet dependencies.
 libspa-0.2-bluetooth : Depends: libspa-0.2-modules (= 0.3.65-4~glasgall1) but 0.3.66-8~ubuntu22.04 is to be installed
 pipewire-alsa : Depends: pipewire (= 0.3.65-4~glasgall1) but 0.3.66-8~ubuntu22.04 is to be installed
                 Depends: libpipewire-0.3-0 (= 0.3.65-4~glasgall1) but 0.3.66-8~ubuntu22.04 is to be installed
E: Unable to correct problems, you have held broken packages.

@the-spyke
Copy link
Author

@unoexperto Ubuntu 23.04 and later has PipeWire out of the box. Looks like you are using the PPA from @aglasgall to get AAC support, but there are some conflicts as apt tries to install ubuntu22.04 version for some reason. You can try to remove related PPAs and use canonical packages using the ppa-purge utility. Or try to resolve conflicts yourself.

@joihn
Copy link

joihn commented Nov 26, 2023

Hello everyone,
Thanks for this tutorial,
It didn't work correctly for me.

goal

connect to my headset via bluetooth + AAC

env

ubuntu 22.04.

steps I did

add @aglasgall ppa

sudo add-apt-repository ppa:aglasgall/pipewire-extra-bt-codecs
sudo apt update

followed the whole tutorial described by @the-spyke in the first post,
----> in /etc/alsa/conf.d, I removed everything non-pipewire related (was it a good idea ?)

10-samplerate.conf                  deleted
50-arcam-av-ctl.conf                deleted  
50-oss.conf                              deleted
50-pulseaudio.conf                  deleted
60-vdownmix.conf                    deleted
99-pipewire-default.conf           deleted      
99-pulse.conf deleted               kept
10-speexrate.conf                   deleted
50-jack.conf                             deleted
50-pipewire.conf                      kept
60-upmix.conf                          deleted
98-usb-stream.conf                  deleted
99-pulseaudio-default.conf.example deleted

I rebooted. I think I succesfully installed pipewire

$LANG=C pactl info | grep '^Server Name'
Server Name: PulseAudio (on PipeWire 0.3.48)

Issue

After applying the steps, I can connect to the headset, however, I only have a low quality, mono sound, option available.
Untitled

@the-spyke
Copy link
Author

@joihn Unfortunately, I haven't tried AAC myself. But, please check if you have several output devices and one of them may have a High Fidelity Playback configuration. A mono is usually for a "handsfree" mode when you are also use the microphone. I don't think Linux supports full quality sound in this mode (with stereo SBC, AAC, or other codec). Only in the A2DP mode.

@joihn
Copy link

joihn commented Nov 27, 2023

I can confirm this is the only mode I have access to. No AD2P mode unfortunately.
I noticed I still have some pulse package installed, is it normal ?

$apt list --installed | grep pulse

gstreamer1.0-pulseaudio/jammy-updates,jammy-security,now 1.20.3-0ubuntu1.1 amd64 [installed,automatic]
libcanberra-pulse/jammy-updates,now 0.30-10ubuntu1.22.04.1 amd64 [installed,automatic]
libkf5pulseaudioqt3/jammy,now 1.3-2 amd64 [installed,automatic]
libpulse-mainloop-glib0/jammy-updates,now 1:15.99.1+dfsg1-1ubuntu2.1 amd64 [installed,automatic]
libpulse0/jammy-updates,now 1:15.99.1+dfsg1-1ubuntu2.1 amd64 [installed,automatic]
libpulsedsp/jammy-updates,now 1:15.99.1+dfsg1-1ubuntu2.1 amd64 [installed,automatic]
pipewire-pulse/jammy,now 0.3.48-2~glasgall2 amd64 [installed,automatic]
pulseaudio-utils/jammy-updates,now 1:15.99.1+dfsg1-1ubuntu2.1 amd64 [installed,automatic]
pulseaudio/jammy-updates,now 1:15.99.1+dfsg1-1ubuntu2.1 amd64 [installed,automatic]

@the-spyke
Copy link
Author

@joihn Yes, PulseAudio is not removed, just disabled by pipewire-pulse. Have you tried with the stock packages? A2DP should work with SBC.

@mandofrog
Copy link

Tutorial said:

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

@joihn said:

followed the whole tutorial described by @the-spyke in the first post, ----> in /etc/alsa/conf.d, I removed everything non-pipewire related (was it a good idea ?)

OK, once more for the noob in the back . . .
My /etc/alsa/conf.d has 13 files:
10-samplerate.conf
10-speexrate.conf
50-arcam-av-ctl.conf
50-jack.conf
50-oss.conf
50-pipewire.conf
50-pulseaudio.conf
60-upmix.conf
60-vdownmix.conf
98-usb-stream.conf
99-pipewire-default.conf
99-pulseaudio-default.conf.example
99-pulse.conf

99-pipewire-default.conf is the only new file. All the rest are dated January to March '22 (I got Ubuntu Studio 22.04 LTS running just a couple weeks ago and I'm still trying to make heads or tails of it all) Do I remove all the rest? or just the 3 labeled Pulse? The old 50-pipewire.conf? Would it work to rename them (i.e. 10-samplerate.conf.bak or 99-pulse.conf.bak)? Or maybe move to another directory?

Thanks for the tutorial, and thanks for the patience.

@the-spyke
Copy link
Author

@mandofrog The idea was that you might have conflicting configs because you (or some package) have created them before. For example, in your case both 99-pipewire-default.conf and 99-pulse.conf have the same priority which may lead to conflicts. My 23.10 system (which began as a fresh 22.10, so PipeWire out of the box) has only 2 files there:

$ ll /etc/alsa/conf.d
total 8
drwxr-xr-x 1 root root 80 Nov  2 18:11 ./
drwxr-xr-x 1 root root 12 Apr 21  2023 ../
lrwxrwxrwx 1 root root 44 Sep 11 12:12 50-pipewire.conf -> /usr/share/alsa/alsa.conf.d/50-pipewire.conf
lrwxrwxrwx 1 root root 52 Sep 11 12:12 99-pipewire-default.conf -> /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf

I am not an expert in ALSA, but PipeWire replaces both PulseAudio and JACK. So, I would guess their configs are not needed. You may try to move all non-pipewire files to some temporary directory, reboot, and check if everything works fine. Not sure where files like 50-arcam-av-ctl.conf come from.

@joihn Maybe you have a similar issue.

@aglasgall
Copy link

I do want to be extremely clear that the only change between the packages in my PPA and the ones from ubuntu main is that additional codecs are enabled at build time. I have not modified any configuration files - you can verify this yourself by grabbing the source package from the PPA if you want.

Does the headset you are using even support A2DP or is it monaural HSP/HFP only?

If you're running Ubuntu Studio instead of plain Ubuntu, JACK may also be involved, which complicates things; I know PipeWire is supposed to supplant both pulseaudio and JACK but I don't know much about the details.

@joihn
Copy link

joihn commented Nov 28, 2023

thank you for your kind support @aglasgall @the-spyke 🙂

I am not an expert in ALSA, but PipeWire replaces both PulseAudio and JACK. So, I would guess their configs are not needed. You may try to move all non-pipewire files to some temporary directory, reboot, and check if everything works fine. Not sure where files like 50-arcam-av-ctl.conf come from.
@joihn Maybe you have a similar issue.

I too have the same files as you (and yes I did a reboot)

$ls /etc/alsa/conf.d 
50-pipewire.conf  99-pipewire-default.conf

Does the headset you are using even support A2DP or is it monaural HSP/HFP only?

I am sure the headset does support A2DP. I did previously work with AD2P under pulseaudio.

@joihn
Copy link

joihn commented Dec 1, 2023

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

@the-spyke
Copy link
Author

@joihn Congrats and thank you for sharing the solution.

For everyone on newer systems, here is a snipped to enable bluetooth headset battery reporting. Not sure about version requirements, but works on 23.10:

Bluetooth headset battery:
1. sudo micro /etc/bluetooth/main.conf
   and add Experimental=true
2. sudo micro /lib/systemd/system/bluetooth.service
   and add the --experimental exec option
3. sudo systemctl daemon-reload
4. sudo systemctl restart bluetooth

@federerfanatic
Copy link

Nice work.

@r-egorov
Copy link

Hey! Thanks for the tutorial!
I followed it and have the following codecs available!

Image

image

SBC seems to have much better sound quality than the stock codecs.

However, I am experiencing issues with the microphone from my bluetooth headset now. I am unnable to choose my headset as the Input device. When I choose something else from HSP/HFP for my headset the Internal Microphone is selected automatically as the Input device.

When I choose my bluetooth headset there, the output codec HSP/HFP is chosen automatically. And the microphone quality is really bad.
What can I do?

@the-spyke
Copy link
Author

@r-egorov SBC is the default Bluetooth codec, so the option without codec name might be the same as codec SBC. Regarding the microphone, this is a limitation of the current Bluetooth implementation. For the microphone to work you need to use a headset profile, but this profile has a very low listening audio quality and it is mono. iPhones and some other devices have more advanced A2DP implementations with back channels to overcome this. So, currently on Linux to get a great headset (like for games) you need to buy something with a USB dongle.

@joihn
Copy link

joihn commented Jan 22, 2024

after installing pipewire, unrelated cupsd service crash once a day with a related message
sudo cat /var/crash/_usr_sbin_cupsd.0.crash | grep -C 50 ' Main process exited'

Disassembly:
 => 0x7f0968c8f177 <_cups_safe_vsnprintf+1511>:	movzbl (%rcx),%eax
    0x7f0968c8f17a <_cups_safe_vsnprintf+1514>:	test   %al,%al
    0x7f0968c8f17c <_cups_safe_vsnprintf+1516>:	setne  %dl
    0x7f0968c8f17f <_cups_safe_vsnprintf+1519>:	mov    0x8(%rsp),%rsi
    0x7f0968c8f184 <_cups_safe_vsnprintf+1524>:	sub    $0x1,%rsi
    0x7f0968c8f188 <_cups_safe_vsnprintf+1528>:	cmp    %r12,%rsi
    0x7f0968c8f18b <_cups_safe_vsnprintf+1531>:	jbe    0x7f0968c8ec1e <_cups_safe_vsnprintf+142>
    0x7f0968c8f191 <_cups_safe_vsnprintf+1537>:	test   %dl,%dl
    0x7f0968c8f193 <_cups_safe_vsnprintf+1539>:	je     0x7f0968c8ec1e <_cups_safe_vsnprintf+142>
    0x7f0968c8f199 <_cups_safe_vsnprintf+1545>:	cmp    $0x27,%al
    0x7f0968c8f19b <_cups_safe_vsnprintf+1547>:	jg     0x7f0968c8f240 <_cups_safe_vsnprintf+1712>
    0x7f0968c8f1a1 <_cups_safe_vsnprintf+1553>:	nopl   0x0(%rax)
    0x7f0968c8f1a8 <_cups_safe_vsnprintf+1560>:	cmp    $0x8,%al
    0x7f0968c8f1aa <_cups_safe_vsnprintf+1562>:	jle    0x7f0968c8f1d0 <_cups_safe_vsnprintf+1600>
    0x7f0968c8f1ac <_cups_safe_vsnprintf+1564>:	lea    -0x9(%rax),%edx
    0x7f0968c8f1af <_cups_safe_vsnprintf+1567>:	cmp    $0x1e,%dl
InstallationDate: Installed on 2023-11-25 (58 days ago)
InstallationMedia: Ubuntu 22.04.3 LTS "Jammy Jellyfish" - Release amd64 (20230807.2)
JournalErrors:
 Jan 22 14:33:47 laptop pipewire-pulse[3554]: mod.protocol-pulse: server 0x55db3d1a7bf0: failed to create client: Connection refused
 Jan 22 14:33:47 laptop systemd[1]: cups.service: Main process exited, code=dumped, status=11/SEGV
 Jan 22 14:33:47 laptop systemd[1]: cups.service: Failed with result 'core-dump'.

@the-spyke
Copy link
Author

the-spyke commented Jan 22, 2024

@joihn Please open a bug on LaunchPad. I don't think we can help you here.

@joihn
Copy link

joihn commented Mar 9, 2024

Hello,
could anyone help me to revert back to normal ?

@the-spyke
Copy link
Author

@joihn All the steps, but backwards.

@joihn
Copy link

joihn commented Mar 9, 2024

I tried it last week and it broke my Ubuntu install, gnome could not boot anymore.
I had to revert back to a backup.
It might be due to the uninstall of pipewire?

@shackra
Copy link

shackra commented Apr 19, 2024

Would it be possible to connect input/output devices on a network? like barrier but for audio

there is a chance https://sonobus.net/ is the solution I'm looking for.

@K-Michallik
Copy link

I'm running Ubuntu 22.04 LTS currently with a set of Jabra 85's. Is it possible to use High Fidelity playback while using the headset microphone? Currently if I switch my input device to the headset, I lose the high quality audio (although the Sounds settings menu still displays it as active).

If not available in Ubuntu 22.04, is the functionality available in any version? I know it works fine in Windows 10/11

@the-spyke
Copy link
Author

@K-Michallik I haven't investigated this topic deeply myself yet. But as I understand the first option is to try mSBC. It should at least have better quality. And the full solution would be using a codec supporting duplex communications: FastStream, aptX Low Latency, LC3. But for this you need the headset to support it as well.

@eygraber
Copy link

I still don't have aac or aptx in the profile settings after updating to Ubuntu 24.04 from 22.04. I thought it would be natively supported because a liveusb I tried on my system did have it, but I guess not.

I followed these steps but that didn't help. Is ppa:aglasgall/pipewire-extra-bt-codecs the only way to get support for those codecs (even on 24.04)?

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

@jojommeke
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

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