A2DP audio stream of Bluetooth music

A2DP audio stream of Bluetooth music

Insert picture description here

The establishment of A2DP audio stream has been briefly shared in " Bluetooth Music A2DP ". In this article, we mainly talk about two important processes in audio stream: start and pause

Since the audio stream represents a one-way media data, the devices at both ends of the audio stream explicitly assume the role of SRC or SNK , and the specific role of the device depends on the upper-layer application and application scenario. The most common SRC devices in life must be mobile phones, while SNK devices are all kinds of Bluetooth headsets and speakers.

The A2DP protocol is based on the upper layer protocol of the AVDTP protocol. The actions of A2DP are ultimately realized through AVDTP. The role of the process in the AVDTP protocol can be simply divided into two parties: INT (process initiator), ACP (process responder)

The start and pause of Bluetooth music involve the following two processes in AVDTP:

AVDTP_START : Start Bluetooth A2DP audio streaming, this process has two purposes

  1. When the audio stream is established and opened, this signal is used to start the audio stream
  2. When the audio stream is paused, this signal is used to restart the audio stream

AVDTP_SUSPEND : Pause Bluetooth A2DP audio streaming

Next, analyze these two processes from the aspects of message interaction and state switching.

1. After the AVDTP_START
audio stream is established (AVDTP_OPEN), the process of starting the audio stream triggers the stream start, so that the SRC and SNK can exchange media (report, recovery) data packets, and this process can be started by any device that participates in the audio stream connection .

SRC starts the audio stream, and the message interaction Insert picture description here
between the two ends of the audio stream is: the state machines of the two are switched as follows: Insert picture description here
SNK starts the audio stream, and the message interaction Insert picture description here
between the two ends is: the state machines of both sides switch to:Insert picture description here

It can be seen from the above two cases that as an ACP, the state machine switches to STREAMING only after the response accepts the start process. As the initiator of the INT process, the timing of state switching between SRC and SNK is different.

2. After the AVDTP_SUSPEND
audio stream is turned on, use this signal to pause the transmission of the audio stream, and either SRC or SNK can start the process. The process interaction is as follows: the
Insert picture description here
state machine switch is shown in the figure below:
Insert picture description here

After the audio stream is successfully started through the AVDTP signaling channel, the SRC terminal can continuously send the Bluetooth music audio data to the SNK terminal through the AVDTP data channel, and the SRC and SNK ends the Bluetooth music audio data according to the setting in the AVDTP_SET_CONFIGURATION process Encoding mode performs encoding and decoding operations. The general transmission block diagram is as follows:
Insert picture description here

The start and pause process of the A2DP audio stream and the sharing of the audio data transmission protocol are over here. Interested students are welcome to private message and leave a message to discuss together, learn together, and make progress together!

For more interconnection technologies, please pay attention to the WeChat public account: Connectivity
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44260005/article/details/107391323