Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/2] adapter: Notify adapter drivers of settings changes
@ 2026-11-22 19:29 Simon Mikuda
  2026-11-22 19:29 ` [PATCH BlueZ v2 2/2] media: Signal SupportedUUIDs when the ISO settings change Simon Mikuda
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Mikuda @ 2026-11-22 19:29 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

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(+)

diff --git a/src/adapter.c b/src/adapter.c
index 1439642cb..112312651 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -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)
diff --git a/src/adapter.h b/src/adapter.h
index 18e6eaa78..63016c8e1 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH BlueZ v2 2/2] media: Signal SupportedUUIDs when the ISO settings change
  2026-11-22 19:29 [PATCH BlueZ v2 1/2] adapter: Notify adapter drivers of settings changes Simon Mikuda
@ 2026-11-22 19:29 ` Simon Mikuda
  2026-11-22 23:56 ` [BlueZ,v2,1/2] adapter: Notify adapter drivers of settings changes bluez.test.bot
  2026-11-23 18:00 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Mikuda @ 2026-11-22 19:29 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

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(+)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 3b29ec204..3eb3e3bfd 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -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)
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 3433a7b6e..13fead886 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -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;
diff --git a/profiles/audio/media.h b/profiles/audio/media.h
index a84634fff..eb95a8b06 100644
--- a/profiles/audio/media.h
+++ b/profiles/audio/media.h
@@ -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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [BlueZ,v2,1/2] adapter: Notify adapter drivers of settings changes
  2026-11-22 19:29 [PATCH BlueZ v2 1/2] adapter: Notify adapter drivers of settings changes Simon Mikuda
  2026-11-22 19:29 ` [PATCH BlueZ v2 2/2] media: Signal SupportedUUIDs when the ISO settings change Simon Mikuda
@ 2026-11-22 23:56 ` bluez.test.bot
  2026-11-23 18:00 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2026-11-22 23:56 UTC (permalink / raw)
  To: linux-bluetooth, simon.mikuda

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ v2 1/2] adapter: Notify adapter drivers of settings changes
  2026-11-22 19:29 [PATCH BlueZ v2 1/2] adapter: Notify adapter drivers of settings changes Simon Mikuda
  2026-11-22 19:29 ` [PATCH BlueZ v2 2/2] media: Signal SupportedUUIDs when the ISO settings change Simon Mikuda
  2026-11-22 23:56 ` [BlueZ,v2,1/2] adapter: Notify adapter drivers of settings changes bluez.test.bot
@ 2026-11-23 18:00 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2026-11-23 18:00 UTC (permalink / raw)
  To: Simon Mikuda; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-23 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 19:29 [PATCH BlueZ v2 1/2] adapter: Notify adapter drivers of settings changes Simon Mikuda
2026-11-22 19:29 ` [PATCH BlueZ v2 2/2] media: Signal SupportedUUIDs when the ISO settings change Simon Mikuda
2026-11-22 23:56 ` [BlueZ,v2,1/2] adapter: Notify adapter drivers of settings changes bluez.test.bot
2026-11-23 18:00 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox