One article to understand Bluetooth audio

1. Introduction to Bluetooth

Bluetooth is a wireless communication technology standard used to exchange data between devices within a short distance. It was first released by Ericsson in Sweden in 1994. The purpose of proposing the Bluetooth standard is very simple, which is to simplify the data interaction process between electronic devices. At that time, mobile phones had just become popular, and there was a strong demand for wireless connections between mobile phones and headsets or computers, and the Bluetooth protocol largely served such needs.

2. The development history of Bluetooth

Bluetooth 1.0 (1999) The early version of Bluetooth has the risk of data leakage and has not been widely used;

Bluetooth 1.2 Bluetooth technology has been iterating, and Bluetooth 1.2 released in 2003 is a sign that Bluetooth is truly safe and usable;

Bluetooth 2.0 (2004) focuses on improving multitasking capabilities, and supports duplex mode at the same time, allowing voice communication and file transfer at the same time;

Bluetooth 3.0 (2009) introduced high-speed transmission, increased bandwidth, and objectively occupied the position of WiFi, increasing power consumption and cost;

Bluetooth 4.0 (2010) re-positioned and introduced the concept of BLE, that is, Bluetooth Low Energy Bluetooth Low Energy;

Bluetooth 5.0 (2016) enables Bluetooth to have more powerful transmission capabilities under low power consumption, improves security and accessibility, and has gradually become the mainstream.

Bluetooth 5.2 (2020) focuses on LE Audio, releasing multiple LE audio specifications and the new LC3 high-quality low-latency encoder to enhance the Bluetooth audio experience.

3. Bluetooth audio specification

The cornerstone of the Bluetooth protocol is a profile. There are currently more than 20 profiles in the Bluetooth standard. A profile is actually a communication type or protocol. Different profiles cover different applications.

Three of these specifications focus on the transmission of audio data. Traditional A2DP and HFP and the latest BAP

1. HFP specification

Among them, HFP is based on the SCO (Synchronous Connection Oriented) link and is used for two-way transmission of call voice. The SCO link has synchronous transmission characteristics, but there is a risk of error in wireless transmission. In order to ensure the integrity and correctness of the synchronous data, the correctness cannot be guaranteed, so the encoder used by HFP needs to have fault tolerance.

2. A2DP specification

A2DP (Advanced Audio Distribution Profile), Bluetooth stereo audio transmission specification, typical application is Bluetooth headset. The position of the Bluetooth A2DP specification in the protocol stack is as follows:

115fe9b1c5ad949b0f82b326a73fa69c.png

The audio data of the A2DP protocol is transmitted on the ACL Link, which is fundamentally different from the voice data transmitted on the SCO. A2DP does not include the function of remote control, and the function of remote control depends on the AVRCP protocol specification. A2DP is a high-level protocol based on the AVDTP protocol. AVDTP defines the parameter negotiation, establishment and transmission process of data stream handles between Bluetooth devices, as well as the signaling entity form of mutual exchange. This protocol is the basic protocol of the A2DP framework.

The Bluetooth A2DP data packet is transmitted based on the AVDTP protocol, and its hierarchical relationship is as follows: The data packet has its own header at each layer.

78e8380334d62c11dbb6296ef9234bff.png

Before data transmission, the sending end (SRC) and the receiving end (SNK) need to perform a series of signaling interactions to confirm the parameters of the data transmission between the two parties before starting data transmission. The signaling interaction process is as follows:

ff7165a4563524021db7bd1537b96afd.png

3. Bluetooth audio encoder

Compared with WIFI, Bluetooth has the advantages of power consumption and portable plug-in, which can be quickly plugged and unplugged only by implementing the corresponding protocol according to the specification, but its disadvantage of transmission bandwidth is also obvious. Today, WIFI transmission rate has reached Gbps level and the Bluetooth transmission bandwidth is only 2Mbps, while the early Bluetooth transmission rate is only a few hundred Kbps.

94da7d34d2267ecda59c6db84aad796a.png

