From 9474030582f76e8dafa75c4449c502ee60461b18 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 21 Jan 2024 20:16:13 +0200 Subject: [PATCH] bluez5: determine available BAP profiles from remote endpoints The PAC profile UUIDs do not appear in the UUID list, but are still useful to know before SelectProperties. Set them ahead of time based on the visible remote endpoints. --- spa/plugins/bluez5/bluez5-dbus.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 84a5fd7ef..e83853e78 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -2680,6 +2680,19 @@ static int remote_endpoint_update_props(struct spa_bt_remote_endpoint *remote_en next: dbus_message_iter_next(props_iter); } + + /* BAP profile UUIDs do not appear in device UUID list. + * Instead, we detect these capabilities based on available + * endpoints (i.e. PACs). + */ + if (remote_endpoint->uuid && remote_endpoint->device) { + enum spa_bt_profile profile; + + profile = spa_bt_profile_from_uuid(remote_endpoint->uuid); + if (profile & SPA_BT_PROFILE_BAP_AUDIO) + spa_bt_device_add_profile(remote_endpoint->device, profile); + } + return 0; }