Bluetooth® LE audio - Gaming Audio Profile


1. Introduction

The Gaming Audio Profile is a Bluetooth® LE Audio Profile specified by the Bluetooth SIG. It is categorized as a "use-case profile", meaning that it is a high-layer profile designed for a specific use case. The complete specification can be found on the Bluetooth SIG website[1].

Figure 1.1 Location of GMAP inside Bluetooth® Low Energy Audio Profiles architecture


The GMAP adresses the use-case of Gaming Audio Device, like gaming headsets. It introduces new Quality of Service (QoS) configurations to allow lower latencies and defines features capabilities to provide information about supported configurations using the Gaming Audio Service (GMAS).

2. GMAP Specification

The full GMAP specification is available on the Bluetooth Website [1].

2.1. Roles

The GMAP introduces four different roles:

  • Unicast Game Terminal (UGT): Role implemented by gaming devices like gaming headsets, earbuds or wireless microphones. Can receive audio stream as Unicast Server and implement Gaming Audio Service as Server and Client to exchange configuration capabilities.
  • Unicast Game Gateway (UGG): Connects to game terminals to stream audio data as Unicast Client and implement Gaming Audio Service as Server and Client to exchange configuration capabilities. Example of devices supporting this role are smartphones, gaming consoles, PCs, ...
  • Broadcast Game Receiver (BGR): Based on the BAP Broadcast Sink, it concerns devices rendering gaming audio using broadcast. Example of devices supporting this role are gaming headsets, earbuds, wireless microphones, ...
  • Broadcast Game Sender (BGS): Based on the BAP Broadcast Source, it concerns devices able to send gaming audio content using broadcast. Example of devices supporting this role are smartphones, gaming consoles, PCs, ...

The requirements for the four roles are the following:

Table 2.1 Requirements of GMAP Roles
GMAP Role CAP Roles BAP Roles GAP Roles VCP Roles
Unicast Game Terminal (UGT) Acceptor Unicast Server Peripheral Volume Renderer*
Unicast Game Gateway (UGG) Initiator & Commander Unicast Client Central Volume Controller
Broadcast Game Receiver (BGR) Acceptor Broadcast Sink Observer & Peripheral Volume Renderer
Broadcast Game Sender (BGS) Initiator & Commander Broadcast Source Broadcaster None

(*) Only if the device supports audio role sink

2.2. GMAP Features

The Gaming Audio Service (GMAS) allows to declare supported features for each roles, which permits remote devices to know which concurrent Quality of Service Configurations are supported.

2.2.1. UGT Features

The following table details the different UGT features and their possible values. The possible values should be used as a bitfield to create a UGT Features value.

Table 2.1 UGT features
Feature Description Value
Source Indicates if the UGT device supports Audio Source Role UGT_FEATURES_SOURCE_SUPPORT
80 kbps Source Indicates if the UGT device supports sending streams with 80 kbps (48_1_gs or 48_2_gs) QoS configurations UGT_FEATURES_80_KBPS_SOURCE_SUPPORT
Sink Indicates if the UGT device supports Audio Sink Role UGT_FEATURES_SINK_SUPPORT
64 kbps Sink Indicates if the UGT device supports receiving streams with 64 kbps (32_1_gs or 32_2_gs) QoS configurations UGT_FEATURES_64_KBPSSINK_SUPPORT
Multiplex Indicates if the UGT device supports receiving multiple channels on one ASE (config 4 & 5) UGT_FEATURES_MULTIPLEX_SUPPORT
Multisink Indicates if the UGT device supports receiving multiple audio channels (config 4, 5, 6(i), 8(i), 11(i)) UGT_FEATURES_MULTISINK_SUPPORT
Multisource Indicates if the UGT device supports sending multiple audio channels (config 11(i)) UGT_FEATURES_MULTISOURCE_SUPPORT

2.2.2. UGG Features

The following table details the different UGG features and their possible values. The possible values should be used as a bitfield to create a UGG Features value.

Table 2.1 UGG features
Feature Description Value
Multiplex Indicates if the UGG device supports sending multiple channels on one ASE (config 4 & 5) UGG_FEATURES_MULTIPLEX_SUPPORT
96 kbps Source Indicates if the UGG device supports sending streams with 96 kbps (48_3_gr or 48_4_gr) QoS configurations UGG_FEATURES_96_KBPS_SOURCE_SUPPORT
Multisink Indicates if the UGG device supports receiving 2 sink streams (config 11) UGG_FEATURES_MULTISINK_SUPPORT

2.2.3. BGR Features

The following table details the different BGR features and their possible values. The possible values should be used as a bitfield to create a BGR Features value.

Table 2.1 BGR features
Feature Description Value
Multisink Indicates if the BGR device supports receiving 2 sink streams (config 13) BGR_FEATURES_MULTISINK_SUPPORT
Multiplex Indicates if the BGR device supports receiving multiple channels on one ASE (config 14) BGR_FEATURES_MULTIPLEX_SUPPORT

2.2.4. BGS Features

The following table details the different BGS features and their possible values. The possible values should be used as a bitfield to create a BGS Features value.

Table 2.1 BGS features
Feature Description Value
96 kbps Indicates if the BGS device supports sending streams with 96 kbps (48_3_gr or 48_4_gr) QoS configurations BGS_FEATURES_96_KBPS_SOURCE_SUPPORT

2.3. GMAP Advertising

A device implementing GMAP with BGR or UGT roles shall put the Gaming Audio Service UUID in the Service UUID AD Type field of its advertising data, along with an Appearance AD type.

3. Gaming Audio Profile application APIs

The following APIs are available for the GMAP

3.1. GMAP initialization

1. First initialize the use-case device management module:

USECASE_DEV_MGMT_Init();

2. Then, initialize the GMAP with a GMAP_Role_t, a UGGFeatures_t, a UGTFeatures_t, a BGSFeatures_t and a BGRFeatures_t:

GMAP_Role_t role = GMAP_ROLE_UNICAST_GAME_TERMINAL | GMAP_ROLE_BROADCAST_GAME_RECEIVER;
UGGFeatures_t ugg_features = 0;
UGGFeatures_t ugt_features = UGT_FEATURES_SOURCE_SUPPORT | UGT_FEATURES_SINK_SUPPORT | UGT_FEATURES_64_KBPSSINK_SUPPORT | UGT_FEATURES_MULTISINK_SUPPORT | UGT_FEATURES_MULTIPLEX_SUPPORT;
UGGFeatures_t bgs_features = 0;
UGGFeatures_t bgr_features = BGR_FEATURES_MULTISINK_SUPPORT | BGR_FEATURES_MULTIPLEX_SUPPORT;
GMAP_Init(role, ugg_features, ugt_features, bgs_features, bgr_features);

3.2. Linkup remote GMAP server

To perform linkup on a remote GMAP server, use the dedicated API.

/* Linkup remote GMAP Server */
GMAP_Linkup(ConnHandle);

At the end of the linkup process, the GMAP_LINKUP_COMPLETE_EVT event is generated:

void GMAP_Notification(GMAP_Notification_Evt_t *pNotification)
{
  switch(pNotification->EvtOpcode)
  {
    case GMAP_LINKUP_COMPLETE_EVT:
    {
      /* GMAP_AttServiceInfo_Evt_t contains:
            - GMAP Role
            - UGG Features
            - UGT Features
            - BGS Features
            - BGR Features 
            - Start handle of GMAS 
            - End handle of GMAS */
      GMAP_AttServiceInfo_Evt_t *p_gmap_info = (GMAP_AttServiceInfo_Evt_t *) pNotification->pInfo;
      break;
    }
  }
}

4. GMAP demonstrator using STM32WBA

The STM32WBA cube firmware allows to easily build and deploy GMAP Peripheral and GMAP Central applications.

4.1. Project architecture

The figure below represents the firmware architecture of the GMAP Peripheral/Central example projects inside the STM32CubeWBA MCU package.

Figure 4.1 GMAP projects file architecture

4.2. GMAP demonstrator menus

The two GMAP projects present in STM32WBA cube firmware implement a menu displayed on the OLED screen of the STM32WBA65I-DK.

4.2.1. GMAP Peripheral screens

The following diagram shows and describes the screens on the GMAP Peripheral application:

Figure 4.2 GMAP Peripheral screens


The Audio Config submenu in the Startup Menu allows to configure the device type of the local GMAP Peripheral device (Select the configuration with Joystick Up/Down and validate with Joystick Left) :

  • Headphones (default)
  • Earbud Right
  • Earbud Left

Earbud Left and Earbud Right are types of devices identified as a Set Member of a Coordinated Set (see Coordinated Devices wiki page[2]). When launching a GMAP Peripheral project on a board in Earbud Left configuration and another on a board in Earbud Right configuration, the two boards form a Coordinated Set. A remote GMAP Central device (Set Coordinator) is then able to identify the two boards as a Coordinated Set in its audio feature processes.

4.2.2. GMAP Central Screens

The following diagram shows and describes the screens on the GMAP Central application:

Figure 4.3 GMAP Central Screens

4.3. Unicast Demo using two STM32WBA

4.3.1. Required Hardwares

This demonstrator requires the following hardware:

  • 2x STM32WBA65I-DK boards
  • 1x Headphones/Headset with a 3.5mm jack cable, optionally with a microphone in which case the jack is 4-pin.

Additionally, as an audio source on the GMAP Central side, one of the following can be used:

  • 1x music source with a 3.5mm jack output (Laptop or smartphone with a jack output). If the music source is powered using a power supply, use a Ground Loop isolator device or unplug the power supply to run the music source on battery to avoid Ground Loop issues
  • 1x headset with microphone

4.3.2. Setup

The setup is as follows:

Figure 4.4 GMAP demonstrator setup (two STM32WBA)

4.3.3. Operate demonstrator

The two projects integrate a menu to operate the demonstrator.

1. To establish the connection between the two STM32WBAs, press the right direction on the joystick of the GMAP Peripheral and select "Start Adv." to start advertising, then press the right direction on the joystick of the GMAP Central and select "Start Scan" to start scanning. Select your device in the list and press the right direction to initiate the connection.

2. Once the linkup is done on each side, access the menu using the right direction of the joystick

  • To start or stop an audio stream, navigate to the “Audio stream” submenu on the GMAP Central target and select the desired item listed
  • To operate the GMAP Central volume, navigate to the “Local volume” on the GMAP Central target
  • To operate the GMAP Peripheral volume, navigate to the “Remote Volume” submenu on the GMAP Central target, or navigate to the “Volume” submenu on the GMAP Peripheral target
  • To control the GMAP Peripheral microphone mute status, navigate to the “Microphone” submenu on the GMAP Central or Peripheral target

The following configurations are used in the GMAP Central project:

Table 4.2 GMAP Central Codec and audio Configurations
Configuration BAP audio configuration Legend Codec configuration Central->Peripheral Codec configuration Peripheral->Central
Game + Voice 8(i) ------->
<------>
32_2_gr 16_2_gs
Game 6(i) ------->
------->
48_4_gr None
Voice 3 <------> 32_2_gr 32_2_gs
Voice Record 2 <------- None 48_4_gs

5. References