I have Fedora 36 installed on my laptop. Recently I’ve been using it a lot with a Bluetooth headset and noticed that sometimes WirePlumber creates high CPU usage. Turns out it was happening when the system was switching the Bluetooth profile for the headset from HSP to A2DP and backwards. There is a fix for that issue, but it is not yet available in Fedora’s repos. If you’re having the same issue, here’s how to fix it.
The issue
Basically, the issue was happening due to switching Bluetooth profiles. Here’s how I was able to reproduce it:
- Listen to music via the headset and put it on pause.
- Join a conference call (switching the headset to HSP profile);
- Leave the call and continue music playback (switching back to A2DP profile).
After doing that I noticed that the fan became way louder and when I opened htop
, I noticed that WirePlumber was using 100% of a single CPU core.
The solution
While looking for the solution on the internet, I stumbled upon this issue in WirePlumber’s repo, so I wasn’t the only one facing it. And luckily for me there was a solution for that issue already! A WirePlumber contributor Pauli Virtanen had opened a PR to fix for the issue. While the fix seems to work for the people who tested it, the PR is still not yet approved. And knowing how it is with opensource projects, it might take a while till it gets merged.
The issue was annoying me too much to wait for the fix and I was too lazy to setup an environment to build WirePlumber with the patch locally. So I decided to build the package with COPR. This way it was easy for me to build and use, and I can also share the package with you all!
I have also applied this fix by the same author to the package in COPR as it was another BT issue bothering me.
Time needed: 2 minutes
How to fix WirePlumber high CPU usage
- Enable monosoul/wireplumber-high-cpu-usage-fix COPR
sudo dnf copr enable monosoul/wireplumber-high-cpu-usage-fix
- Update repo metadata and install the new WirePlumber package
sudo dnf update --refresh
- Restart WirePlumber
systemctl --user restart wireplumber
Summary
That’s it. In just 3 easy steps you can fix the issue. Once the fixes are merged and a new WirePlumber version is released, I’ll stop maintaining the COPR.
The sources for the package are available here: https://github.com/monosoul/wireplumber-rpm-with-fixes