1
Background Introduction
Bluetooth Low Energy Audio (Bluetooth LE Audio, hereinafter referred to as: LE Audio) represents the functional trend of the next generation of smart audio devices. The LE Audio technology is based on the transmission characteristics of the Connected Isochronous Stream (CIS) introduced in Bluetooth Core Specification version 5.2. CIS establishes a fixed time interval (ISO Interval) and a point-to-point bidirectional data stream transmission channel between connected devices based on the low-energy Bluetooth ACL connection. The CIS initiated by the Central (such as a mobile phone, computer, or tablet) is a member of the CIG (Connected Isochronous Group), with each CIS corresponding to an independent audio stream, allowing each Central device to have multiple CIGs.
A headset is an integration of a headphone and a microphone. In fact, it combines the headphone and microphone into one unit, usually with the headset playing stereo audio and the microphone capturing mono audio. This article mainly introduces the application process analysis of Headset based on LE Audio.

Headset Scene Diagram
2
Ellisys Packet Capture Process Analysis
The audio source device of the headset transmits audio data through the CIG’s CIS. The headset side sends a connectable extended advertisement (EA), and the Central side first establishes an ACL connection after scanning the headset device information, exchanging LE Audio audio capabilities and configuring ASE endpoints, and then the Central initiates the establishment of the CIS connection.
Extended Advertisement:
-
ADV_EXT_IND PDU – Extended Advertisement PDU
-
AUX_ADV_IND PDU – Auxiliary Advertisement PDU
-
AUX_CHAIN_IND PDU – Auxiliary Chain Advertisement PDU (optional)
The ADV_EXT_IND PDU broadcasts in the 37, 38, and 39 primary frequency bands, and its extended header field contains an AuxPtr field, which includes data that allows it to synchronize with the auxiliary AUX_ADV_IND PDU. The AuxPtr field of the ADV_EXT_IND PDU points to the AUX_ADV_IND, meaning the value of AuxPtr points to one of the remaining 0-36 frequency bands where the ADV_EXT_IND PDU is broadcasted.

The AUX_ADV_IND PDU contains an Adv Data field, which includes Appearance, RSI (Resolvable Set Identifier), ASCS (Audio Stream Control Service), CAS (Common Audio Service), and TAMS (Telephony and Media Audio Service). Appearance declares the appearance of the headset device, RSI declares support for CSIS (Coordinated Set Identification Service), and TMAS declares that the device supports Call Terminal and Unicast Media Receiver.

Introduction to ASE State Machine
ASCS defines an Audio Stream Endpoint (ASE), which is divided into Source ASE and Sink ASE. Their state machine transitions are shown in the following diagrams, including the following states:
-
Idle – Standby state, initialized to Idle state by default.
-
Codec Configured – Audio parameters, such as sample rate, bit width, frame length, etc., are configured.
-
QoS Configured – Connection parameters, such as PHY, Retransmit Num, Max Transport Latency, etc., are configured.
-
Enabling – Enabled state, the CIS between client and server starts to establish or has been established.
-
Streaming – Streaming state, audio stream established, audio data can be transmitted between client and server.
-
Releasing – Releasing state, audio resources are released; this state is an intermediate state that can be entered from any state other than Idle.
-
Disabling – Disabled state, audio stream stopped; this state is only an intermediate state that can revert to the QoS Configured state through the Receive stop ready operation. Note: This state is only possessed by Source ASE.

Source ASE State Machine Transition Diagram

Sink ASE State Machine Transition Diagram
Next, we will observe the audio stream process more intuitively through packet capture:
First, select an ADV_EXT_IND PDU packet, which can synchronize to the frequency band 11 and offset position 1.02ms pointed to by its AuxPtr.

Then, establish an ACL connection through AUX_CONNECT_REQ and AUX_CONNECT_RSP, completing the encryption and service discovery processes, including the ASE interaction process to be introduced below.

