Skip to contentSkip to conversation

adapter: Notify adapter drivers of settings changes

PATCH Applied Simon Mikuda 3 participants 4 messages Nov 22 – Nov 23 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 adapter: Notify adapter drivers of settings changes

Add a settings_changed callback to adapter drivers, called with the MGMT_SETTING_* bits that changed whenever the adapter's current settings change. The media driver needs it to follow the CIS and ISO broadcast settings, which the kernel only sets once the controller is up.

Assisted-by Claude:claude-opus-5-5
---
 src/adapter.c | 11 +++++++++++
 src/adapter.h |  2 ++
 2 files changed, 13 insertions(+)
src/adapter.c +11 -0
index 1439642cb..112312651 100644
@@ -688,6 +688,17 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
 
 		trigger_pairable_timeout(adapter);
 	}
+
+	if (changed_mask) {
+		GSList *l;
+
+		for (l = adapter->drivers; l; l = g_slist_next(l)) {
+			struct btd_adapter_driver *driver = l->data;
+
+			if (driver->settings_changed)
+				driver->settings_changed(adapter, changed_mask);
+		}
+	}
 }
 
 static void adapter_set_power_state(struct btd_adapter *adapter, uint32_t value)
src/adapter.h +2 -0
index 18e6eaa78..63016c8e1 100644
@@ -134,6 +134,8 @@ struct btd_adapter_driver {
 						struct btd_device *device);
 	void (*device_resolved)(struct btd_adapter *adapter,
 						struct btd_device *device);
+	void (*settings_changed)(struct btd_adapter *adapter,
+						uint32_t changed);
 
 	/* Indicates the driver is experimental and shall only be registered
 	 * when experimental has been enabled (see: main.conf:Experimental).

base-commit: 1adfe662efeff12997df9ddd0960dbd0de9c8ea7

Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 2/2 media: Signal SupportedUUIDs when the ISO settings change

Media1.SupportedUUIDs lists the LE Audio endpoints only when the adapter has the CIS or ISO broadcast settings, which the kernel sets once the controller is up. An adapter registered before that, such as a USB controller that finishes loading its firmware after bluetoothd started, first lists none, and no PropertiesChanged followed when the settings came on. PipeWire then registered its A2DP endpoints only, and the adapter had no LE Audio until PipeWire was restarted.

Signal SupportedUUIDs from the media driver's settings_changed callback when a CIS or ISO broadcast setting changes.

Fixes f2a29899297a ("media: Check adapter CIS support to add BAP in SupportedUUIDs")
Assisted-by Claude:claude-opus-5-5
---
 profiles/audio/a2dp.c  |  1 +
 profiles/audio/media.c | 23 +++++++++++++++++++++++
 profiles/audio/media.h |  1 +
 3 files changed, 25 insertions(+)
profiles/audio/a2dp.c +1 -0
index 3b29ec204..3eb3e3bfd 100644
@@ -3893,6 +3893,7 @@ static struct btd_adapter_driver media_driver = {
 	.name		= "media",
 	.probe		= media_server_probe,
 	.remove		= media_server_remove,
+	.settings_changed	= media_settings_changed,
 };
 
 static int a2dp_init(void)
profiles/audio/media.c +23 -0
index 3433a7b6e..13fead886 100644
@@ -3864,6 +3864,29 @@ int media_register(struct btd_adapter *btd_adapter)
 	return 0;
 }
 
+void media_settings_changed(struct btd_adapter *btd_adapter, uint32_t changed)
+{
+	GSList *l;
+
+	if (!(changed & (MGMT_SETTING_CIS_CENTRAL |
+				MGMT_SETTING_CIS_PERIPHERAL |
+				MGMT_SETTING_ISO_BROADCASTER |
+				MGMT_SETTING_ISO_SYNC_RECEIVER)))
+		return;
+
+	for (l = adapters; l; l = l->next) {
+		struct media_adapter *adapter = l->data;
+
+		if (adapter->btd_adapter == btd_adapter) {
+			g_dbus_emit_property_changed(btd_get_dbus_connection(),
+						adapter_get_path(btd_adapter),
+						MEDIA_INTERFACE,
+						"SupportedUUIDs");
+			return;
+		}
+	}
+}
+
 void media_unregister(struct btd_adapter *btd_adapter)
 {
 	GSList *l;
profiles/audio/media.h +1 -0
index a84634fff..eb95a8b06 100644
@@ -17,6 +17,7 @@ typedef void (*media_endpoint_cb_t) (struct media_endpoint *endpoint,
 
 int media_register(struct btd_adapter *btd_adapter);
 void media_unregister(struct btd_adapter *btd_adapter);
+void media_settings_changed(struct btd_adapter *btd_adapter, uint32_t changed);
 
 #ifdef HAVE_A2DP
 struct a2dp_sep *media_endpoint_get_sep(struct media_endpoint *endpoint);
Signature · 1 line
2.43.0
#2 lore raw
In reply to Simon Mikuda

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1218926/

---Test result---

Test Summary:

CheckPatch                    PASS      1.10 seconds
GitLint                       PASS      0.70 seconds
BuildEll                      PASS      20.13 seconds
BluezMake                     PASS      309.44 seconds
MakeCheck                     PASS      3.53 seconds
MakeDistcheck                 PASS      145.92 seconds
CheckValgrind                 PASS      159.16 seconds
CheckSmatch                   PASS      314.48 seconds
bluezmakeextell               PASS      100.03 seconds
TestFunctional                PASS      1213.20 seconds
IncrementalBuild              PASS      318.22 seconds
ScanBuild                     PASS      1176.50 seconds

https://github.com/bluez/bluez/pull/2877

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Simon Mikuda
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 9 lines · On Sun, 22 Nov 2026 20:29:54 +0100 you wrote:

Add a settings_changed callback to adapter drivers, called with the MGMT_SETTING_* bits that changed whenever the adapter's current settings change. The media driver needs it to follow the CIS and ISO broadcast settings, which the kernel only sets once the controller is up.

Assisted-by Claude:claude-opus-5-5

[...]

Here is the summary with links:
- [BlueZ,v2,1/2] adapter: Notify adapter drivers of settings changes

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3a0998307834
  - [BlueZ,v2,2/2] media: Signal SupportedUUIDs when the ISO settings change
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1608f8361886

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html