Linux bluetooth development
 help / color / mirror / Atom feed
From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>
Subject: [PATCH BlueZ 2/2] media: Signal SupportedUUIDs when the adapter's ISO settings change
Date: Sun, 22 Nov 2026 11:50:26 +0100	[thread overview]
Message-ID: <20261122105026.753191-2-simon.mikuda@streamunlimited.com> (raw)
In-Reply-To: <20261122105026.753191-1-simon.mikuda@streamunlimited.com>

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 | 22 ++++++++++++++++++++++
 profiles/audio/media.h |  1 +
 3 files changed, 24 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..78eb0982f 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -3864,6 +3864,28 @@ 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


  reply	other threads:[~2026-11-22 10:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 10:50 [PATCH BlueZ 1/2] adapter: Notify adapter drivers of settings changes Simon Mikuda
2026-11-22 10:50 ` Simon Mikuda [this message]
2026-11-22 18:54 ` [BlueZ,1/2] " bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261122105026.753191-2-simon.mikuda@streamunlimited.com \
    --to=simon.mikuda@streamunlimited.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox