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"[2]., 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. Public Broadcast Profile APIs
The following section lists and describes the Public Broadcast Source and Sink APIs.
2.1. Public Broadcast Source APIs
The following APIs are available for the Public Broadcast Source role:
PBP_Init | Initialize the Public Broadcast Profile with the selected role(s) |
PBP_PBS_BroadcastAudioStart | Perform a Broadcast Audio Start procedure using PBP requirements to start a Public Broadcast Source. |
PBP_PBS_BroadcastAudioStop | Perform the Broadcast Audio Stop procedure to stop a Public Broadcast Source |
PBP_PBS_BroadcastAudioUpdate | Perform the Broadcast Audio Update Procedure to update a Public Broadcast Source's metadata |
In order to initialize and establish a Public Broadcast Source, it's first necessary to initialize the GATT and GAP layers using the appropriated roles
aci_gatt_init();
/* Broadcaster GAP role is required */
aci_gap_init(GAP_BROADCASTER_ROLE, PRIVACY, DEV_NAME_CHAR_HANDLE, DEV_NAME_CHAR_HANDLE, &service_handle, &dev_name_char_handler, &appearance_char_handle );
2.2. Public Broadcast Sink APIs
The following APIs are available for the Public Broadcast Sink role:
PBP_Init | Initialize the Public Broadcast Profile with the selected role(s) |
PBP_PBK_StartAdvReportParsing | Start the parsing of Extended Advertising Reports to look for PBP UUIDs and generate PBP_PBK_BROADCAST_SOURCE_ADV_REPORT_EVT events |
PBP_PBK_StopAdvReportParsing | Stops the parsing of Extended Advertising Reports |
PBP_PBK_StartPASync | Synchronize to the periodic advertising train of the given Public Broadcast Source to discover more details about the related audio stream |
PBP_PBK_StartBIGSync | Synchronize to a BIG and start receiving audio data from it |
PBP_PBK_StopPASync | Stop the synchronization to a periodic advertising train |
PBP_PBK_StopBIGSync | Terminate the synchronization to a BIG |
2.3. Datapath APIs
The following APIs are available to setup Datapath on a Public Broadcast Source or Public Broadcast Sink:
CAP_Broadcast_ReadSupportedControllerDelay | Reat the supported controller delay range function of the number of BIS |
CAP_Broadcast_SetupAudioDataPath | Setup the data path of the chosen BISs |
3. PBP Demonstrator using STM32WBA
The STM32WBA Cube firmware allows to easily build and deploy Public Broadcast Sources and Public Broadcast Sinks applications.
3.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)
3.2. Setup
The setup is as following:
PBP Demonstrator Setup |
---|
3.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 |
---|
3.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[3] |
BAP_BROADCAST_MAX_TRANSPORT_LATENCY | pbp_app.c | Maximum Transport Latency value. Refer to "STM32WBA LC3 codec and audio data path" wiki page[4] |
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 | Audio Context Type of the Broadcast Source. Common values are AUDIO_CONTEXT_MEDIA (0x0004) and AUDIO_CONTEXT_CONVERSATIONAL (0x0002). Refer to Assigned Numbers section 6.12.3 for more details[5] |
APPEARANCE | pbp_app.c | Appearance value of the Broadcast. Describe the physical appearance of the device. Refer to Assigned Number section 2.6 for more details[6] |
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. |
3.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" wiki page[7] |
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 |
3.6. PBP Source Advertising details
The following schematic details the content of a Public Broadcast Source advertising Data.
Detail of PBP Source Advertising Data |
---|
4. References
- ↑ Public Broadcast Profile Specification
- ↑ Introduction to Bluetooth LE Audio
- ↑ Bluetooth LE Audio - STM32WBA LC3 Codec - Audio Latency
- ↑ Bluetooth LE Audio - STM32WBA LC3 Codec - Audio Latency
- ↑ Bluetooth® Assigned Numbers
- ↑ Bluetooth® Assigned Numbers
- ↑ Bluetooth LE Audio - STM32WBA LC3 Codec - Audio Latency