For music audio, the basic CD quality also needs 1.4Mbps. If the original audio is transmitted directly, the bandwidth may be exhausted, and the anti-interference performance is poor, and the sound may be stuck. Therefore, the audio data must be compressed and encoded at the Source end, and decoded at the Sink end compression.

And how to encode and decode the Bluetooth Alliance standard stipulates that SBC is mandatory, and AAC/MP3 is optional (Optional Codec). In addition to these, there can also be the manufacturer's own encoding form (Vendor Specific A2DP Codecs), such as Qualcomm's APT- X, Sony's LDAC, and LHDC.

4. A2DP sound quality and delay

As mentioned earlier, in order to transmit audio data on the Bluetooth channel, the audio data must be compressed and encoded before being transmitted, and the compression here is different from the conventionally recognized file compression and decompression to obtain completely consistent source files. In order to adapt to the bandwidth audio transmitted by Bluetooth After the data is compressed, the bandwidth occupied is very small. This kind of compression is lossy compression. Taking SBC as an example, after compression, it only takes up more than 200 Kbps, and the compression ratio reaches 1/7, and such lossy compression will inevitably lose the sound quality of music.

The bandwidth occupied by common encoders is shown in the table below.

9287e3db852ae0db69e1940fc6c57758.png

SBC is an encoding format mandated by the A2DP protocol. Utilizing the different characteristics of the human ear's perception sensitivity to different frequency signals, the human hearing (insensitive part adopts rougher quantization, and the sensitive part adopts finer quantization to obtain better subjective auditory effect, which is the best sound quality. A poor encoder. AAC is a high-quality encoder that is optionally supported by the protocol specification. Later, the implementation manufacturer proposed high-quality audio encoders with high bandwidth occupation such as apt-X, LDAC, and LHDC. Among them, LDAC/LHDC It also supports 96K high-resolution audio certified by the Hi-RES standard. LC3 is a high-quality low-bandwidth encoding technology that is mandatory for LE audio released following the new generation of LE audio. Generally speaking, a higher bit rate means better sound quality However, the emergence of the latest generation of LC3 may break this rule. The subjective comparison scores of LC3 and SBC are as follows. In the case of a code rate of 345 kbps, the score of SBC is slightly higher than 4.0, but the score of LC3 is 160 kbps. A higher subjective score than SBC can be achieved.

2324ee4831ad3aa1b2e6d4d5aeb6b3fc.png

As mentioned earlier, Bluetooth audio transmission must be encoded first, and the encoding is to encode and compress the data of a certain length according to the frame. Here, enough data is accumulated and then encoded. The process of decoding and playing the device after receiving the data will cause delay. . Most of the posts on the Internet attribute the Bluetooth audio delay to this. In fact, it is not the case. The longest encoding frame of the several encoders mentioned above is AAC. The length of a frame reaches 23ms. It is completed in ms, but the actual delay is several times of this data and reaches more than 100ms. One frame of SBC is only less than 2ms, but its delay reaches more than 200ms.

81e6483b19d2a701a51580adb52001e6.png

In fact, the main factor affecting the delay is the stability of the Bluetooth transmission. Ideally, the Bluetooth audio sender sends data packets with uniform time intervals, and the receiver receives data with uniform time intervals. In this case, the receiver can send the received data through the speaker after a slight delay. After the speaker finishes playing this The next packet data can be received before the packet data and then can be played continuously. At this time, the delay of Bluetooth audio depends on the packet sending interval and transmission time.

44372326f010b3e14aadd086e30a3b30.png

However, the reality is always unsatisfactory. As a wireless transmission protocol, data transmission by Bluetooth may be interfered by peripheral wireless devices or strong electromagnetic devices such as induction cooker, microwave oven and other equipment, resulting in data error and retransmission. In fact, even if there is no interference, due to the performance of the Bluetooth device itself , or because of the characteristics of wireless transmission, transmission errors may occur. The retransmission of transmission errors causes some of the packets to be retransmitted many times and the transmission time becomes longer, and the data packets received by the receiving end are not evenly timed. In this case, if the receiving end wants to play smoothly, it must first cache the data for a certain period of time before playing, so as to prevent the late arrival of the package and cause discontinuous playback. In this case, the real main factor is to resist the instability of network transmission. Artificially added delay (caching), and the higher the transmission bit rate, the greater the impact of network fluctuations, and a longer delay is required to prevent freezes.

