maniacx / Airpod-Battery-Monitor

A Gnome extension for monitoring battery level of AirPods and Beats Bluetooth headset
https://extensions.gnome.org/extension/6778/airpod-battery-monitor/
GNU General Public License v3.0
36 stars 7 forks source link

Discussion #1

Closed maniacx closed 6 months ago

maniacx commented 6 months ago

Lets discuss about airpods here

Toxblh commented 6 months ago

Hi, works, not perfect, but already works. I think, I'll sent a big PR later with all my code which will adopt to your extenstion, which I wrote while all research a month ago. Auto recognition model and mode data about airPods, maybe a bit increase functionality - present modes as well.

image image

Toxblh commented 6 months ago

image and airPods 2nd

maniacx commented 6 months ago

Are you using any Gnome-shell theme? For some reason your battery rings are touching to each other, but in my dummy test it shows space between each other displays as shown in pic below..

Screenshot from 2024-02-17 08-42-38

Toxblh commented 6 months ago

No any theme So I did translate, and that now is fine. Don't know why 🤷‍♂️ image image

Toxblh commented 6 months ago

And both together works good as well image

maniacx commented 6 months ago

I have updated the extension add min-width to the space. Just incase the battery rings touch together for some reason due to stylesheet not following em due to transalation.

Also can you test , the second gui mode with message tray and indicators and post the result

Messay tray

Screenshot from 2024-02-17 09-29-23

Indicators

Screenshot from 2024-02-17 09-29-35

maniacx commented 6 months ago

I also need some additional information about how airpod behaviour. As I have never owned any airpods.

When airpod is paired and connected, is it possible to use only 1 earbud?

  1. If Left earbud is turned OFF, can Right earbud used to play sound.?
  2. If Right earbud is turned OFF, can Left earbud used to play sound.?
  3. If Left earbud is inside case charging, can Right earbud used to play sound.?
  4. If Right earbud is inside case charging, can Left earbud used to play sound.?

Indicator

I need this information to implement the below algorithm for Indicator. Screenshot from 2024-02-17 12-09-24

Current Indicator, display only one battery level. It chooses to display the level of earbud, that is the lowest. example if Left earbud = 40 and right earbud = 50, display level 40 (left is lower) if Left earbud = 80 and right earbud = 60, display level 60 (Right is lower)

But if Left earbud = 40 but is charging in case, and right is 50 but not in charging case, then display level 50 as right earbud this is connected and used and left earbud is in charging case so it is not used.

Filtering

Also this would help a little bit for airpod detection filtering. For example if two airpod have same model and are nearby RSSI, but one set of airpod earbud is inside case and other set of airpod is outside case, then the airpod outsite case = airpod connected.

But before doing all this, i wont to know if it is possible for only 1 airpod (left or right) to be connected.

maniacx commented 6 months ago

Hello @Toxblh

Let me know if the current status is good enough and working? If it is, I will upload to Gnome extension

If you want to patch and make some more improvement, take your time I will wait.

Toxblh commented 6 months ago

Feedback from me after weekends - that already works so good.

So your questsion about 1,2,3,4 - answer yes. In each combo.

About you consern with dots image You can try use vertical dots for each side (I understand that a lot variation if it single icon, better to do like 3 icons in line). But your idea also is good works. And with charging - as well.

I'm not sure many of us worry about monitoring the case all time. Because case is report status only when one of pod in the case. Case itself don't have BT to advertise thier status. I think it's fine to show 2 icons - pods + case in status, when one of pod or both in case and charge. All other time - show only pods - or let get the decision to user.

With filtering.. here is weak place. Let see real-world feedback. For home right now works super good, extention don't present me pods from near room because that is low RSSI. But I much worry about "office" case when a lot ppl around. In that case - all bad, but I test it only with OpenPods few times. Maybe better to hide levels fully it found more then 2 candidates, just don't confuse... Or need to create more smarter algorightm to save in time "yours" pods. Like example pods cant change level from 90 to 50 in less 5 minutes. And the same we can not get like example 50->70 without charging process. But that is could be buggy. Also is possbile to check "play" status or "mic in use" status what is reported by pods as well, and check with our status as well. Also don't show airpods at all if it is not connected right now

I think filtering filtering will improve after feedback already

maniacx commented 6 months ago

Apologize for this. Just rename the extension title

Airpods-Battery-Monitor

to

Airpod-Battery-Monitor

maniacx commented 6 months ago

