Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blueman-applet excessive CPU usage after resume #2521

Open
tommie opened this issue Oct 23, 2024 · 4 comments
Open

blueman-applet excessive CPU usage after resume #2521

tommie opened this issue Oct 23, 2024 · 4 comments

Comments

@tommie
Copy link
Contributor

tommie commented Oct 23, 2024

blueman: 2.3.5-3build1 (applet c07e8a4)
BlueZ: 5.72-0ubuntu5
Distribution: Ubuntu 24.04
Desktop environment: Gnome

This is a continuation on the discussion in #2499.

Today blueman-applet went into using constant excessive CPU after suspend/resume. It's at 10% rather than 100%, but that might be due to debug logging slowing it down.

https://gist.github.com/tommie/0ec3fa00f013995ab87f6e136d56fac7

It seems to be flooding

blueman-applet 07.50.43 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_04_B9_E3_48_CF_87 {'RSSI': -85}

with different RSSI for the same device. Normally this only happens 1-2 seconds per minute as devices are added/removed, but now it keeps running constantly, logging several times per second. It keeps happening even if I restart blueman-applet.

The assertion error

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blueman/bluez/Manager.py", line 76, in _on_object_removed
    assert isinstance(device_proxy, Gio.DBusProxy)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

seems unrelated as it occurs previously in the log file without causing the behavior.

@infirit
Copy link
Contributor

infirit commented Oct 23, 2024

We get these RSSI property changes from BlueZ's dbus api for devices when discovery is in progress. And I've never seen so many in such a short time ever. Like you said, normally BlueZ would update every couple seconds.

Is there anything interesting in the kernel log journalctl --dmesg? Or maybe in the bluetoothd daemon log journalctl -u bluetooth.service.

The assertion error should not happen but afaics harmless.

@tommie
Copy link
Contributor Author

tommie commented Oct 23, 2024

Kernel logs are very quiet about Bluetooth. bluez has nothing that seems related. It complains about my Bose headphones as I turn them on and off (and sometimes picks the wrong audio profile.)

I killed the applet and restarted it a couple of times. Right now it's off, and now /usr/lib/x86_64-linux-gnu/indicator-bluetooth/indicator-bluetooth-service is at 82% CPU and bluetoothd is around 6%. If I kill indicator-bluetooth, bluetoothd still sits around 6%.

So perhaps this is rooted in bluez having a mental breakdown.

@tommie
Copy link
Contributor Author

tommie commented Oct 23, 2024

Just realized: I am running bluetoothd --experimental because I needed access to some experimental API at some point.

@tommie
Copy link
Contributor Author

tommie commented Oct 23, 2024

Interestingly, restarting bluetoothd seems to make my whole process tree just... quiet down... Even Chrome stops using a bunch of CPU, it seems.

If I now start blueman-applet, it is quiet as it should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants