Skip to content

feat(dbus-proxy): support for BlueZ and multiple agents#1899

Merged
brianmcgillion merged 1 commit into
tiiuae:mainfrom
jkuro-tii:dbus-bluez-proxy
May 12, 2026
Merged

feat(dbus-proxy): support for BlueZ and multiple agents#1899
brianmcgillion merged 1 commit into
tiiuae:mainfrom
jkuro-tii:dbus-bluez-proxy

Conversation

@jkuro-tii
Copy link
Copy Markdown
Contributor

@jkuro-tii jkuro-tii commented Apr 16, 2026

Description of Changes

Introduce dbus-proxy support for Bluetooth services provided by BlueZ and implement handling for multiple concurrent clients, such as NetworkManager and Bluetooth clients.
This change enables reliable operation in environments where multiple services access the D-Bus proxy simultaneously.

Type of Change

  • New Feature
  • Bug Fix
  • Improvement / Refactor

Related Issues / Tickets

Checklist

  • Clear summary in PR description
  • Detailed and meaningful commit message(s)
  • Commits are logically organized and squashed if appropriate
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • Author has run make-checks and it passes
  • All automatic GitHub Action checks pass - see actions
  • Author has added reviewers and removed PR draft status

Testing Instructions

Applicable Targets

  • Orin AGX aarch64
  • Orin NX aarch64
  • Lenovo X1 x86_64
  • Dell Latitude x86_64
  • System 76 x86_64

Installation Method

  • Requires full re-installation
  • Can be updated with nixos-rebuild ... switch
  • Other:

Test Steps To Verify:

Test Steps To Verify

Perform common Bluetooth operations using either the command-line tool bluetoothctl or the graphical application Blueman (blueman-applet).
to run bluetoothctl enter the commands on gui-vm:

nix-shell -p bluez
bluetoothctl

1. Verify adapter power control

bluetoothctl
power on
power off

Expected result:

  • Adapter state changes successfully
  • No D-Bus errors are reported
  • Proxy forwards method calls correctly

2. Verify device discovery (scanning)

scan on
scan off

Optional:
scan le

Expected result:

  • Devices appear in scan results
  • Signals are forwarded correctly through the proxy
  • No dropped or duplicated events

3. Verify device connection workflow

connect
disconnect

Expected result:

  • Connection succeeds
  • Disconnection succeeds
  • State transitions are consistent
  • No stale objects remain in the proxy

4. Verify pairing / agent callbacks

Initiate pairing:
pair

Or use the GUI via:

blueman-applet → Pair device

Expected result:

The proxy correctly forwards agent callbacks such as:

  • RequestConfirmation
  • RequestPasskey
  • AuthorizeService

and pairing completes successfully.

5. Systray support test:

Tray icons should appear from comms-vm (element-desktop) and flatpak-vm (discord, spotify, slack, etc.)
Note: Some apps close when the "X" button is clicked instead of minimizing to tray

App Icon Clicks (Left and/or Right) Notes
[Flatpak]Discord
[Flatpak]Zoom
[Flatpak]Teams (portal)
[comms]Element
[Flatpak]Spotify X closes the app
[Flatpak]Telegram X closes the app
[Flatpak]Slack X closes the app

6. Network applet tests

  • connect and disconnect to wired and WiFi networks

Expected:

  • applet works properly

@enesoztrk
Copy link
Copy Markdown
Contributor

It would be beneficial to test the SNI feature with it, as it also utilizes the same dbus-proxy app structure.
#1791 (comment)

@jkuro-tii jkuro-tii changed the title Dbus-proxy: support for BlueZ and multiple agents feat(dbus-proxy): support for BlueZ and multiple agents Apr 28, 2026
@jkuro-tii jkuro-tii marked this pull request as ready for review April 28, 2026 07:35
Copy link
Copy Markdown
Collaborator

@kajusnau kajusnau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-enable/unhide:

  • overlays/custom-packages/cosmic/cosmic-settings/default.nix
    • page-bluetooth can be re-enabled
    • Can the secret agent disabling patch be removed?
      If so, remove ./0001-dont-use-secret-agent.patch
  • overlays/custom-packages/cosmic/cosmic-applets/default.nix
    • Can the secret agent disabling patch be removed?
      If so, remove ./0003-dont-use-secret-agent.patch
    • Remove ./0001-bluetooth-applet-hide-bluetooth-settings-button.patch
  • overlays/custom-packages/cosmic/cosmic-initial-setup/default.nix
    • Can the secret agent disabling patch be removed?
      If so, remove ./0002-dont-use-secret-agent.patch

Of course, all of these should be tested to work before committing to enabling them

@kajusnau
Copy link
Copy Markdown
Collaborator

kajusnau commented May 4, 2026

In addition to the testing steps listed in the PR description, we should also test general Wi-Fi connectivity - the top panel applet, cosmic-settings network page, and cosmic-initial-setup should all be tested to ensure Wi-Fi functions work as expected.

@milva-unikie
Copy link
Copy Markdown

Tested on Darter Pro (new image)

Tested Bluetooth & network functionality via GUI. All good.

However, there are some warnings in the gui-vm log.

When a Bluetooth headset was connected:

May 04 13:56:48 gui-vm wireplumber[2677]: spa.bluez5: Properties changed in unknown transport '/org/bluez/hci0/dev_C8_2B_6B_62_CB_CE/sep1/fd0'. Multiple sound server instances (PipeWire/Pulseaudio/bluez-alsa) are probably trying to use Bluetooth audio at the same time, which can cause problems. The system configuration likely should be fixed to have only one sound server that manages Bluetooth audio.

After suspension (Bluetooth was disabled before suspension)

May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5: RegisterApplication() failed: org.bluez.Error.Failed
May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5: Using legacy bluez5 API for A2DP - only SBC will be supported. Please upgrade bluez5.
May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5.midi: org.bluez.GattManager1.RegisterApplication() failed: GDBus.Error:org.bluez.Error.Failed: GDBus.Error:org.bluez.Error.Failed: No object received
May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5.midi.server: org.bluez.GattManager1.RegisterApplication() failed: GDBus.Error:org.bluez.Error.Failed: GDBus.Error:org.bluez.Error.Failed: No object received

I did not see any performance issues related to these warnings, but I would like your opinion about them @jkuro-tii.

@milva-unikie milva-unikie removed the Needs Testing CI Team to pre-verify label May 4, 2026
@jkuro-tii jkuro-tii requested a review from kajusnau May 11, 2026 09:16
Signed-off-by: jkuro-tii <jaroslaw.kurowski@tii.ae>
@jkuro-tii
Copy link
Copy Markdown
Contributor Author

I added a fix that switches off pipewire's support for bluetooth in gui-vm, so no longer checks BT audio devices. It's not needed as bluetooth audio devices are handled by audio-vm.

@milva-unikie
Copy link
Copy Markdown

However, there are some warnings in the gui-vm log.

When a Bluetooth headset was connected:

May 04 13:56:48 gui-vm wireplumber[2677]: spa.bluez5: Properties changed in unknown transport '/org/bluez/hci0/dev_C8_2B_6B_62_CB_CE/sep1/fd0'. Multiple sound server instances (PipeWire/Pulseaudio/bluez-alsa) are probably trying to use Bluetooth audio at the same time, which can cause problems. The system configuration likely should be fixed to have only one sound server that manages Bluetooth audio.

After suspension (Bluetooth was disabled before suspension)

May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5: RegisterApplication() failed: org.bluez.Error.Failed
May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5: Using legacy bluez5 API for A2DP - only SBC will be supported. Please upgrade bluez5.
May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5.midi: org.bluez.GattManager1.RegisterApplication() failed: GDBus.Error:org.bluez.Error.Failed: GDBus.Error:org.bluez.Error.Failed: No object received
May 04 13:54:07 gui-vm wireplumber[2677]: spa.bluez5.midi.server: org.bluez.GattManager1.RegisterApplication() failed: GDBus.Error:org.bluez.Error.Failed: GDBus.Error:org.bluez.Error.Failed: No object received

I did not see any performance issues related to these warnings, but I would like your opinion about them @jkuro-tii.

These warnings disappeared

@milva-unikie milva-unikie added the Tested on Darter Pro This PR has been tested on Darter Pro label May 12, 2026
@brianmcgillion brianmcgillion merged commit d2e0a6d into tiiuae:main May 12, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tested on Darter Pro This PR has been tested on Darter Pro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants