Bluetooth LE Audio - STM32WBA Public Broadcast Profile

Revision as of 15:13, 17 October 2023 by Registered User (→‎PBP Source Advertising details)
Under construction.png Coming soon

1. Public Broadcast Profile

1.1. Introduction

The Public Broadcast Profile (PBP) is a BLE Audio profile specified by the Bluetooth SIG. It's categorized as a "use-case profile", meaning that it's a high-layer profile designed for a specific use case. The complete specification can be found on the Bluetooth SIG website[1]. Location of PBP inside BLE Audio Profiles architecture

The PBP addresses the use case of a broadcast in a public space, accessible by many people simultaneously: a train station, an airport or a public TV for example. It's based on the BLE Audio broadcast feature, as described in the wiki page "Introduction to Bluetooth LE Audio", which is publicly advertised as "Auracast" by the Bluetooth SIG. Due to the nature of the broadcast feature, which permits to send audio streams unidirectionally without ACL connection, an unlimited number of devices can synchronize to a single Broadcast Source.

The PBP introduces 3 different roles:

  • Public Broadcast Source (PBS): It's based on the BAP Broadcast Source, but adds additional fields to the extended advertising data payload, to facilitate discovery and synchronization of Public Broadcast Sinks
  • Public Broadcast Sink (PBK): It's based on the BAP Broadcast Sink and is able to read the additional extended advertising data fields of the PBS
  • Public Broadcast Assistant (PBA): It's based on the BAP Broadcast Assistant and is able to control the reception of a Broadcast Audio Stream on a PBK.

1.2. Public Broadcast Announcement

The Public Broadcast Announcement is a service data field added by the PBS to give extra context a a Source content. It permits the PBK to know, before even synchronizing the the Periodic Advertising train, if the source is compatible with him or not.

Advertising Content Description
Encryption Permits to know if the Broadcast Source is encrypted or not
Standard Quality Permits to know if the Broadcast Source uses a standard audio quality configuration (16_2 or 24_2)
High Quality Permits to know if the Broadcast Source uses a high-quality configuration (48KHz configuration)
Metadata Additional metadata field, available for custom implementation

1.3. Broadcast Name

The Public Broadcast Profile also requires to advertise a Broadcast Name AD type on the PBS. This Broadcast Name is a 4 to 32 character long string, encoded in UTF-8, describing the Source content in a human-readable way.

Examples of Broadcast Name can be "Gate 3", or "Auracast_Room:2A".

2. PBP Demonstrator using STM32WBA

2.1. Hardware required

The PBP demonstrator requires the following hardware:

  • 3x STM32WBA55G-DK1 Boards
  • 2x Music Source with a 3.5mm jack output (Laptop or Smartphone with a jack output). If a laptop is used as a source, use a Ground Loop isolator device or run the laptop on battery to avoid Ground issue
  • 1x Music renderer with 3.5mm jack input (Headphones or Speakers)

2.2. Setup

The setup is as following:

PBP Demonstrator Setup

2.3. Project architecture

The figure below represents the Firmware Architecture of the Public Broadcast Profile example projects inside STM32CubeWBA MCU Package.

STM32WBA PBP Firmware Architecture

2.4. PBP Source configuration

Following is a summary of the main changes possible on the PBP_Source project

PBP_Source project configuration


Setting File Description
BROADCAST_SOURCE_BAP_CONFIG pbp_app.c Configuration index in BroadcastQoSConf array. 0 corresponds to 8_2_1 configuration, 1 to 8_2_2, … Commonly used values are 3 (16_2_1 config), 5 (24_2_1 config), and 13 (48_4_1 config). For more details about the configurations, refer to the Introduction to Bluetooth LE Audio wiki page.
BROADCAST_SOURCE_FRAME_BLOCK_PER_SDU pbp_app.c Number of concatenated codec frames sent at the same time. May be 1 or 2. Setting it to 2 reduces the number of events needed to send the packets which can improve reliability but increase the latency.
BROADCAST_SOURCE_NUM_BIS pbp_app.c Number of BIS used for the Broadcast Source. May be 1 or 2. Setting it to 1 reduces the number of events needed to send the packets which can improve reliability but a value of 2 reduces the strain on Sink devices synchronizing to mono audio.
BROADCAST_SOURCE_CHANNEL_ALLOC_1 pbp_app.c Audio Channel Allocation of BIS #1. Bitfield of Audio Location values. Commonly used values are 0x01 for "Front Left" location or 0x03 for "Front Left + Front Right" location.
BROADCAST_SOURCE_CHANNEL_ALLOC_2 pbp_app.c Audio Channel Allocation of BIS #2. Bitfield of Audio Location values. Commonly used value is 0x02 for "Front Right". Ignored if "BROADCAST_SOURCE_NUM_BIS" is 1.
BROADCAST_CONTROLLER_DELAY pbp_app.c Controller delay value. Refer to "STM32WBA LC3 codec and audio data path" wiki page[2]
BAP_BROADCAST_MAX_TRANSPORT_LATENCY pbp_app.c Maximum Transport Latency value. Refer to "STM32WBA LC3 codec and audio data path" wiki page[3]
BAP_BROADCAST_ENCRYPTION pbp_app.c 1 to enable broadcast encryption, 0 to disable it
BIG_HANDLE pbp_app.c Handle of the BIG used for the Broadcast
STREAMING_AUDIO_CONTEXT pbp_app.c Streaming Audio Context of the Broadcast Source. Common values are AUDIO_CONTEXT_MEDIA (0x0004) and AUDIO_CONTEXT_CONVERSATIONAL (0x0002). Refer to Assigned Numbers for more details[4]
APPEARANCE pbp_app.c Appearance value of the Broadcast. Describe the physical appearance of the device. Refer to Assigned Number for more details[5]
BROADCAST_NAME_LENGTH pbp_app.c Length of the Broadcast Name
aPBPAPP_BroadcastCode pbp_app.c Broadcast Code used when BAP_BROADCAST_ENCRYPTION is set to 1. Broadcast Sinks will have to know the Broadcast Code in order to decrypt the stream
aPBPAPP_BroadcastName pbp_app.c Broadcast Name as described in 1.3
BAP_BROADCAST_SOURCE_ID pbp_app.h ID of the Broadcast Source. This value is ST specific and permits the PBP Sink to identify the PBP Source with a custom static identifier. Not to be confused with the Broadcast ID which is generated randomly by the BAP layer at Broadcast Source creation.

2.5. PBP Sink configuration

Following is a summary of the main modification possible on the PBP_Sink project

PBP_Sink project configuration


Setting File Description
BROADCAST_CONTROLLER_DELAY pbp_app.c Controller delay value. Refer to "STM32WBA LC3 codec and audio data path"
BAP_BROADCAST_ENCRYPTION pbp_app.c 1 to enable broadcast decryption, 0 to disable it
BIG_HANDLE pbp_app.c Handle of the BIG used for the Broadcast
aPBPAPP_BroadcastCode pbp_app.c Broadcast Code used when BAP_BROADCAST_ENCRYPTION is set to 1. Broadcast Code must match the one set on the PBP Source
aSourceIdList pbp_app.c List of Source IDs to cycle through using the joystick

2.6. PBP Source Advertising details

The following schematic details the content of a Public Broadcast Source advertising Data.

Detail of PBP Source Advertising Data

3. References