maniacx / Bluetooth-Battery-Meter

A Gnome extension featuring indicator icons in system tray, serving as meter for Bluetooth device battery levels and providing detailed battery levels via icon/text in the Bluetooth quick settings menu.
https://extensions.gnome.org/extension/6670/bluetooth-battery-meter/
GNU General Public License v3.0
107 stars 11 forks source link

bug: Extension sometimes does not show Bluetooth connected icon #26

Closed fiftydinar closed 7 months ago

fiftydinar commented 7 months ago

I'm not sure if this is the Gnome bug, bluez bug or extension bug. But I will report it.

My headphones are automatically connected, but it shows as disconnected in Gnome settings & as a result, extension mirrors this status too. However, it still shows battery percent of the headphone, as a proof that headphones are actually connected.

Screenshot from 2024-04-06 12-43-49 Screenshot from 2024-04-06 12-46-11

Fedora Silverblue 39 Gnome 45.5 Extension v14

When I manually connect the headphones, I don't have this issue. So this only happens when headphones are automatically connected.

maniacx commented 7 months ago

Hmm. Strange. Let figure this out what is causing the issue.

How do you know it has automatically connected. Is is because you are seeing the Battery level or Does your SoundCore Life Q30 plays sound as well?

Make a note of MAC address for Soundcore Q30.

Copy paste in text editor or something. You can find mac address in Bluetooth settings. example Screenshot from 2024-04-06 09-26-10

1. Verify Gnome settings shows disconnected and power shows battery

Next time when the Soundcore Q30 automatically connects, check the following.

If Gnome Settings > Bluetooth reports disconnected, but Gnome Settings > Power shows battery level, seem to me not an extension problem. ex Screenshot from 2024-04-06 09-09-56

2. Bluetooth menu with extension disabled

Now disable the extension and show attach the picture of Gnome shell bluetooth settings

3. Upower output

Next in terminal type command

upower -d

Post results here.

4. Bluetoothctl output

Using the mac address you saved previously to get output of bluetoothctl command in terminal

bluetoothctl info XX:XX:XX:XX:XX:XX
fiftydinar commented 7 months ago

How do you know it has automatically connected. Is it because you are seeing the Battery level or Does your SoundCore Life Q30 plays sound as well?

It's because of both. Soundcore plays the 3-note sound when you are connected. When I turn on the Bluetooth headphones, they automatically connect, without me requiring any intervention.

Manual connection is when I press manually "Connect" either in quick settings or in Gnome Bluetooth settings for Soundcore headphones.

  1. Verify Gnome settings shows disconnected and power shows battery
  • Verify the extension is showing (Disconnected but still showing battery) is Gnome-shells bluetooth menu.
  • Verify the Soundcore Q30 can play sound
  • Under Gnome Settings > Bluetooth verfiy your device Soundcore Q30 shows disconnected
  • Under Gnome Settings > Power Verify Soundcore Q30 shows battery level example

All those are verified & match your instructions.

  1. Bluetooth menu with extension disabled

Now disable the extension and show attach the picture of Gnome shell bluetooth settings

Screenshot from 2024-04-06 18-46-33

Power section in Gnome settings still shows battery percentage for Soundcore.

So basically unchanged when extension is disabled.

  1. Upower output

Next in terminal type command

upower -d

Post results here.

Device: /org/freedesktop/UPower/devices/battery_hidpp_battery_0
  native-path:          hidpp_battery_0
  model:                G305 Lightspeed Wireless Gaming Mouse
  serial:               bf-95-a1-d3
  power supply:         no
  updated:              subota, 06. april 2024. 18:47:09 CEST (12 seconds ago)
  has history:          yes
  has statistics:       yes
  mouse
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    battery-level:       unknown
    percentage:          50% (should be ignored)
    icon-name:          'battery-caution-symbolic'
  History (charge):
    1712422029  50,000  discharging
    1712422029  0,000   unknown
    1712421999  50,000  discharging
    1712421999  0,000   unknown
    1712421969  50,000  discharging
    1712421969  0,000   unknown
    1712421939  50,000  discharging
    1712421939  0,000   unknown
  History (rate):
    1712422029  0,000   unknown
    1712421999  0,000   unknown
    1712421969  0,000   unknown
    1712421939  0,000   unknown

Device: /org/freedesktop/UPower/devices/headset_dev_AC_12_2F_DA_CE_DE
  native-path:          /org/bluez/hci0/dev_AC_12_2F_DA_CE_DE
  model:                Soundcore Life Q30
  serial:               AC:12:2F:DA:CE:DE
  power supply:         no
  updated:              subota, 06. april 2024. 18:40:48 CEST (393 seconds ago)
  has history:          yes
  has statistics:       no
  headset
    warning-level:       none
    percentage:          20%
    icon-name:          'battery-missing-symbolic'
  History (charge):
    1712422041  0,000   unknown
  History (rate):
    1712422041  0,000   unknown

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         no
  updated:              subota, 06. april 2024. 16:08:57 CEST (9504 seconds ago)
  has history:          no
  has statistics:       no
  unknown
    warning-level:       none
    percentage:          0%
    icon-name:          'battery-missing-symbolic'

Daemon:
  daemon-version:  1.90.2
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  no
  critical-action: PowerOff
  1. Bluetoothctl output

Using the mac address you saved previously to get output of bluetoothctl command in terminal

bluetoothctl info XX:XX:XX:XX:XX:XX

Device AC:12:2F:DA:CE:DE (public)
    Name: Soundcore Life Q30
    Alias: Soundcore Life Q30
    Class: 0x00240404 (2360324)
    Icon: audio-headset
    Paired: yes
    Bonded: yes
    Trusted: yes
    Blocked: no
    Connected: no
    LegacyPairing: no
    UUID: SDP                       (00000001-0000-1000-8000-00805f9b34fb)
    UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
    UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Cont.. (0000110f-0000-1000-8000-00805f9b34fb)
    UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
    UUID: Generic Audio             (00001203-0000-1000-8000-00805f9b34fb)
    UUID: Vendor specific           (66666666-6666-6666-6666-666666666666)
    UUID: Unknown                   (daf51c01-0000-1000-8000-00805f9b34fb)
    ManufacturerData.Key: 0x12ac (4780)
    ManufacturerData.Value:
  2f da ce de 00 00                                /.....          
    RSSI: 0xffffffc2 (-62)
    Battery Percentage: 0x14 (20)
fiftydinar commented 7 months ago

I will close this issue as the upstream problem.

maniacx commented 7 months ago

It is a problem from bluez.

As you can see bluetoothctl it shows connected: no, but still shows battery level.

It is not even Gnome-shell, or gnome-blietooth problem.

It's a bug from bluez or pipe wire but report it on bluez and bluez may redirect it to pipe wire if necessary

https://github.com/bluez/bluez/issues

fiftydinar commented 7 months ago

It is a problem from bluez.

Yeah, same bug is already reported in the time I made the issue: https://github.com/bluez/bluez/issues/804

Thanks for chiming in & trying to help.

ghost commented 7 months ago

Downgrading to kernel 6.8.1 works, someone found the issue: https://bugzilla.kernel.org/show_bug.cgi?id=218680