Didnt change anything regarding detection of airpods I used your suggestion and now case will display only if it reports battery level.

Regarding icon, It didnt implement it.

Fix some GUI porblems and now available on Gnome extensions.

https://extensions.gnome.org/extension/6778/airpod-battery-monitor/

maniacx commented 6 months ago

Screenshot from 2024-02-25 20-07-09

Hammed. I am not sure want happened to your post , I accidently delete or did you?

  1. Regarding Beats Studio Pro, yes I can add it, but I need some details of what manufacturers data . Reply back and i will provide you with details on how to get it.

  2. Currently I will not be merging this with Bluetooth Battery Meter.

    • code is quite large to merge it to that extension
    • If seperate easier to tackle bugs and submitting translation.
    • Even if I do implement the feature of showing in quicksettings, the design would be complicated, as the space in quick setting bluetooth menu is not be enoough to report all 3 levels (L, R and case) . So in the end We can only sidpaly 1 icon and label level in quicksetting which would be minimum of L/R. So I think I skip this for now.

But reply back with Beats Studio Pro manufacturer data.

devhammed commented 6 months ago

@maniacx Thanks for responding, I did delete the comment after I noticed that the Bluetooth Battery Meter is showing the percentage for the Beats Studio Pro after I enabled the experimental features of Bluez. Still, it is not stable/every time.

For the space of the Quick Settings, Beats Studio Pro is a headphone so there is no L/R/Case just the percentage so that shouldn't be a problem (including for other headphones too).

So I will be glad to provide the manufacturer data if you can show me how to get it.

maniacx commented 6 months ago

I am surprised that it is already working with Bluetooth battery meter. I thought apple uses some properietty way to send battery info. What do you mean by not reliable?

For manufacturerdata you can run this test.js in gjs-console. It may take a minute or two to read the data.

https://maniacx.github.io/Airpod-Battery-Monitor/bugs-feature-request#script

Also in terminal type of bluetoothctl then info xx:xx:xx:xx:xx where xx:xx:xx:xx:xx is Mac address and post the output here

devhammed commented 6 months ago

@maniacx By not reliable, I mean it won't come up immediately until the next battery level change and also, the battery update is in increments (I know this is already mentioned):

image

maniacx commented 6 months ago

If it is already working with Bluetooth Battery Meter, then not point in implementing it this Airpod battery Monitor. Regarding percentage not showing up immediately, I dont think it is an issue with Bluetooth Battery Mete extension, but might be bluez itself not reporting until the next battery update. You can verify this by Checking [Gnome r Settings > Power] as shown in pic below

power

As soon as you connect

  1. If You see Beats battery level [Gnome setting > Power] , but do not see Battery level in Bluetooth Battery Meter extension. Open an issue in Bluetooth Battery Meter https://extensions.gnome.org/extension/6670/bluetooth-battery-meter/

  2. But if do not see battery level for Beat in Gnome setting > Power too, until the next battery update, you can open an issue with bluez

let continue the disccusion at Bluetooth Battery Meter issue, if the first point is valid.

Colle11 commented 6 months ago

Hi everyone, is there any plan to port this extension to GNOME Shell version 42?

Thank you!

maniacx commented 6 months ago

Now no time and plans..I do not have Gnome42..

maniacx commented 6 months ago

Now no time and plans..I do not have Gnome42.

maniacx commented 6 months ago

@Toxblh hey is this russian translation good for merge? Let me know.

After that I will close this issue

a4orce84 commented 6 months ago

Hey @maniacx,

First off, thanks for creating this extension man. Super exciting to have this functionality in Linux!

I am having an issue using Manjaro with Gnome 45.x and my AirPods Pros (1st Gen). I followed the steps in the documentation, but it still appears to be 'scanning' and not giving me any battery life details. I left the computer on for 10-15 mins, and still no battery information.

Is this normal? If not, can I send some logs or something to help troubleshoot what the root issue may be?

Thanks in advance for all of your time and help, it is greatly appreciated!

maniacx commented 6 months ago

Do you have any comments on this?

https://github.com/maniacx/Airpod-Battery-Monitor/issues/13

Airpod audio streaming has disturbance when discovery is started.

Toxblh commented 6 months ago

Hmm, I haven't that problems. I answered in the thread

maniacx commented 6 months ago

What are you using? is it ControllerMode = bredr ? For me discovery fails with bredr

Toxblh commented 6 months ago

Default - dual right now on my regular PC. But yet ~ 1 year ago use bredr just to use airpods and apple keyboard.