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

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

Closed
1 task done
kuraga opened this issue Apr 6, 2024 · 12 comments
Closed
1 task done

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

kuraga opened this issue Apr 6, 2024 · 12 comments
Labels
Milestone

Comments

@kuraga
Copy link
Contributor

kuraga commented Apr 6, 2024

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.)

@cschramm
Copy link
Member

cschramm commented Apr 6, 2024

Cannot reproduce.

@kuraga
Copy link
Contributor Author

kuraga commented Apr 7, 2024

image

click:

image

@cschramm
Copy link
Member

cschramm commented Apr 8, 2024

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.

@kuraga kuraga closed this as completed Apr 8, 2024
@kuraga
Copy link
Contributor Author

kuraga commented Apr 12, 2024

See it in 2.4.1.

@kuraga kuraga reopened this Apr 12, 2024
@kuraga kuraga closed this as completed Apr 13, 2024
@kuraga kuraga reopened this Apr 14, 2024
@Staudey
Copy link

Staudey commented May 9, 2024

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

@cschramm cschramm added the bug label May 9, 2024
@cschramm cschramm added this to the 2.4.2 milestone May 9, 2024
@cschramm
Copy link
Member

cschramm commented May 9, 2024

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.

@kuraga
Copy link
Contributor Author

kuraga commented May 9, 2024

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

@Staudey
Copy link

Staudey commented May 9, 2024

@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.

@cschramm
Copy link
Member

cschramm commented May 9, 2024

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.

@kuraga
Copy link
Contributor Author

kuraga commented May 9, 2024

@cschramm , 1066, 1132, 1139...

@Staudey
Copy link

Staudey commented May 9, 2024

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)

cschramm added a commit to cschramm/blueman that referenced this issue May 10, 2024
We build a (32 bit) ID for the menu item from its priority values, using the sub priority as the lower 8 bits. Pulseaudio card indexes are theoretically 32 bit and PipeWire re-assignes them with large gaps on re-connect so that it provides high 3-digit numbers in practice that do not fit the 8 bits.

Closes blueman-project#2331
cschramm added a commit to cschramm/blueman that referenced this issue May 10, 2024
We build a (32 bit) ID for the menu item from its priority values, using the sub priority as the lower 8 bits. Pulseaudio card indexes are theoretically 32 bit and PipeWire re-assignes them with large gaps on re-connect so that it provides high 3-digit numbers in practice that do not fit the 8 bits.

Closes blueman-project#2331
cschramm added a commit that referenced this issue May 15, 2024
We build a (32 bit) ID for the menu item from its priority values, using the sub priority as the lower 8 bits. Pulseaudio card indexes are theoretically 32 bit and PipeWire re-assignes them with large gaps on re-connect so that it provides high 3-digit numbers in practice that do not fit the 8 bits.

Closes #2331
infirit pushed a commit to infirit/blueman that referenced this issue May 15, 2024
We build a (32 bit) ID for the menu item from its priority values, using the sub priority as the lower 8 bits. Pulseaudio card indexes are theoretically 32 bit and PipeWire re-assignes them with large gaps on re-connect so that it provides high 3-digit numbers in practice that do not fit the 8 bits.

Closes blueman-project#2331
@Staudey
Copy link

Staudey commented May 15, 2024

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. 👍

infirit pushed a commit to infirit/blueman that referenced this issue May 17, 2024
We build a (32 bit) ID for the menu item from its priority values, using the sub priority as the lower 8 bits. Pulseaudio card indexes are theoretically 32 bit and PipeWire re-assignes them with large gaps on re-connect so that it provides high 3-digit numbers in practice that do not fit the 8 bits.

Closes blueman-project#2331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants