Bug 434853 - Battery indicator for Bluetooth headset only shows up occasionally
Summary: Battery indicator for Bluetooth headset only shows up occasionally
Status: RESOLVED UPSTREAM
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.21.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-23 22:48 UTC by Patrick Auernig
Modified: 2023-02-18 13:40 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Auernig 2021-03-23 22:48:09 UTC
SUMMARY

The battery indicator in the Plasma system tray shows the charge status for my Bluetooth headset (Sennheiser HD 450BT) only for a few seconds after turning on the Bluetooth receiver,
but vanishes quickly after that.
It's also quite inconsistent to reproduce, and I'm still not quite sure under which conditions it exactly shows up.


STEPS TO REPRODUCE

1. Toggle power of Bluetooth receiver
2. Open power indicator widget in system tray


OBSERVED RESULT

The battery status is shown for a few seconds.
Sometimes it's showing the correct approximate charge, sometimes it's just shown as 0%.


EXPECTED RESULT

The battery status is shown in the Bluetooth widget like it is for other devices.


SOFTWARE/OS VERSIONS

Linux: 5.11.7
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2


ADDITIONAL INFORMATION

I was able to connect the device and get the battery info consistently with this python script
https://github.com/TheWeirdDev/Bluetooth_Headset_Battery_Level

The battery status does also show up correctly when I connect it to my Android phone.
Comment 1 Patrick Auernig 2021-03-23 23:00:04 UTC
Actual script link (derived from the one mentioned in report)

https://gist.github.com/valeth/0ad72473948077186c38b5ca231882ee
Comment 2 Leonardo 2021-04-06 12:44:56 UTC
Bluetooth Battery indicator? Where?
I am running Plasma 5.21.3 and i have never seen the battery indicator.
Comment 3 Patrick Auernig 2021-04-06 14:11:45 UTC
(In reply to Leonardo from comment #2)
> Bluetooth Battery indicator? Where?
> I am running Plasma 5.21.3 and i have never seen the battery indicator.

The battery status for devices (like Bluetooth mice and keyboards) can be shown in the system tray under "Battery and Brightness"
Comment 4 auxsvr 2021-12-26 15:15:08 UTC
There is no battery indicator for the Apple Magic Trackpad 2 connected via bluetooth, although `upower -d` returns the battery level. This is on KDE Plasma 5.23.4, KDE Frameworks 5.89.0, Qt 5.15.2, linux 5.15.8, Wayland, openSUSE Tumbleweed.
Comment 5 Patrick Auernig 2022-01-05 19:31:57 UTC
I monitored upower to see if it reports anything and it seems to sometimes find the device, and then about 30s later removes it again.


Output of `upower --monitor`:
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[20:25:20.837]	device added:     /org/freedesktop/UPower/devices/headphones_dev_00_1B_66_BD_FE_98
[20:25:50.834]	device removed:   /org/freedesktop/UPower/devices/headphones_dev_00_1B_66_BD_FE_98
Comment 6 Alain Laporte 2022-08-21 20:06:00 UTC
FYI, the battery of my headset Sony WH-1000XM3 won't be displayed by default on Ubuntu 22.04. But after enabling the the Experimental support in /etc/bluetooth/main.conf like explained here => https://wiki.archlinux.org/title/bluetooth_headset#Battery_level_reporting the battery level his displayed in system tray under "battery and brightness" and in the bluetooth popup of the system tray.
Comment 7 Patrick Auernig 2022-08-22 15:02:15 UTC
I tried enabling the experimental flag, but it didn't change anything on my end sadly.

But looking at the issues on the bluez GitHub repo linked in the wiki I found this issue which seems to be the root of the problem.
https://github.com/bluez/bluez/issues/211
Comment 8 Patrick Auernig 2023-02-18 13:40:12 UTC
This issues seems to slowly being addressed upstream (https://github.com/bluez/bluez/issues/211)
It partially works now, and the current issues with the battery indicator seem to be entirely an upstream issue in the bluetooth stack.