Page 1
Telink B91m BLE Audio SDK User Guide AN-22063004-E3 Ver2.0.0 2023.07.24 Keyword BLE, Audio Brief This document provides user guide for B91m BLE audio typical application scenarios, suitable for Telink B91 (TLSR951x/921x) and B92 (TLSR952x/922x) series chip.
Page 2
This document is provided as-is. Telink Semiconductor reserves the right to make improvements without further notice to this document or any products herein. This document may contain technical inaccuracies or typographical errors. Telink Semiconductor disclaims any and all liability for any errors, inaccuracies or incompleteness contained herein.
Page 7
List of Tables Table 1.1 List of Telink unicast audio kit development boards ..... . Table 1.2 List of Telink broadcast audio kit development boards ....
Telink B91m BLE Audio SDK User Guide Purchase on taobao, if it is not already on the shelve, please contact Telink FAE to buy B91 Bluetooth Low Energy (BLE) audio kit. 1.1.2 Telink Broadcast Audio Kit Figure 1.2: Telink B91 broadcast audio kit Hardware for the kit: Table 1.2:...
Telink B91m BLE Audio SDK User Guide Purchase on taobao, if it is not already on the shelve, please contact Telink FAE to buy B91 BLE audio kit. 1.1.3 Hardware Reference Design • See the section Development Kit and Application Boards under page Telink wiki 1.2 Software Requirement...
2 Unicast Audio Demo The Unicast Audio Demo is divided into two roles: Unicast Client and Unicast Server. The B91m BLE Audio SDK v1.1.0.0 extends the usage range of unicast demo, users can simply configure it to achieve: • one-to-one (client to server), typical scenarios include headset.
Telink B91m BLE Audio SDK User Guide 2.1.1 Scenario Introduction As a unicast client, B91 dongle establishes audio channels with two unicast servers respectively. Figure 2.2: Unicast scenario 1 structure • As the USB device, the B91 dongle acquires 48kHz dual channel audio data from the USB host (phone/ PC connected to dongle), and sends the left and right channels to the two unicast servers respectively after LC3 compression.
Telink B91m BLE Audio SDK User Guide The Telink B91 dongle acts as a USB device that transmits 16kHz dual channel audio data to the USB host (phone/PC), some USB hosts may use one channel, and some USB hosts may use two channels.
Telink B91m BLE Audio SDK User Guide If using codec mode, the codec parameters need to be modified. tlk_codec_config(TLK_CODEC_OUTPUT,TLK_CODEC_FREQ_16000,TLK_CODEC_2_CHANNEL,...); tlk_codec_config(TLK_CODEC_INPUT,TLK_CODEC_FREQ_48000,TLK_CODEC_2_CHANNEL,...); • Step6: After the parameter configuration is completed, click compile to generate the target firmware. 2.1.3 Firmware Compilation - Unicast Server You can skip this step if there is already firmware.
Telink B91m BLE Audio SDK User Guide 2.1.4 Operating Steps Figure 2.3: Unicast scenario 1 environment setup • Step1: Burn the unicast client firmware into a TLSR9518 dongle and connect it to the phone/PC via USB. • Step2: Burn unicast server firmware into two TLSR9517C audio boards (select left and right ear re- spectively), and power them via USB.
Telink B91m BLE Audio SDK User Guide • LED red breathing light, flashing once every second. • LED blue indicates that dongle has established a Bluetooth ACL connection with the server. • LED green indicates that dongle has established a Bluetooth CIS audio channel with server.
Telink B91m BLE Audio SDK User Guide 2.2.1 Scenario Introduction Figure 2.5: Unicast scenario 2 structure As a unicast client, B91 dongle establishes audio channels with two unicast servers respectively. • As the USB device, the B91 dongle acquires 48kHz dual channel audio data from the USB host (phone/ PC connected to dongle), and sends the left and right channels to the two unicast servers respectively after LC3 compression.
Telink B91m BLE Audio SDK User Guide #define TLSR9517CDK56D #define TLSR9518ADK80D #define HARDWARE_TYPE TLSR9517CDK56D • Step2: Select TWS for mode. #define APP_SCENE_TWS #define APP_SCENE_HEADSET_EP1_MULTIPLEXING #define APP_SCENE APP_SCENE_TWS • Step3: For TWS, select left or right ears, 1 for the left ear and 2 for the right ear.
Telink B91m BLE Audio SDK User Guide • Step1: Burn the unicast client firmware into a TLSR9518 dongle and connect it to the phone/PC via USB. • Step2: Burn unicast server firmware into two TLSR9517C audio boards (select left and right ear re- spectively), and power them via USB.
Telink B91m BLE Audio SDK User Guide 2.3 Unicast Demo Scenario 3 Figure 2.7: Unicast scenario 3 One unicast client to one unicast server, with a downlink 48kHz dual channel and multiplexing technology. One CIS channel transmits two audio data channels, and uplink 16kHz mono channel, simulating headset scenarios, as shown above.
Telink B91m BLE Audio SDK User Guide Figure 2.8: Unicast Scenario 3 structure • As the USB device, the B91 dongle acquires 48kHz dual channel audio data from the USB host (phone/ PC connected to dongle). After LC3 compression, the left and right channels are merged into one SDU and sent to unicast server.
Telink B91m BLE Audio SDK User Guide 2.3.3 Firmware Compilation - Unicast Server You can skip this step if there is already firmware. • Step1: Select TLSR9517CDK56D for hardware. #define TLSR9517CDK56D #define TLSR9518ADK80D #define HARDWARE_TYPE TLSR9517CDK56D • Step2: Select headset for mode.
Telink B91m BLE Audio SDK User Guide • Step2: Burn unicast server firmware into a TLSR9517C audio board, and power it via USB. • Step3: Press SW2 button on the dongle to pair, and the dongle connects to the target unicast server.
Telink B91m BLE Audio SDK User Guide 3 Broadcast Audio Demo LE Audio introduces broadcast audio to Bluetooth technology, a technology that takes audio communication beyond peer-to-peer communication and enables an audio source device to broadcast audio stream to an unlimited number of nearby Bluetooth audio receiving devices.
Telink B91m BLE Audio SDK User Guide 3.1 Broadcast Demo Scenario 1 Figure 3.2: Broadcast audio scenario 1 The broadcast sink synchronizes the source information through the asynchronous connection of the broad- cast assistant. Development board for the kit: Table 3.1:...
Telink B91m BLE Audio SDK User Guide provides the USB-CDC interface for configuration instructions. Figure 3.3: Broadcast audio scenario 1 structure • B91 dongle, as a broadcast source device, is configured as a USB device to obtain 48kHz dual channel audio data from the USB host (phone/PC connected to dongle), and after LC3 encoding, the audio data is transmitted into the air according to different configurations.
Page 29
Telink B91m BLE Audio SDK User Guide //broadcast source extend advertising parameter #define DEFAULT_DEV_NAME "Telink-BIS-SOURCE" #define DEFAULT_BROADCAST_NAME "Broad-source" #define DEFAULT_BROADCAST_ID 0x010305 • step3: Select the audio input mode, there are four ways: USB input, Line-in, AMIC and test mode. #define APP_AUDIO_INPUT_AMIC...
Telink B91m BLE Audio SDK User Guide • step6: Configure ISO interval, transport delay, and BIG encryption parameters. // BIS Parameter set #define BIG_INFO_ISO_INTERVAL //iso interval = sdu interval*n #define BIG_INFO_TRANSPORT_LATENCY //unit ms #define BIG_INFO_ENC_FLAG #define BIG_INFO_BROADCAST_CODE "Telink" The macro definitions BIG_INFO_ENC_FLAG and BIG_INFO_BROADCAST_CODE can control BIG encryption.
Telink B91m BLE Audio SDK User Guide 3.1.4 Firmware Compilation - Broadcast Sink You can skip this step if there is already firmware. • Step1: Select SINK_ONLY_VERSION for sink version. #define SINK_ONLY_VERSION #define SINK_VERSION SINK_ONLY_VERSION • Step2: After the parameter configuration is completed, click compile to generate the target firmware.
Telink B91m BLE Audio SDK User Guide • Step5: Music is played on the phone or PC, and the sink can hear the music being played. 3.1.6 Broadcast Source UI • The yellow light flashes, once per second. • The blue light is always on to indicate that there is audio transmission from the USB.
Telink B91m BLE Audio SDK User Guide The scenario integrates the sink and assistant functions in one demo, and the user can select to synchronize the source information directly through the buttons on the B91 audio development board. Development board for the kit: Table 3.2:...
Telink B91m BLE Audio SDK User Guide • The B91 audio development board acts as a broadcast sink and broadcast assistant, after power on, the broadcast assistant function will automatically scan the broadcast source in the air. When the user uses the button to trigger the broadcast source synchronization, the broadcast source synchronization function of the broadcast sink is enabled.
Telink B91m BLE Audio SDK User Guide 3.3 Broadcast Demo Scenario 3 Figure 3.7: Broadcast audio scenario 3 The scenario integrates the source and assistant functions in one demo, and the user can choose which sink device to synchronize the audio through the UART interface.
Telink B91m BLE Audio SDK User Guide Figure 3.8: Broadcast audio scenario 3 structure 3.3.2 Firmware Compilation This scenario is currently not supported by the SDK. AN-22063004-E3 Ver2.0.0...
Telink B91m BLE Audio SDK User Guide 4 System Delay Compared to Classic Bluetooth audio, BLE audio has the protocol layer advantage in terms of delay. The system delay source and composition of BLE audio typical scenarios are analyzed below.
Telink B91m BLE Audio SDK User Guide Figure 4.2: Audio_Processing_Time • Audio capture time: T_capture The audio capture time is a fixed time, if the SDU interval is 10ms, the capture time is fixed at 10ms, if the SDU interval is 7.5ms, the capture time is fixed at 7.5ms.
Telink B91m BLE Audio SDK User Guide 4.2 Transport Latency Transport Latency is referred to as T_trans. The audio data is sent from the link layer of the sending end to the link layer of the receiving end, and the time from sending to receiving is fixed.
Page 40
Telink B91m BLE Audio SDK User Guide (2) Using a CPU with stronger computing power can shorten T_coder and T_pres. (3) Depending on the specific project, using an efficient software architecture can minimize T_wait_1 + T_wait_2 and T_pres. (4) Reduce the FT, and shorten the number of retransmissions as much as possible while ensuring the quality of the wireless transmission.
Telink B91m BLE Audio SDK User Guide 5 Appendix 5.1 Assistant Command Set All control commands for the Broadcast Assistant need to end with “\r\n” (ASCII: 0x0d 0x0A). In the following description of the commands, this will not be repeated.
Telink B91m BLE Audio SDK User Guide acl connected Handle:80, Addr 12:34:56:00:00:00 ConnHandle:80, PACS Found Start. ConnHandle:80, PACS Found End. ConnHandle:80, BASS Found Start. Sink no any Sync Source Info ConnHandle:80, BASS Found End. ConnHandle:80, VCP Volume Controller Found Start.
Telink B91m BLE Audio SDK User Guide Front Right: Supported Source is Unencrypted (2) scan-bcast stop <conn_idx> Stopping the scan source information operation, the assistant will first reply with “assistant stop scan broad- cast source”. (3) scan-bcast clear <conn_idx> Stopping the scan source information operation and clearing the source information that has been scanned, the assistant will first reply with “assistant clear broadcast source info”.
Telink B91m BLE Audio SDK User Guide (2) show sink Querying the scanned sink information, the assistant replies with “scan sink info” and prints the information of the scanned sink. [1] public 12:34:56:00:00:00 name:Telink-BIS-SINK (3) show source Querying the scanned source information, the assistant replies and prints the source information.
Telink B91m BLE Audio SDK User Guide For all volume control instructions, after the operation is completed or the sink’s own volume variable is updated, the volume value and mute flag information of the sink will be printed. Conn:80, volume(min:0, max:255) is 40, muteSate:Unmute (1) mute/unmute The command format: mute <conn_idx>...
Page 46
Telink B91m BLE Audio SDK User Guide sink 2: • public address: 12:34:56:00:00:01 • Device name: Telink-BIS-SINK Basic information of the source: source 1: • public address: 12:34:56:00:01:00 • Device name: Telink-BIS-SOURCE source 2: • public address: 12:34:56:00:01:01 • Device name: Telink-BIS-SOURCE (1) Scan the sink device in the air The following displays the process of sink scanning.
Page 47
Telink B91m BLE Audio SDK User Guide ConnHandle:80, VCP Volume Controller Found Start. Sink no any Sync Source Info ConnHandle:80, VCP Volume Controller Found End. ConnHandle:80, SDP over [10:31:37.373]send: show conn [10:31:37.377]recv: connect sink info [1]Connect:public 12:34:56:00:00:00 name:Telink-BIS-SINK After establishing an ACL connection, the supported service information of the sink will be printed, including PACS, BASS, and VCP information.
Page 48
Telink B91m BLE Audio SDK User Guide BIS Index: Codec ID: 0600000000 Sampling Frequency: 48Hz Front Right: Supported Source is Unencrypted [10:33:59.365]send: scan-bcast stop [10:33:59.375]recv: assistant stop scan broadcast source The above log shows the source information for the over-the-air compliance.
Page 49
Telink B91m BLE Audio SDK User Guide [10:38:59.580]send: add-source 1 1 1 [10:38:59.585]recv: started add source [10:38:59.690]recv: sink PA state is Loss BIS Synced state is 0x00000003 sink PA state is Loss BIS Synced state is 0x00000000 [10:38:59.810]recv: Sink no any Sync Source Info [10:39:00.231]recv: sink PA state is Sync...
Page 50
Telink B91m BLE Audio SDK User Guide BIS Synced state is 0x00000002 (5) Volume Control Operation After completing the service discovery process, the command “show vcp 1” can be sent to query the volume control protocol supported by the sink. The connected sink supports volume control, mute, left channel vol- ume gain (not implemented at the sink’s application layer), and right channel volume gain (not implemented...
Page 51
Telink B91m BLE Audio SDK User Guide [10:47:43.380]recv: Conn:80, volume(min:0, max:255) is 160, muteSate:Unmute [10:47:53.501]send: set-vol [10:47:53.580]recv: Conn:80, volume(min:0, max:255) is 8, muteSate:Unmute The sink supports the VOCS service, so the VOCS value can also be set. //Set the left channel volume offset value [10:49:12.158]send: set-vol-offset...
Need help?
Do you have a question about the B91m and is the answer not in the manual?
Questions and answers