Add TMAP & GMAP information services
Subsystems (2)
cover Add TMAP & GMAP information services
Add support for TMAP and GMAP services. They contain only device audio capability bitmasks.
Expose the values from remote devices inorg.bluez.MediaEndpoint->SupportedFeatures
Not sure if this should be org.bluez.Device->SupportedFeatures instead.
Sound server can use theses to determine which mandatory capabilities devices have.
Some boilerplate maybe could be avoided by putting these into the BAP service, but did them separately here.
TODO (maybe later): advertise local service values, these could be configured either via config file or endpoint SupportedFeatures. Maybe config file is better?
Pauli Virtanen (10):
shared/tmap: add TMAP Service
test-tmap: add test for TMAP Service
tmap: add TMAP profile
bap: have unicast client wait for VCS & TMAS shared/gmap: add GMAP Service
test-gmap: add test for GMAP Service
gmap: Add GMAP profile
bap: unicast client wait for GMAP service
doc: org.bluez.MediaEndpoint: add SupportedFeatures
bap: add SupportedFeatures for MediaEndpoints
.gitignore | 2 + Makefile.am | 14 + Makefile.plugins | 10 + configure.ac | 14 + doc/org.bluez.MediaEndpoint.rst | 99 +++++++ lib/bluetooth/uuid.h | 12 + profiles/audio/bap.c | 146 +++++++++- profiles/audio/gmap.c | 203 +++++++++++++ profiles/audio/tmap.c | 203 +++++++++++++ src/shared/gmap.c | 402 ++++++++++++++++++++++++++ src/shared/gmap.h | 70 +++++ src/shared/tmap.c | 302 +++++++++++++++++++ src/shared/tmap.h | 39 +++ unit/test-gmap.c | 496 ++++++++++++++++++++++++++++++++ unit/test-tmap.c | 378 ++++++++++++++++++++++++ 15 files changed, 2387 insertions(+), 3 deletions(-) create mode 100644 profiles/audio/gmap.c create mode 100644 profiles/audio/tmap.c create mode 100644 src/shared/gmap.c create mode 100644 src/shared/gmap.h create mode 100644 src/shared/tmap.c create mode 100644 src/shared/tmap.h create mode 100644 unit/test-gmap.c create mode 100644 unit/test-tmap.c
Signature · 1 line
2.51.1
PATCH 1/10 shared/tmap: add TMAP Service
TMAP Service is just a simple service with a Role bitmask.
The value can be used to figure out which TMAP roles the remote device claims it supports (matters for available mandatory features). Also can advertise the same for remote clients.
--- Makefile.am | 1 + lib/bluetooth/uuid.h | 4 + src/shared/tmap.c | 302 +++++++++++++++++++++++++++++++++++++++++++ src/shared/tmap.h | 39 ++++++ 4 files changed, 346 insertions(+) create mode 100644 src/shared/tmap.c create mode 100644 src/shared/tmap.h
Makefile.am +1 -0
@@ -242,6 +242,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \ src/shared/csip.c src/shared/csip.h \ src/shared/bass.h src/shared/bass.c \ src/shared/ccp.h src/shared/ccp.c \ + src/shared/tmap.c src/shared/tmap.h \ src/shared/lc3.h src/shared/tty.h \ src/shared/bap-defs.h \ src/shared/asha.h src/shared/asha.c \
lib/bluetooth/uuid.h +4 -0
@@ -212,6 +212,10 @@ extern "C" {#define MEDIA_CP_OP_SUPPORTED_CHRC_UUID 0x2ba5#define MEDIA_CONTENT_CONTROL_ID_CHRC_UUID 0x2bba +/* Telephony and Media Audio Service */ +#define TMAS_UUID 0x1855 +#define TMAP_ROLE_CHRC_UUID 0x2b51 +/* Coordinated Set Identification Profile(CSIP) */ #define CSIS_UUID 0x1846#define CS_SIRK 0x2B84
src/shared/tmap.c new file +302 -0
302 lines not on this page · raw message
src/shared/tmap.h new file +39 -0
@@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* +* +* BlueZ - Bluetooth protocol stack for Linux +* +* Copyright (C) 2025 Pauli Virtanen. All rights reserved. +* +*/ + +#include <stdbool.h> +#include <inttypes.h> + +#define BT_TMAP_ROLE_CG BIT(0) +#define BT_TMAP_ROLE_CT BIT(1) +#define BT_TMAP_ROLE_UMS BIT(2) +#define BT_TMAP_ROLE_UMR BIT(3) +#define BT_TMAP_ROLE_BMS BIT(4) +#define BT_TMAP_ROLE_BMR BIT(5) +#define BT_TMAP_ROLE_MASK (BIT(6) - 1) + +struct bt_tmap ; + +typedef void (*bt_tmap_ready_func_t )(struct bt_tmap *tmap,void *user_data); +typedef void (*bt_tmap_destroy_func_t )(void *user_data); +typedef void (*bt_tmap_debug_func_t )(const char *str,void *user_data); + +struct bt_tmap *bt_tmap_ref (struct bt_tmap *tmap); +void bt_tmap_unref (struct bt_tmap *tmap); + +struct bt_tmap *bt_tmap_attach (struct bt_gatt_client *client, +bt_tmap_ready_func_t ready,void *user_data); +struct bt_tmap *bt_tmap_find (struct gatt_db *db); +struct bt_tmap *bt_tmap_add_db (struct gatt_db *db); + +uint16_t bt_tmap_get_role (struct bt_tmap *tmap); +void bt_tmap_set_role (struct bt_tmap *tmas,uint16_t role); + +bool bt_tmap_set_debug (struct bt_tmap *tmap,bt_tmap_debug_func_t cb, +void *user_data,bt_tmap_destroy_func_t destroy);
Signature · 1 line
2.51.1
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/project/bluetooth/list/?series=1026711
---Test result---
Test Summary:
CheckPatch PENDING 0.36 seconds GitLint PENDING 0.33 seconds BuildEll PASS 20.28 seconds BluezMake PASS 632.28 seconds MakeCheck PASS 22.34 seconds MakeDistcheck PASS 240.84 seconds CheckValgrind PASS 296.97 seconds CheckSmatch PASS 345.77 seconds bluezmakeextell PASS 182.29 seconds IncrementalBuild PENDING 0.34 seconds ScanBuild PASS 992.33 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth
PATCH 2/10 test-tmap: add test for TMAP Service
In reply to Pauli VirtanenAdd tests on TMAP service for reading the role attribute.
--- .gitignore | 1 + Makefile.am | 6 + unit/test-tmap.c | 378 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 385 insertions(+) create mode 100644 unit/test-tmap.c
.gitignore +1 -0
@@ -118,6 +118,7 @@ unit/test-hog unit/test-bap unit/test-bass unit/test-battery +unit/test-tmap tools/mgmt-tester tools/smp-tester tools/gap-tester
Makefile.am +6 -0
@@ -702,6 +702,12 @@ unit_test_vcp_SOURCES = unit/test-vcp.c $(btio_sources) unit_test_vcp_LDADD = src/libshared-glib.la \ lib/libbluetooth-internal.la $(GLIB_LIBS) +unit_tests += unit/test-tmap + +unit_test_tmap_SOURCES = unit/test-tmap.c $(btio_sources) +unit_test_tmap_LDADD = src/libshared-glib.la \ + lib/libbluetooth-internal.la $(GLIB_LIBS) + unit_tests += unit/test-battery unit_test_battery_SOURCES = unit/test-battery.c
unit/test-tmap.c new file +378 -0
378 lines not on this page · raw message
Signature · 1 line
2.51.1
PATCH 3/10 tmap: add TMAP profile
In reply to Pauli VirtanenRead TMAP Role from remote devices and enable advertising the value for local services.
--- Makefile.plugins | 5 ++ configure.ac | 7 ++ profiles/audio/tmap.c | 203 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+) create mode 100644 profiles/audio/tmap.c
Makefile.plugins +5 -0
@@ -146,6 +146,11 @@ builtin_modules += csip builtin_sources += profiles/audio/csip.c endif +if TMAP +builtin_modules += tmap +builtin_sources += profiles/audio/tmap.c +endif + if ASHA builtin_modules += asha builtin_sources += profiles/audio/asha.h profiles/audio/asha.c
configure.ac +7 -0
@@ -227,6 +227,13 @@ AC_ARG_ENABLE(csip, AS_HELP_STRING([--disable-csip], [disable CSIP profile]), [enable_csip=${enableval}]) AM_CONDITIONAL(CSIP, test "${enable_csip}" != "no") +AC_ARG_ENABLE(tmap, AS_HELP_STRING([--disable-tmap], + [disable TMAP profile]), [enable_tmap=${enableval}]) +AM_CONDITIONAL(TMAP, test "${enable_tmap}" != "no") +if test "${enable_tmap}" != "no"; then + AC_DEFINE(HAVE_TMAP, 1, [Define to 1 if you have TMAP support.]) +fi + AC_ARG_ENABLE(asha, AS_HELP_STRING([--disable-asha], [disable ASHA support]), [enable_asha=${enableval}]) AM_CONDITIONAL(ASHA, test "${enable_asha}" != "no")
profiles/audio/tmap.c new file +203 -0
203 lines not on this page · raw message
Signature · 1 line
2.51.1
PATCH 4/10 bap: have unicast client wait for VCS & TMAS
In reply to Pauli VirtanenHave unicast client to wait for VCS and TMAS before creating endpoints and transports, so that their information is available at that point.
--- profiles/audio/bap.c | 69 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-)
profiles/audio/bap.c +66 -3
@@ -127,6 +127,7 @@ struct bap_data {struct btd_device *device;struct btd_adapter *adapter;struct btd_service *service; +struct queue *wait_services;struct bt_bap *bap;unsigned int ready_id;unsigned int state_id;
@@ -139,6 +140,7 @@ struct bap_data {GIOChannel *listen_io;unsigned int io_id;unsigned int cig_update_id; +unsigned int service_state_id; };static struct queue *sessions;
@@ -186,11 +188,15 @@ static void bap_data_free(struct bap_data *data)queue_destroy (data->bcast, ep_unregister);queue_destroy (data->server_streams,NULL );queue_destroy (data->bcast_snks, setup_free); +queue_destroy (data->wait_services,NULL );bt_bap_ready_unregister (data->bap, data->ready_id);bt_bap_state_unregister (data->bap, data->state_id);bt_bap_pac_unregister (data->bap, data->pac_id);bt_bap_unref (data->bap); +if (data->service_state_id) +btd_service_remove_state_cb (data->service_state_id); +if (data->cig_update_id)g_source_remove (data->cig_update_id);
@@ -2015,13 +2021,16 @@ static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,return true; } -static void bap_ready (struct bt_bap *bap,void *user_data) +static void bap_service_ready (struct bap_data *data) { -struct btd_service *service = user_data; -struct bap_data *data =btd_service_get_user_data (service); +struct bt_bap *bap = data->bap; +struct btd_service *service = data->service;DBG ("bap %p" , bap); +if (!queue_isempty (data->wait_services)) +return ; +/* Register all ep before selecting, so that sound server * knows all. */
@@ -2031,6 +2040,15 @@ static void bap_ready(struct bt_bap *bap, void *user_data)bap_select_all (data, false,NULL ,NULL ); } +static void bap_ready (struct bt_bap *bap,void *user_data) +{ +struct btd_service *service = user_data; +struct bap_data *data =btd_service_get_user_data (service); + +queue_remove (data->wait_services,NULL ); +bap_service_ready (data); +} +static bool match_setup_stream (const void *data,const void *user_data) {const struct bap_setup *setup = data;
@@ -3740,6 +3758,44 @@ static int bap_probe(struct btd_service *service)return 0 ; } +static void wait_service_cb (struct btd_service *service, +btd_service_state_t old_state, +btd_service_state_t new_state, +void *user_data) +{ +struct bap_data *data = user_data; + +if (new_state ==BTD_SERVICE_STATE_CONNECTING ) +return ; +if (!queue_remove (data->wait_services, service)) +return ; + +DBG ("%s" ,btd_service_get_profile (service)->name); +bap_service_ready (data); +} + +static void wait_service_add (struct bap_data *data,uint16_t remote_uuid) +{ +struct btd_service *service; +bt_uuid_t uuid; +char uuid_str[64 ]; + +bt_uuid16_create (&uuid, remote_uuid); +bt_uuid_to_string (&uuid, uuid_str,sizeof (uuid_str)); + + service =btd_device_get_service (data->device, uuid_str); +if (!service) +return ; +if (btd_service_get_state (service) !=BTD_SERVICE_STATE_CONNECTING ) +return ; + +queue_push_tail (data->wait_services, service); + +if (!data->service_state_id) + data->service_state_id =btd_service_add_state_cb ( + wait_service_cb, data); +} +static int bap_accept (struct btd_service *service) {struct btd_device *device =btd_service_get_device (service);
@@ -3760,6 +3816,13 @@ static int bap_accept(struct btd_service *service)return -EINVAL ; } +queue_destroy (data->wait_services,NULL ); + data->wait_services =queue_new (); + +queue_push_tail (data->wait_services,NULL ); +wait_service_add (data,TMAS_UUID ); +wait_service_add (data,VCS_UUID ); +btd_service_connecting_complete (service,0 );return 0 ;
Signature · 1 line
2.51.1
Luiz Augusto von Dentz
maintainerRe: [PATCH BlueZ 04/10] bap: have unicast client wait for VCS & TMAS
Hi Pauli,
Quoted 125 lines · Pauli Virtanen
Have unicast client to wait for VCS and TMAS before creating endpoints and transports, so that their information is available at that point.
--- profiles/audio/bap.c | 69 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-)profiles/audio/bap.c +59
-3@@ -127,6 +127,7 @@ struct bap_data {struct btd_device *device;struct btd_adapter *adapter;struct btd_service *service; +struct queue *wait_services;struct bt_bap *bap;unsigned int ready_id;unsigned int state_id;@@ -139,6 +140,7 @@ struct bap_data {GIOChannel *listen_io;unsigned int io_id;unsigned int cig_update_id; +unsigned int service_state_id; };static struct queue *sessions;@@ -186,11 +188,15 @@ static void bap_data_free(struct bap_data *data)queue_destroy (data->bcast, ep_unregister);queue_destroy (data->server_streams,NULL );queue_destroy (data->bcast_snks, setup_free); +queue_destroy (data->wait_services,NULL );bt_bap_ready_unregister (data->bap, data->ready_id);bt_bap_state_unregister (data->bap, data->state_id);bt_bap_pac_unregister (data->bap, data->pac_id);bt_bap_unref (data->bap); +if (data->service_state_id) +btd_service_remove_state_cb (data->service_state_id); +if (data->cig_update_id)g_source_remove (data->cig_update_id);@@ -2015,13 +2021,16 @@ static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,return true; } -static void bap_ready (struct bt_bap *bap,void *user_data) +static void bap_service_ready (struct bap_data *data) { -struct btd_service *service = user_data; -struct bap_data *data =btd_service_get_user_data (service); +struct bt_bap *bap = data->bap; +struct btd_service *service = data->service;DBG ("bap %p" , bap); +if (!queue_isempty (data->wait_services)) +return ; +/* Register all ep before selecting, so that sound server * knows all. */ @@ -2031,6 +2040,15 @@ static void bap_ready(struct bt_bap *bap, void *user_data)bap_select_all (data, false,NULL ,NULL ); } +static void bap_ready (struct bt_bap *bap,void *user_data) +{ +struct btd_service *service = user_data; +struct bap_data *data =btd_service_get_user_data (service); + +queue_remove (data->wait_services,NULL ); +bap_service_ready (data); +} +static bool match_setup_stream (const void *data,const void *user_data) {const struct bap_setup *setup = data;@@ -3740,6 +3758,44 @@ static int bap_probe(struct btd_service *service)return 0 ; } +static void wait_service_cb (struct btd_service *service, +btd_service_state_t old_state, +btd_service_state_t new_state, +void *user_data) +{ +struct bap_data *data = user_data; + +if (new_state ==BTD_SERVICE_STATE_CONNECTING ) +return ; +if (!queue_remove (data->wait_services, service)) +return ; + +DBG ("%s" ,btd_service_get_profile (service)->name); +bap_service_ready (data); +} + +static void wait_service_add (struct bap_data *data,uint16_t remote_uuid) +{ +struct btd_service *service; +bt_uuid_t uuid; +char uuid_str[64 ]; + +bt_uuid16_create (&uuid, remote_uuid); +bt_uuid_to_string (&uuid, uuid_str,sizeof (uuid_str)); + + service =btd_device_get_service (data->device, uuid_str); +if (!service) +return ; +if (btd_service_get_state (service) !=BTD_SERVICE_STATE_CONNECTING ) +return ; + +queue_push_tail (data->wait_services, service); + +if (!data->service_state_id) + data->service_state_id =btd_service_add_state_cb ( + wait_service_cb, data); +} +static int bap_accept (struct btd_service *service) {struct btd_device *device =btd_service_get_device (service);
profiles/audio/bap.c static int bap_accept(struct btd_service *service) · line 3822
Quoted 7 lines
profiles/audio/bap.c +4
-0@@ -3760,6 +3816,13 @@ static int bap_accept(struct btd_service *service)return -EINVAL ; } +queue_destroy (data->wait_services,NULL ); + data->wait_services =queue_new (); + +queue_push_tail (data->wait_services,NULL );
Why are you pushing NULL above?
profiles/audio/bap.c static int bap_accept(struct btd_service *service) · line 3824
Quoted 2 lines
profiles/audio/bap.c +2
-0+wait_service_add (data,TMAS_UUID ); +wait_service_add (data,VCS_UUID );
I wonder if we couldn't add this sort of logic directly in service.c so in case other plugins need to do some dependency handling like above we don't need to code it internally in the plugin itself creating duplicate handling.
Quoted 7 lines
profiles/audio/bap.c +0
-1btd_service_connecting_complete (service,0 );return 0 ; --2.51.1
Signature · 1 line
Luiz Augusto von Dentz
Re: [PATCH BlueZ 04/10] bap: have unicast client wait for VCS & TMAS
Hi,
24. marraskuuta 2025 16.25.49 UTC Luiz Augusto von Dentz <[email protected]> kirjoitti:
Quoted 131 lines
Hi Pauli,
Quoted 128 lines · Pauli Virtanen
Have unicast client to wait for VCS and TMAS before creating endpoints and transports, so that their information is available at that point.
--- profiles/audio/bap.c | 69 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-)profiles/audio/bap.c +59
-3@@ -127,6 +127,7 @@ struct bap_data {struct btd_device *device;struct btd_adapter *adapter;struct btd_service *service; +struct queue *wait_services;struct bt_bap *bap;unsigned int ready_id;unsigned int state_id;@@ -139,6 +140,7 @@ struct bap_data {GIOChannel *listen_io;unsigned int io_id;unsigned int cig_update_id; +unsigned int service_state_id; };static struct queue *sessions;@@ -186,11 +188,15 @@ static void bap_data_free(struct bap_data *data)queue_destroy (data->bcast, ep_unregister);queue_destroy (data->server_streams,NULL );queue_destroy (data->bcast_snks, setup_free); +queue_destroy (data->wait_services,NULL );bt_bap_ready_unregister (data->bap, data->ready_id);bt_bap_state_unregister (data->bap, data->state_id);bt_bap_pac_unregister (data->bap, data->pac_id);bt_bap_unref (data->bap); +if (data->service_state_id) +btd_service_remove_state_cb (data->service_state_id); +if (data->cig_update_id)g_source_remove (data->cig_update_id);@@ -2015,13 +2021,16 @@ static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,return true; } -static void bap_ready (struct bt_bap *bap,void *user_data) +static void bap_service_ready (struct bap_data *data) { -struct btd_service *service = user_data; -struct bap_data *data =btd_service_get_user_data (service); +struct bt_bap *bap = data->bap; +struct btd_service *service = data->service;DBG ("bap %p" , bap); +if (!queue_isempty (data->wait_services)) +return ; +/* Register all ep before selecting, so that sound server * knows all. */ @@ -2031,6 +2040,15 @@ static void bap_ready(struct bt_bap *bap, void *user_data)bap_select_all (data, false,NULL ,NULL ); } +static void bap_ready (struct bt_bap *bap,void *user_data) +{ +struct btd_service *service = user_data; +struct bap_data *data =btd_service_get_user_data (service); + +queue_remove (data->wait_services,NULL ); +bap_service_ready (data); +} +static bool match_setup_stream (const void *data,const void *user_data) {const struct bap_setup *setup = data;@@ -3740,6 +3758,44 @@ static int bap_probe(struct btd_service *service)return 0 ; } +static void wait_service_cb (struct btd_service *service, +btd_service_state_t old_state, +btd_service_state_t new_state, +void *user_data) +{ +struct bap_data *data = user_data; + +if (new_state ==BTD_SERVICE_STATE_CONNECTING ) +return ; +if (!queue_remove (data->wait_services, service)) +return ; + +DBG ("%s" ,btd_service_get_profile (service)->name); +bap_service_ready (data); +} + +static void wait_service_add (struct bap_data *data,uint16_t remote_uuid) +{ +struct btd_service *service; +bt_uuid_t uuid; +char uuid_str[64 ]; + +bt_uuid16_create (&uuid, remote_uuid); +bt_uuid_to_string (&uuid, uuid_str,sizeof (uuid_str)); + + service =btd_device_get_service (data->device, uuid_str); +if (!service) +return ; +if (btd_service_get_state (service) !=BTD_SERVICE_STATE_CONNECTING ) +return ; + +queue_push_tail (data->wait_services, service); + +if (!data->service_state_id) + data->service_state_id =btd_service_add_state_cb ( + wait_service_cb, data); +} +static int bap_accept (struct btd_service *service) {struct btd_device *device =btd_service_get_device (service);@@ -3760,6 +3816,13 @@ static int bap_accept(struct btd_service *service)return -EINVAL ; }
Quoted 6 lines
profiles/audio/bap.c static int bap_accept(struct btd_service *service) · line 3822
Quoted 4 lines
profiles/audio/bap.c +4
-0+queue_destroy (data->wait_services,NULL ); + data->wait_services =queue_new (); + +queue_push_tail (data->wait_services,NULL );Why are you pushing NULL above?
It's for waiting for bap_ready
Quoted 8 lines
profiles/audio/bap.c static int bap_accept(struct btd_service *service) · line 3824
Quoted 3 lines
profiles/audio/bap.c +2
-0+wait_service_add (data,TMAS_UUID ); +wait_service_add (data,VCS_UUID );I wonder if we couldn't add this sort of logic directly in
service.cso in case other plugins need to do some dependency handling like above we don't need to code it internally in the plugin itself creating duplicate handling.
Could be changed to be generic yes. We also might want to also do conflicts, eg BAP and AVRPC/AVDTP at the same time sometimes happens in practice and devices usually don't like that.
Quoted 10 lines
Quoted 8 lines
profiles/audio/bap.c +0
-1btd_service_connecting_complete (service,0 );return 0 ; --2.51.1
PATCH 5/10 shared/gmap: add GMAP Service
In reply to Pauli VirtanenGMAP Service is just a simple service with bitmasks.
The values can be used to figure out which GMAP roles and features the remote device claims it supports (matters for available mandatory features). Also can advertise the same for remote clients.
--- Makefile.am | 1 + lib/bluetooth/uuid.h | 8 + src/shared/gmap.c | 402 +++++++++++++++++++++++++++++++++++++++++++ src/shared/gmap.h | 70 ++++++++ 4 files changed, 481 insertions(+) create mode 100644 src/shared/gmap.c create mode 100644 src/shared/gmap.h
Makefile.am +1 -0
@@ -243,6 +243,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \ src/shared/bass.h src/shared/bass.c \ src/shared/ccp.h src/shared/ccp.c \ src/shared/tmap.c src/shared/tmap.h \ + src/shared/gmap.c src/shared/gmap.h \ src/shared/lc3.h src/shared/tty.h \ src/shared/bap-defs.h \ src/shared/asha.h src/shared/asha.c \
lib/bluetooth/uuid.h +8 -0
@@ -216,6 +216,14 @@ extern "C" {#define TMAS_UUID 0x1855#define TMAP_ROLE_CHRC_UUID 0x2b51 +/* Gaming Audio Service */ +#define GMAS_UUID 0x1858 +#define GMAP_ROLE_CHRC_UUID 0x2c00 +#define GMAP_UGG_CHRC_UUID 0x2c01 +#define GMAP_UGT_CHRC_UUID 0x2c02 +#define GMAP_BGS_CHRC_UUID 0x2c03 +#define GMAP_BGR_CHRC_UUID 0x2c04 +/* Coordinated Set Identification Profile(CSIP) */ #define CSIS_UUID 0x1846#define CS_SIRK 0x2B84
src/shared/gmap.c new file +402 -0
402 lines not on this page · raw message
src/shared/gmap.h new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.51.1
PATCH 6/10 test-gmap: add test for GMAP Service
In reply to Pauli VirtanenAdd tests on GMAP service for reading the attributes.
--- .gitignore | 1 + Makefile.am | 6 + unit/test-gmap.c | 496 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 503 insertions(+) create mode 100644 unit/test-gmap.c
.gitignore +1 -0
@@ -119,6 +119,7 @@ unit/test-bap unit/test-bass unit/test-battery unit/test-tmap +unit/test-gmap tools/mgmt-tester tools/smp-tester tools/gap-tester
Makefile.am +6 -0
@@ -709,6 +709,12 @@ unit_test_tmap_SOURCES = unit/test-tmap.c $(btio_sources) unit_test_tmap_LDADD = src/libshared-glib.la \ lib/libbluetooth-internal.la $(GLIB_LIBS) +unit_tests += unit/test-gmap + +unit_test_gmap_SOURCES = unit/test-gmap.c $(btio_sources) +unit_test_gmap_LDADD = src/libshared-glib.la \ + lib/libbluetooth-internal.la $(GLIB_LIBS) + unit_tests += unit/test-battery unit_test_battery_SOURCES = unit/test-battery.c
unit/test-gmap.c new file +496 -0
496 lines not on this page · raw message
Signature · 1 line
2.51.1
PATCH 7/10 gmap: Add GMAP profile
In reply to Pauli VirtanenRead GMAP properties from remote devices and enable advertising the values for local services.
--- Makefile.plugins | 5 ++ configure.ac | 7 ++ profiles/audio/gmap.c | 203 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+) create mode 100644 profiles/audio/gmap.c
Makefile.plugins +5 -0
@@ -151,6 +151,11 @@ builtin_modules += tmap builtin_sources += profiles/audio/tmap.c endif +if GMAP +builtin_modules += gmap +builtin_sources += profiles/audio/gmap.c +endif + if ASHA builtin_modules += asha builtin_sources += profiles/audio/asha.h profiles/audio/asha.c
configure.ac +7 -0
@@ -234,6 +234,13 @@ if test "${enable_tmap}" != "no"; then AC_DEFINE(HAVE_TMAP, 1, [Define to 1 if you have TMAP support.]) fi +AC_ARG_ENABLE(gmap, AS_HELP_STRING([--disable-gmap], + [disable GMAP profile]), [enable_gmap=${enableval}]) +AM_CONDITIONAL(GMAP, test "${enable_gmap}" != "no") +if test "${enable_gmap}" != "no"; then + AC_DEFINE(HAVE_GMAP, 1, [Define to 1 if you have GMAP support.]) +fi + AC_ARG_ENABLE(asha, AS_HELP_STRING([--disable-asha], [disable ASHA support]), [enable_asha=${enableval}]) AM_CONDITIONAL(ASHA, test "${enable_asha}" != "no")
profiles/audio/gmap.c new file +203 -0
203 lines not on this page · raw message
Signature · 1 line
2.51.1
PATCH 8/10 bap: unicast client wait for GMAP service
In reply to Pauli VirtanenWait until GMAP properties (if any) are read before configuring endpoints and transports as BAP Client.
--- profiles/audio/bap.c | 1 + 1 file changed, 1 insertion(+)
profiles/audio/bap.c +1 -0
@@ -3821,6 +3821,7 @@ static int bap_accept(struct btd_service *service)queue_push_tail (data->wait_services,NULL );wait_service_add (data,TMAS_UUID ); +wait_service_add (data,GMAS_UUID );wait_service_add (data,VCS_UUID );btd_service_connecting_complete (service,0 );
Signature · 1 line
2.51.1
PATCH 9/10 doc: org.bluez.MediaEndpoint: add SupportedFeatures
In reply to Pauli VirtanenAdd SupportedFeatures field for indicating TMAP & GMAP roles and features.
--- doc/org.bluez.MediaEndpoint.rst | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)
doc/org.bluez.MediaEndpoint.rst +99 -0
@@ -299,3 +299,102 @@ Indicates QoS capabilities. :uint32 PreferredMaximumDelay: Indicates endpoint preferred maximum presentation delay. + +array{string} SupportedFeatures [readonly, ISO only, experimental] +`````````````````````````````````````````````````````````````````` + +List of strings that represent supported features. + +Possible values: + +:"tmap-cg": + + TMAP Call Gateway + +:"tmap-ct": + + TMAP Call Terminal + +:"tmap-ums": + + TMAP Unicast Media Sender + +:"tmap-umr": + + TMAP Unicast Media Receiver + +:"tmap-bms": + + TMAP Broadcast Media Sender + +:"tmap-bmr": + + TMAP Broadcast Media Receiver + +:"gmap-ugg": + + GMAP Unicast Game Gateway + +:"gmap-ugt": + + GMAP Unicast Game Terminal + +:"gmap-bgs": + + GMAP Broadcast Game Sender + +:"gmap-bgr": + + GMAP Broadcast Game Receiver + +:"gmap-ugg-multiplex": + + GMAP UGG Multiplex feature support + +:"gmap-ugg-96kbps-source": + + GMAP UGG 96 kbps Source feature support + +:"gmap-ugg-multisink": + + GMAP UGG Multisink feature support + +:"gmap-ugt-source": + + GMAP UGT Source feature support + +:"gmap-ugt-80kbps-souce": + + GMAP UGT 80 kbps Source feature support + +:"gmap-ugt-sink": + + GMAP UGT Sink feature support + +:"gmap-ugt-64kbps-sink": + + GMAP UGT 64 kbps Sink feature support + +:"gmap-ugt-multiplex": + + GMAP UGT Multiplex feature support + +:"gmap-ugt-multisink": + + GMAP UGT Multisink feature support + +:"gmap-ugt-multisource": + + GMAP UGT Multisource feature support + +:"gmap-bgs-96kbps": + + GMAP BGS 96 kbps feature support + +:"gmap-bgr-multisink": + + GMAP BGR Multisink feature support + +:"gmap-bgr-multiplex": + + GMAP BGR Multiplex feature support
Signature · 1 line
2.51.1
Luiz Augusto von Dentz
maintainerRe: [PATCH BlueZ 09/10] doc: org.bluez.MediaEndpoint: add SupportedFeatures
Hi Pauli,
Quoted 115 lines · Pauli Virtanen
Add SupportedFeatures field for indicating TMAP & GMAP roles and features.
--- doc/org.bluez.MediaEndpoint.rst | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)doc/org.bluez.MediaEndpoint.rst +99
-1@@ -299,3 +299,102 @@ Indicates QoS capabilities. :uint32 PreferredMaximumDelay: Indicates endpoint preferred maximum presentation delay. + +array{string} SupportedFeatures [readonly, ISO only, experimental] +`````````````````````````````````````````````````````````````````` + +List of strings that represent supported features. + +Possible values: + +:"tmap-cg": + + TMAP Call Gateway + +:"tmap-ct": + + TMAP Call Terminal + +:"tmap-ums": + + TMAP Unicast Media Sender + +:"tmap-umr": + + TMAP Unicast Media Receiver + +:"tmap-bms": + + TMAP Broadcast Media Sender + +:"tmap-bmr": + + TMAP Broadcast Media Receiver + +:"gmap-ugg": + + GMAP Unicast Game Gateway + +:"gmap-ugt": + + GMAP Unicast Game Terminal + +:"gmap-bgs": + + GMAP Broadcast Game Sender + +:"gmap-bgr": + + GMAP Broadcast Game Receiver + +:"gmap-ugg-multiplex": + + GMAP UGG Multiplex feature support + +:"gmap-ugg-96kbps-source": + + GMAP UGG 96 kbps Source feature support + +:"gmap-ugg-multisink": + + GMAP UGG Multisink feature support + +:"gmap-ugt-source": + + GMAP UGT Source feature support + +:"gmap-ugt-80kbps-souce": + + GMAP UGT 80 kbps Source feature support + +:"gmap-ugt-sink": + + GMAP UGT Sink feature support + +:"gmap-ugt-64kbps-sink": + + GMAP UGT 64 kbps Sink feature support + +:"gmap-ugt-multiplex": + + GMAP UGT Multiplex feature support + +:"gmap-ugt-multisink": + + GMAP UGT Multisink feature support + +:"gmap-ugt-multisource": + + GMAP UGT Multisource feature support + +:"gmap-bgs-96kbps": + + GMAP BGS 96 kbps feature support + +:"gmap-bgr-multisink": + + GMAP BGR Multisink feature support + +:"gmap-bgr-multiplex": + + GMAP BGR Multiplex feature support --
Quoted 1 line
2.51.1
I wonder if it would make sense to add a sublevel as UUID followed by the feature set, this is a little bit more streamline since there is just one level though since you are prefixing the profile friendly name, that said I think it having a multilevel is probably going to be easier to maintain since the value domain would be per UUID rather than global.
Signature · 1 line
Luiz Augusto von Dentz
Re: [PATCH BlueZ 09/10] doc: org.bluez.MediaEndpoint: add SupportedFeatures
Hi,
24. marraskuuta 2025 16.20.28 UTC Luiz Augusto von Dentz <[email protected]> kirjoitti:
Quoted 118 lines
Hi Pauli,
Quoted 115 lines · Pauli Virtanen
Add SupportedFeatures field for indicating TMAP & GMAP roles and features.
--- doc/org.bluez.MediaEndpoint.rst | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)doc/org.bluez.MediaEndpoint.rst +99
-1@@ -299,3 +299,102 @@ Indicates QoS capabilities. :uint32 PreferredMaximumDelay: Indicates endpoint preferred maximum presentation delay. + +array{string} SupportedFeatures [readonly, ISO only, experimental] +`````````````````````````````````````````````````````````````````` + +List of strings that represent supported features. + +Possible values: + +:"tmap-cg": + + TMAP Call Gateway + +:"tmap-ct": + + TMAP Call Terminal + +:"tmap-ums": + + TMAP Unicast Media Sender + +:"tmap-umr": + + TMAP Unicast Media Receiver + +:"tmap-bms": + + TMAP Broadcast Media Sender + +:"tmap-bmr": + + TMAP Broadcast Media Receiver + +:"gmap-ugg": + + GMAP Unicast Game Gateway + +:"gmap-ugt": + + GMAP Unicast Game Terminal + +:"gmap-bgs": + + GMAP Broadcast Game Sender + +:"gmap-bgr": + + GMAP Broadcast Game Receiver + +:"gmap-ugg-multiplex": + + GMAP UGG Multiplex feature support + +:"gmap-ugg-96kbps-source": + + GMAP UGG 96 kbps Source feature support + +:"gmap-ugg-multisink": + + GMAP UGG Multisink feature support + +:"gmap-ugt-source": + + GMAP UGT Source feature support + +:"gmap-ugt-80kbps-souce": + + GMAP UGT 80 kbps Source feature support + +:"gmap-ugt-sink": + + GMAP UGT Sink feature support + +:"gmap-ugt-64kbps-sink": + + GMAP UGT 64 kbps Sink feature support + +:"gmap-ugt-multiplex": + + GMAP UGT Multiplex feature support + +:"gmap-ugt-multisink": + + GMAP UGT Multisink feature support + +:"gmap-ugt-multisource": + + GMAP UGT Multisource feature support + +:"gmap-bgs-96kbps": + + GMAP BGS 96 kbps feature support + +:"gmap-bgr-multisink": + + GMAP BGR Multisink feature support + +:"gmap-bgr-multiplex": + + GMAP BGR Multiplex feature support --
Quoted 9 lines
Quoted 1 line
2.51.1
I wonder if it would make sense to add a sublevel as UUID followed by the feature set, this is a little bit more streamline since there is just one level though since you are prefixing the profile friendly name, that said I think it having a multilevel is probably going to be easier to maintain since the value domain would be per UUID rather than global.
dict uuid -> array of strings should work to group them per service
String arrays may be a bit simpler for clients to parse though, but I guess can get more messy if list grows bigger
Quoted 1 line
PATCH 10/10 bap: add SupportedFeatures for MediaEndpoints
In reply to Pauli VirtanenIndicate TMAP & GMAP capabilities in SupportedFeatures.
--- profiles/audio/bap.c | 76 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
profiles/audio/bap.c +76 -0
@@ -46,6 +46,8 @@#include "src/shared/gatt-client.h" #include "src/shared/gatt-server.h" #include "src/shared/bap.h" +#include "src/shared/tmap.h" +#include "src/shared/gmap.h" #include "btio/btio.h" #include "src/plugin.h"
@@ -444,6 +446,78 @@ static gboolean get_qos(const GDBusPropertyTable *property,return TRUE; } +static bool probe_tmap_role (struct bap_ep *ep,uint32_t data) +{ +struct gatt_db *db =bt_bap_get_db (ep->data->bap, true); + +return bt_tmap_get_role (bt_tmap_find (db)) & data; +} + +static bool probe_gmap_role (struct bap_ep *ep,uint32_t data) +{ +struct gatt_db *db =bt_bap_get_db (ep->data->bap, true); + +return bt_gmap_get_role (bt_gmap_find (db)) & data; +} + +static bool probe_gmap_feature (struct bap_ep *ep,uint32_t data) +{ +struct gatt_db *db =bt_bap_get_db (ep->data->bap, true); + +return bt_gmap_get_features (bt_gmap_find (db)) & data; +} + +static const struct { +const char *name; +bool (*probe)(struct bap_ep *ep,uint32_t data); +uint32_t data; +} features[] = { + {"tmap-cg" , probe_tmap_role,BT_TMAP_ROLE_CG }, + {"tmap-ct" , probe_tmap_role,BT_TMAP_ROLE_CT }, + {"tmap-ums" , probe_tmap_role,BT_TMAP_ROLE_UMS }, + {"tmap-umr" , probe_tmap_role,BT_TMAP_ROLE_UMR }, + {"tmap-bms" , probe_tmap_role,BT_TMAP_ROLE_BMS }, + {"tmap-bmr" , probe_tmap_role,BT_TMAP_ROLE_BMR }, + {"gmap-ugg" , probe_gmap_role,BT_GMAP_ROLE_UGG }, + {"gmap-ugt" , probe_gmap_role,BT_GMAP_ROLE_UGT }, + {"gmap-bgs" , probe_gmap_role,BT_GMAP_ROLE_BGS }, + {"gmap-bgr" , probe_gmap_role,BT_GMAP_ROLE_BGR }, + {"gmap-ugg-multiplex" , probe_gmap_feature,BT_GMAP_UGG_MULTIPLEX }, + {"gmap-ugg-96kbps-source" , probe_gmap_feature,BT_GMAP_UGG_96KBPS }, + {"gmap-ugg-multisink" , probe_gmap_feature,BT_GMAP_UGG_MULTISINK }, + {"gmap-ugt-source" , probe_gmap_feature,BT_GMAP_UGT_SOURCE }, + {"gmap-ugt-80kbps-source" , probe_gmap_feature, +BT_GMAP_UGT_80KBPS_SOURCE }, + {"gmap-ugt-sink" , probe_gmap_feature,BT_GMAP_UGT_SINK }, + {"gmap-ugt-64kbps-sink" , probe_gmap_feature,BT_GMAP_UGT_64KBPS_SINK }, + {"gmap-ugt-multiplex" , probe_gmap_feature,BT_GMAP_UGT_MULTIPLEX }, + {"gmap-ugt-multisink" , probe_gmap_feature,BT_GMAP_UGT_MULTISINK }, + {"gmap-ugt-multisource" , probe_gmap_feature,BT_GMAP_UGT_MULTISOURCE }, + {"gmap-bgs-96kbps" , probe_gmap_feature,BT_GMAP_BGS_96KBPS }, + {"gmap-bgr-multisink" , probe_gmap_feature,BT_GMAP_BGR_MULTISINK }, + {"gmap-bgr-multiplex" , probe_gmap_feature,BT_GMAP_BGR_MULTIPLEX }, +}; + +static gboolean supported_features (const GDBusPropertyTable *property, +DBusMessageIter *iter,void *data) +{ +struct bap_ep *ep = data; +DBusMessageIter entry; +size_t i; + +dbus_message_iter_open_container (iter,DBUS_TYPE_ARRAY , +DBUS_TYPE_STRING_AS_STRING , &entry); + +for (i =0 ; i <ARRAY_SIZE (features); ++i) +if (features[i].probe (ep, features[i].data)) +dbus_message_iter_append_basic (&entry,DBUS_TYPE_STRING , + &features[i].name); + +dbus_message_iter_close_container (iter, &entry); + +return TRUE; +} +static const GDBusPropertyTable ep_properties[] = { {"UUID" ,"s" , get_uuid,NULL ,NULL ,G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
@@ -463,6 +537,8 @@ static const GDBusPropertyTable ep_properties[] = { G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, {"QoS" ,"a{sv}" , get_qos,NULL , qos_exists, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "SupportedFeatures", "as", supported_features, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { } };
Signature · 1 line
2.51.1
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, 23 Nov 2025 18:17:05 +0200 you wrote:
Add support for TMAP and GMAP services. They contain only device audio capability bitmasks.
Expose the values from remote devices in
org.bluez.MediaEndpoint->SupportedFeaturesNot sure if this should be
org.bluez.Device->SupportedFeaturesinstead.[...]
Here is the summary with links:
- [BlueZ,01/10] shared/tmap: add TMAP Service
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=12e32efac2e4 - [BlueZ,02/10] test-tmap: add test for TMAP Service https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7b93dae26a57 - [BlueZ,03/10] tmap: add TMAP profile https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0f56b20f9196
- [BlueZ,04/10] bap: have unicast client wait for VCS & TMAS (no matching commit)
- [BlueZ,05/10] shared/gmap: add GMAP Service
(no matching commit)
- [BlueZ,06/10] test-gmap: add test for GMAP Service
(no matching commit)
- [BlueZ,07/10] gmap: Add GMAP profile
(no matching commit)
- [BlueZ,08/10] bap: unicast client wait for GMAP service (no matching commit)
- [BlueZ,09/10] doc: org.bluez.MediaEndpoint: add SupportedFeatures (no matching commit)
- [BlueZ,10/10] bap: add SupportedFeatures for MediaEndpoints (no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html