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

Also show power level bluetooth headphones #141

Open
1 task done
peteruithoven opened this issue Jul 25, 2020 · 8 comments
Open
1 task done

Also show power level bluetooth headphones #141

peteruithoven opened this issue Jul 25, 2020 · 8 comments

Comments

@peteruithoven
Copy link
Contributor

peteruithoven commented Jul 25, 2020

Prerequisites

  • I have searched open and closed issues for duplicates.

Feature

Is your feature request related to a problem? Please describe.

I love how the indicator shows me the power levels of my bluetooth devices.
But, it never includes my bluetooth headphones/headsets even when they are also connected:

Describe the solution you'd like
I'd love for these devices to also be included.

Existing work
Android is able to read out their power levels:

Describe alternatives you've considered

Additional context
Looking through the code it depends on dbus & Upower. Looking there I see that the bluetooth devices aren't listed.

Screenshot from 2020-07-26 00-08-09@2x
Some devices like the MX Keys also seem to have a org.bluez.battery1 interface

While the headphones don't have that interface:

Relevant Stack overflow question with some interesting answers:
https://stackoverflow.com/a/52899481/1544200

https://github.com/wangrunz/BluetoothMonitor#battery-level-for-bluetooth-headsets-support-handsfree-profile


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@danirabbit
Copy link
Member

There's also this which might be interesting: https://github.com/TheWeirdDev/Bluetooth_Headset_Battery_Level/

@kvdz
Copy link
Collaborator

kvdz commented Jul 16, 2021

Due note that this requires to introduce the bluez dbus interface into this code base. Which is not present a this moment. It also makes it harder to know the correlation between Upower and bluez dbus interface, in order to prevent duplicate devices.

I am wondering if we can not get this information from the already used Upower interface.

If it is possible I would like to see the upower data maybe @peteruithoven @andirsun can help me out?
because I do not own wireless headsets, just a personal preference.

If possible I would like to see the output of upower -d if you could copy paste the result on this ticket. Then i could see what data is available and maybe add the battery % via the upower interface.

@kvdz
Copy link
Collaborator

kvdz commented Jul 16, 2021

Sorry I didn't read the part of bluetooth devices doesn't get listed on upower interface.
But the MX keys is on both interfaces which could create duplication.

when using the device1 interface there is no easy way to get battery level (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/device-api.txt)
but there might be a way to use raw AT commands to obtain batter level when the battery1 (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/battery-api.txt) interface is not available.
Sadly some AT commands are vendor specific and is hard to maintain.

@torikulhabib
Copy link

new version bluez 5.56 and higher, support battery provider
https://github.com/bluez/bluez/blob/5.60/test/example-battery-provider

@andirsun
Copy link
Contributor

andirsun commented Jul 31, 2021

@torikulhabib Do you know how to run the experimental interface un bluez bus ?
Interface org.bluez.BatteryProviderManager1 [experimental]
I upgrade bluez compiling the last version from source but I dont know how to find the BatteryProviceManager1 Interface

@torikulhabib
Copy link

after installing the latest version of bluez. what looks when you're running ./example-batrey-provider.py?? ?

@andirsun
Copy link
Contributor

❯ ./example-battery-provider 
BatteryProviderManager1 interface not found

@Hedronmx
Copy link

Bluetooth battery has been completely lost in Odin. I used to be able to see the battery percentage on the power indicator but not after the upgrade.

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

No branches or pull requests

6 participants