blueman icon indicating copy to clipboard operation
blueman copied to clipboard

[2.4] [Bug] AudioProfiles plugin doesn't work

Open kuraga opened this issue 1 year ago • 12 comments

blueman: 2.4 BlueZ: 5.72 Distribution: Calculate Linux (Gentoo-based) Desktop environment: XFCE 4.18

Clicking on the AudioProfiles plugin's applet menu items doesn't change anything.

There is no any console output.

(Clicking on the manager context menu items seems to switch the profile normally.)

kuraga avatar Apr 06 '24 08:04 kuraga

Cannot reproduce.

cschramm avatar Apr 06 '24 08:04 cschramm

image

click:

image

kuraga avatar Apr 07 '24 10:04 kuraga

No idea. I'd tell you to gather the values and try the set_card_profile call manually, but it's exactly the same as in blueman-manager, so that seems pointless.

You are absolutely sure that blueman-applet --loglevel debug does not give any output on the click and it does close the menu as usual? Also try killall blueman-tray and run blueman-tray --loglevel debug manually.

cschramm avatar Apr 08 '24 06:04 cschramm

See it in 2.4.1.

kuraga avatar Apr 12 '24 14:04 kuraga

I'm seeing this in journalctl when I try to change the audio profile via the applet (on Budgie desktop), in the app itself it's fine:

May 09 14:41:57 solus-pc budgie-panel[1908]: DBusMenu.vala:137: Failed to send clicked event to node 2958345: GDBus.Error:org.freedesktop.DBus.Error.Failed: Traceback (most recent call last):
                                               File "/usr/lib/python3.11/site-packages/blueman/main/DbusService.py", line 156, in _handle_method_call
                                                 ok(method(*args))
                                                    ^^^^^^^^^^^^^
                                               File "/usr/lib/python3.11/site-packages/blueman/main/indicators/StatusNotifierItem.py", line 94, in _on_event
                                                 self._on_activate(idx >> 8, idx % (1 << 8) - 1)
                                               File "/usr/lib/python3.11/site-packages/blueman/main/Tray.py", line 62, in activate_menu_item
                                                 AppletService().ActivateMenuItem('(ai)', indexes)
                                               File "/usr/lib/python3.11/site-packages/gi/overrides/Gio.py", line 349, in __call__
                                                 result = self.dbus_proxy.call_sync(self.method_name, arg_variant,
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             gi.repository.GLib.GError: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.Failed: Traceback (most recent call last):
                                               File "/usr/lib/python3.11/site-packages/blueman/main/DbusService.py", line 156, in _handle_method_call
                                                 ok(method(*args))
                                                    ^^^^^^^^^^^^^
                                               File "/usr/lib/python3.11/site-packages/blueman/plugins/applet/Menu.py", line 171, in _activate_menu_item
                                                 node = self.__menuitems[(indexes[0] >> 8, indexes[0] % (1 << 8))]
                                                        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             KeyError: (45, 36)
                                              (0)

The menu closes normally after clicking. No output (apart from the starting messages) with blueman-tray --loglevel debug

Staudey avatar May 09 '24 12:05 Staudey

Thanks for the data, @Staudey. Good catch and, ouch, I do have an idea what's going on. Checking e.g. pactl list cards what card indexes do you see? If I'm right, I'd expect something close to 800.

cschramm avatar May 09 '24 17:05 cschramm

@Staudey , is your problem always reproducible? My is starting at some moment... Until reboot..

kuraga avatar May 09 '24 18:05 kuraga

@kuraga It was indeed not always reproducible, BUT

@cschramm when I checked just now it was only up to index #70 and the issue was no longer reproducible. So I disconnected and reconnected my headphones a bunch of times and when they were at index #270 (i.e. bigger than 255) the issue appeared again.

Staudey avatar May 09 '24 18:05 Staudey

The issue is clear then. I'll look into a fix.

It's probably PipeWire, not genuine pulseaudio, right?

Does it count up or are indexes somehow random? I mean, even if you never properly shut down your system and re-connect your headphones like five to ten times a day, it would still take a couple of months to get to spheres like 800.

cschramm avatar May 09 '24 20:05 cschramm

@cschramm , 1066, 1132, 1139...

kuraga avatar May 09 '24 21:05 kuraga

It's probably PipeWire, not genuine pulseaudio, right?

Yes, it's pipewire. It does count up with every reconnect, but by a random amount (up to ~50 per step)

Staudey avatar May 09 '24 22:05 Staudey

I can confirm that the issue is fixed with this patch. Just successfully switched audio profiles through the tray icon when the index of my card was # 312 and higher. :+1:

Staudey avatar May 15 '24 19:05 Staudey