c7f9efa9affb2cd4798fe4e418205a51.png

5.BLE Audio

The core framework of LE Audio is as follows

8c4dbfc784fbee3296cebf13fcb4b3db.png

LE Audio is a new generation of Bluetooth audio transmission protocol, based on low-power Bluetooth BLE wireless communication, its main features are:

1. Ultra-low power consumption. LE itself is Bluetooth low-power consumption. LE Audio is the first to transmit single-channel data independently for each earphone, which greatly reduces the data transmission volume of each earphone and reduces the power consumption of transmission and decoding.

2. New high-quality, low-power audio decoder LC3 (Low Complexity Communications Codec)

3. LE synchronous channel (ISOC: Low Energy Isochronous Channels)

4. Support multi-stream audio (Multi-Stream Audio)

5. Support broadcast audio technology (Broadcast Audio)

LE Audio is a next-generation Bluetooth audio solution proposed to solve the shortcomings of the traditional Bluetooth audio mentioned above: sound quality, delay, and problems with binaural wireless headphones and multiple connections. LE Audio defines a new audio transmission mechanism, LE Isochronous Channels, at the data stream level starting from the Bluetooth underlying protocol. This synchronous channel supports both connected and disconnected modes.

The one-to-one connection mode adopts the LE-CIS (LE Connected Isochronous Stream) logical transmission channel, and the clearing mechanism flushes out the delayed data to ensure that the receiving end receives the data regularly, thus reducing the buffer at the receiving end and greatly reducing the delay. Different LE-CISs form CIGs (Connected Isochronous Groups). The CISs in the same CIG have the same time stamp to ensure that the data in the same group is synchronized. The most obvious application is earphones, the left ear and the right ear respectively It is a CIS, they form a CIG, and their time is synchronized with each other.

a7978dc98934b9e78d839e7f2f2e5656.png

The one-to-many non-connection broadcast mode is called BIS (Broadcast Isochronous Stream), and multiple BISs can form a BIG. The synchronization of the broadcast mode is realized through a periodically broadcast PDU, which contains a time stamp for each BIS. Once synchronized, the receiver can be called a synchronous receiver. For the same example, if for the same broadcaster, each person in a group of people can simultaneously receive the broadcast audio signal at the same time.

a66fd0c1c9bcd2de3ee50d896d9b01c9.png

Four. Conclusion

Mobile communication technology has banned the telephone line of every household, and WIFI communication technology has replaced the ubiquitous network cable. Since 1998, Bluetooth and Bluetooth audio protocols have been updated many times, from only supporting monophonic transmission to today's true wireless (TWS) headsets, from only supporting extremely low-quality transmission to today's LHDC Hi-Res, Bluetooth audio has grown rapidly and is on the way. Gradually walk into everyone's side to replace people's last half-meter wire (headphone wire). With the maturity of Bluetooth 5.2 BLE Audio technology, Bluetooth broadcast audio may enter public places, low-power audio streaming between multiple devices, providing more possibilities for TWS true wireless stereo, and bringing greater imagination to future Bluetooth audio .

references:

Core Specification 5.2.pdf

Advanced Audio Distribution Profile 1.4.pdf

Hands-Free Profile 1.8.pdf

LC3_Specification_v1.0.pdf

FraunhoferIIS_Product-Brochure_LC3_CN.pdf

Basic Audio Profile 1.0.1.pdf

0ec0863fb55148a68fdc69192720f100.gif

Long press to follow Kernel Craftsman WeChat

Linux Kernel Black Technology | Technical Articles | Featured Tutorials

Guess you like

Origin blog.csdn.net/feelabclihu/article/details/130023477