The Central side discovers the audio capabilities supported by the headset’s Sink and Source, including sample rate, sample period, encoding method, and other parameters. The Sink audio capability is the audio playback (speaker) of the headset, while the Source audio capability is the audio capture (microphone) of the headset. The detailed audio parameters supported by the Source are shown in the figure below, which are similar for the Sink side.

This part provides a detailed analysis of the CIS configuration process through packet capture:
The figure below shows the complete process of CIS configuration packet capture. 1 is the Codec Config process, 2 is the QoS Config process, 3 is the establishment of the CIS connection channel, 4 is the Enabling process, and 5 is the Streaming process. Below is a detailed analysis of the specific content of each process.

1. The Central side configures the Codec for the upstream and downstream of the headset, including an upstream MIC sample rate of 16kHz, a downstream dual-channel audio sample rate of 48kHz, frame length of 10ms, bit width of 16 bits, etc. The headset side will reply whether the configuration is successful.

2. The Central side configures the QoS for the headset’s upstream and downstream, including a 2M PHY, a Retransmission Number of 13, Max Transport Latency of 40ms, etc. The headset side will reply whether the configuration is successful.

3. The Central side initiates the CIS Request to establish the CIS process, including an ISO Interval of 10ms, a Sub Interval of 1.410ms, and parameters for establishing the CIS anchor point.

4. The Central side initiates the Enable control command, and the headset side replies that Enabling is successful, returning the ASE ID and CIS ID parameters for both Sink ASE and Source ASE.

5. The Central side initiates the Enable control command, and the headset side replies that Streaming is successful, returning the ASE ID and CIS ID parameters for both Sink ASE and Source ASE.

3
Code Analysis of CIS Audio Stream Establishment Process
Next, we will analyze the CIS audio stream establishment process using the LE Audio application code in Telink’s b91_ble_audio_sdk:
-
CIS Audio service configuration, as well as the audio capability parameter configuration table for ASE Sink and ASE Source


-
Set up extended advertisement; the parameter settings can correspond to the packet capture above

-
Register the profile event callback function table; the figure below lists some callback functions corresponding to the configuration process of ASE Sink and ASE Source


-
Set the default parameters for the codec

After the extended advertisement configuration is completed, it will start broadcasting once the BLE protocol stack is up and running. The Central device will perform an ACL connection after scanning the advertisement and initiate the CIS process establishment after completing the ASE process.
-
Data reception and transmission processing


Burn the code to the Telink B91 EVK, and the phone supporting CIS can search for the “tlk_le_headset” device after turning on Bluetooth, click to connect to communicate with the phone, or use the matching dongle for communication testing.
4
Outlook
Bluetooth 5.2 LE Audio technology will greatly expand the application scenarios of wireless audio. The wireless multi-stream audio technology brought by Bluetooth 5.2 will fundamentally change people’s usage habits regarding wireless audio technology, providing users with a brand new experience and infinite possibilities for users and the market. If you need the Ellisys packet capture logs, please feel free to contact us.

About Telink
Telink Semiconductor is committed to providing customers with one-stop low-power, high-performance wireless connectivity SoC chip solutions, including classic Bluetooth, Bluetooth Low Energy, Bluetooth Mesh, Zigbee, Thread, Matter, Apple HomeKit, Apple “Find My,” and other low-power 2.4GHz multi-protocol wireless connectivity system-level chips and rich firmware protocol stacks. The company’s products are widely used in various consumer and commercial application scenarios, including smart lighting, smart home/building, smart remote control, wireless peripherals, smart retail, wearable devices, wireless audio, smart toys, logistics tracking, and smart cities.
Official Website: www.telink-semi.com
WeChat Official Account: telink-semi
Telink Developer Forum:
https://developers.telink-semi.cn/
Sales Contact:
Mainland China (East China, North China):
+86-21-20281118-8213
Mainland China (South China, Hong Kong, Audio):
+86-0755-26614003