1Bluetooth: Gaming Audio Profile Shell
2#####################################
3
4This document describes how to run the Gaming Audio Profile shell functionality.
5Unlike most other low-layer profiles, GMAP is a profile that exists and has a service (GMAS) on all
6devices. Thus both the initiator and acceptor (or central and peripheral) should do a discovery of
7the remote device's GMAS to see what GMAP roles and features they support.
8
9Using the GMAP Shell
10********************
11
12When the Bluetooth stack has been initialized (:code:`bt init`), the GMAS can be registered by
13by calling :code:`gmap init`. It is also strongly suggested to enable BAP via :code:`bap init`.
14
15.. code-block:: console
16
17   uart:~$ gmap --help
18   gmap - Bluetooth GMAP shell commands
19   Subcommands:
20     init      : [none]
21     set_role  : [ugt | ugg | bgr | bgs]
22     discover  : [none]
23     ac_1      : Unicast audio configuration 1
24     ac_2      : Unicast audio configuration 2
25     ac_3      : Unicast audio configuration 3
26     ac_4      : Unicast audio configuration 4
27     ac_5      : Unicast audio configuration 5
28     ac_6_i    : Unicast audio configuration 6(i)
29     ac_6_ii   : Unicast audio configuration 6(ii)
30     ac_7_ii   : Unicast audio configuration 7(ii)
31     ac_8_i    : Unicast audio configuration 8(i)
32     ac_8_ii   : Unicast audio configuration 8(ii)
33     ac_11_i   : Unicast audio configuration 11(i)
34     ac_11_ii  : Unicast audio configuration 11(ii)
35     ac_12     : Broadcast audio configuration 12
36     ac_13     : Broadcast audio configuration 13
37     ac_14     : Broadcast audio configuration 14
38
39The :code:`set_role` command can be used to change the role at runtime, assuming that the device
40supports the role (the GMAP roles depend on some BAP configurations).
41
42Example Central with GMAP UGT role
43**********************************
44
45Connect and establish Gaming Audio streams using Audio Configuration (AC) 3
46(some logging has been omitted for clarity):
47
48.. code-block:: console
49
50   uart:~$ bt init
51   uart:~$ bap init
52   uart:~$ gmap init
53   uart:~$ bt connect <address>
54   uart:~$ gatt exchange-mtu
55   uart:~$ bap discover
56   Discover complete: err 0
57   uart:~$ cap_initiator discover
58   discovery completed with CSIS
59   uart:~$ gmap discover
60   gmap discovered for conn 0x2001c7d8:
61        role 0x0f
62        ugg_feat 0x07
63        ugt_feat 0x6f
64        bgs_feat 0x01
65        bgr_feat 0x03
66   uart:~$ bap preset sink 32_2_gr
67   uart:~$ bap preset source 32_2_gs
68   uart:~$ gmap ac_3
69   Starting 2 streams for AC_3
70   stream 0x20020060 config operation rsp_code 0 reason 0
71   stream 0x200204d0 config operation rsp_code 0 reason 0
72   stream 0x200204d0 qos operation rsp_code 0 reason 0
73   stream 0x20020060 qos operation rsp_code 0 reason 0
74   Stream 0x20020060 enabled
75   stream 0x200204d0 enable operation rsp_code 0 reason 0
76   Stream 0x200204d0 enabled
77   stream 0x20020060 enable operation rsp_code 0 reason 0
78   Stream 0x20020060 started
79   stream 0x200204d0 start operation rsp_code 0 reason 0
80   Stream 0x200204d0 started
81   Unicast start completed
82   uart:~$ bap start_sine
83   Started transmitting on default_stream 0x20020060
84   [0]: stream 0x20020060 : TX LC3: 80 (seq_num 24800)
85