A low-power bluetooth low latency audio data synchronization transmission method
By carrying a global transmission timestamp and adjusting the local playback clock frequency in low-power Bluetooth audio transmission, the problem of playback clock deviation at multiple receivers is solved, and low-latency synchronous transmission of audio data is achieved.
Patent Information
- Application Number
- CN202611549263.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-08
- Publication Date
- 2026-11-06
AI Technical Summary
In low-power Bluetooth audio transmission, playback clock deviations at multiple receivers lead to synchronization errors. Existing technologies have high connection overhead and inaccurate latency calibration, making it difficult to achieve unified playback across multiple receivers.
By carrying a global transmission timestamp in the superframe structure, calculating the initial time deviation and adjusting the local playback clock frequency, a unified playback clock is generated to achieve synchronized playback of audio frame data.
It reduces connection management overhead and transmission latency, lowers playback clock skew and synchronization error between multiple receivers, and achieves unified playback timing across multiple receivers.
Smart Images

Figure CN123056178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of low-power Bluetooth audio transmission technology, specifically a method for low-power Bluetooth low-latency audio data synchronous transmission. Background Technology
[0002] In scenarios where multiple receivers simultaneously play low-power Bluetooth audio, the time synchronization issue between the transmitter and each receiver needs to be addressed. In related technologies, the transmitter typically uses its local clock as a reference to package and send audio data, while the receivers recover the audio playback tempo based on their own local clock generated by their crystal oscillators. Because of the differences in clock frequencies between the transmitter and different receivers, and the individual deviations in the local crystal oscillators of each receiver, inconsistent playback progress occurs when multiple receivers play the same audio stream.
[0003] One existing approach involves establishing a connection between the sender and receiver, and performing clock calibration by periodically exchanging time information. This method relies on bidirectional connections and multiple interactions. In broadcast-to-many transmission scenarios, a separate time synchronization process needs to be maintained for each receiver, resulting in significant connection and synchronization signaling overhead. Another existing approach involves the receiver directly recovering the playback clock based on the arrival time of data packets. However, due to the lack of estimation and compensation for over-the-air transmission delays, the time deviation calculated by the receiver will contain transmission delay components, leading to a fixed deviation between the recovered playback clock and the sender's master clock.
[0004] In superframe transmission, the superframe generated by the transmitting end includes a synchronization header and an audio data segment. The synchronization header carries the master clock reference time. If the receiving end only compares this master clock reference time with its local receiving time once after receiving the superframe, it is susceptible to local clock frequency drift and transmission delay fluctuations. When the crystal oscillator frequency drift characteristics of multiple receiving ends are inconsistent, the audio data broadcast by the same transmitting end will generate different playback clock offsets at different receiving ends, thus causing synchronization playback errors. Existing solutions rarely combine frame extraction and playback scheduling with a unified playback clock after time deviation correction when extracting audio frames from the audio data segment and driving audio decoding playback, making it difficult for the audio output rhythm of the receiving end to maintain long-term consistency with the transmitting end's master clock. Summary of the Invention
[0005] A method for low-power Bluetooth low-latency audio data synchronization transmission is provided. By carrying a global transmission timestamp calculated based on the master clock reference time in the superframe structure, and calculating the initial time deviation between the global transmission timestamp and the local reception time at multiple audio receivers, the local playback clock frequency is adjusted to obtain a unified playback clock. Audio frame data is extracted from the audio data segment of the superframe structure and played synchronously according to the unified playback clock, thereby reducing the playback clock deviation and synchronization playback error between multiple receivers.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a low-power Bluetooth low-latency audio data synchronization transmission method, comprising: generating a superframe structure including a synchronization header and audio data segments at an audio transmitting end; calculating a global transmission timestamp of the superframe structure at the transmission time based on the master clock reference time in the synchronization header of the superframe structure; transmitting the superframe structure carrying the global transmission timestamp to multiple audio receiving ends via a Bluetooth broadcast channel; receiving the superframe structure and parsing the global transmission timestamp at the audio receiving end; calculating an initial time deviation based on the global transmission timestamp and the local reception time of the audio receiving end; adjusting the local playback clock frequency of the audio receiving end according to the initial time deviation to obtain a unified playback clock; extracting audio frame data from the audio data segments of the superframe structure based on the unified playback clock; decoding the audio frame data and synchronously playing it according to the unified playback clock. This method, by broadcasting a superframe carrying a global timestamp, enables multiple audio receiving ends to share the same master clock reference, reducing connection management overhead and transmission latency, and facilitating synchronous playback by multiple receiving ends.
[0007] When calculating the global transmission timestamp, the master clock reference time is extracted from the synchronization header of the superframe structure. The local timer reading of the transmitting end corresponding to the transmission time of the superframe structure is obtained. The difference between the local timer reading and the master clock reference time is used as the original time offset, and the original time offset is superimposed on the master clock reference time to obtain the global transmission timestamp. Preferably, the master clock reference time is read from a preset field in the synchronization header. The preset field carries the global clock reference value provided by the master clock source of the audio transmitting end, so that the receiving end can directly obtain the global time reference of the transmitting end.
[0008] When calculating the initial time deviation, the global transmission timestamp in the superframe structure is parsed to obtain the global timing value of the transmitting end corresponding to the global transmission timestamp; the local timer value of the audio receiving end at the end of receiving the synchronization header of the superframe structure is read as the local reception time; the difference between the global timing value of the transmitting end and the local reception time is calculated as the original deviation value; the original deviation value is subtracted from the preset air transmission delay estimate to obtain the initial time deviation. Preferably, the preset air transmission delay estimate is an adaptive delay compensation amount dynamically updated based on the historical round-trip delay measurement value between the audio transmitting end and the audio receiving end, so as to reduce the impact of air transmission delay changes on synchronization accuracy.
[0009] When adjusting the local playback clock frequency, the initial time deviation is used as the input error value of the proportional-integral (PI) controller. The PI controller outputs a frequency adjustment control quantity, which is then superimposed on the local crystal oscillator division coefficient of the audio receiver to obtain a corrected division coefficient. This corrected division coefficient is then used to divide the local crystal oscillator clock, generating the unified playback clock. Preferably, the integral time constant of the PI controller is dynamically configured based on the local crystal oscillator frequency drift rate of the audio receiver, allowing the clock adjustment process to adapt to the drift characteristics of different crystal oscillators and improving the stability of clock synchronization.
[0010] When extracting audio frame data, the audio data segment of the superframe structure is divided into multiple audio frame units according to a fixed audio frame length. Each audio frame unit is labeled with a frame sequence number and a frame length identifier. Within each playback cycle of the unified playback clock, the corresponding target frame sequence number is queried based on the cycle sequence number of the current playback cycle. The audio frame unit corresponding to the target frame sequence number is extracted from the audio data segment as the audio frame data. Preferably, the mapping relationship between the cycle sequence number and the target frame sequence number is predefined by the frame mapping table field in the synchronization header of the superframe structure, enabling the sending end to flexibly configure the correspondence between audio frames and playback cycles.
[0011] When decoding the audio frame data and playing it synchronously according to the unified playback clock, the audio frame data is sent to the audio decoder for decoding to obtain a decoded pulse code modulation sample block. Driven by the unified playback clock, the pulse code modulation sample block is written into the free area of the playback buffer. Starting from the filling start address of the playback buffer, sample values are read from the playback buffer according to the beat of the unified playback clock. The read sample values are sent to the audio digital-to-analog converter for playback output. Thus, decoding, buffering, reading, and playback at each receiving end are all performed under the same unified playback clock beat, reducing playback timing deviations between multiple receiving ends.
[0012] The technical effects and advantages provided by the present invention in the above technical solution are as follows: A synchronization header and audio data segment are set in the superframe structure. The global transmission timestamp of the superframe structure at the transmission time is calculated based on the master clock reference time in the synchronization header. This associates the transmission time information carried by the superframe structure with the master clock reference of the transmitting end, rather than relying solely on the instantaneous reading of the transmitting end's local timer. Multiple audio receivers receive the same superframe structure via a Bluetooth broadcast channel, parse the global transmission timestamp, and compare it with their respective local reception times. This allows the receivers to obtain the initial time deviation relative to the transmitting end's master clock. This method eliminates the need to establish a separate bidirectional time synchronization connection for each receiver; a single broadcast can support multiple receivers to synchronously acquire the time reference, reducing connection maintenance and synchronization signaling overhead.
[0013] The local playback clock frequency of the audio receiver is adjusted based on the initial time deviation to obtain a unified playback clock. The initial time deviation is calculated from the global transmission timestamp and the local reception time, and corrected by combining a preset air transmission delay estimate, which reduces the impact of transmission delay on the time deviation calculation. The initial time deviation is converted into a frequency adjustment control quantity by a proportional-integral controller and superimposed on the local crystal oscillator frequency division coefficient to divide the local crystal oscillator clock and generate the unified playback clock. Therefore, each receiver does not directly use the original beat of the local crystal oscillator for playback, but instead uses the unified playback clock, corrected for the time deviation, to drive audio data extraction and decoding playback. When a deviation occurs between the transmitter's master clock and the receiver's local clock due to crystal oscillator frequency drift, the unified playback clock can correct the frequency based on the initial time deviation, reducing the inconsistency in playback progress caused by differences in local clock frequencies among multiple receivers.
[0014] Audio frame data is extracted from audio data segments with a unified playback clock structure. The audio data segment is divided into multiple audio frame units with a fixed audio frame length, and the corresponding frame number is queried according to the period number of the unified playback clock. Thus, the audio frame units are extracted at the receiving end according to the beat of the unified playback clock. After decoding, the audio frame data yields pulse code modulation sample blocks, which are written to the playback buffer under the drive of the unified playback clock. Sample values are read and sent to the audio digital-to-analog converter according to the beat of the unified playback clock. Both audio frame extraction and sample playback are based on the unified playback clock, ensuring that the audio output rhythm is aligned with the master clock of the transmitting end, achieving synchronous playback among multiple receiving ends. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0016] Figure 1 This is a flowchart of a method for synchronous transmission of low-power Bluetooth low-latency audio data; Figure 2 This is a schematic diagram of the global sending timestamp generation and superframe sending process; Figure 3 This is a flowchart of the audio frame data extraction process at the audio receiver. Figure 4 This is a schematic diagram of the initial time deviation and estimated air transmission delay. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] See Figure 1 This invention provides a method for low-power Bluetooth low-latency audio data synchronization transmission. At the audio transmitting end, a superframe structure comprising a synchronization header and audio data segments is generated. The synchronization header carries a master clock reference time, and the audio data segments contain audio data. Based on the master clock reference time in the synchronization header of the superframe structure, a global transmission timestamp of the superframe structure at the transmission time is calculated. The superframe structure carrying the global transmission timestamp is transmitted to multiple audio receiving ends via a Bluetooth broadcast channel. At the audio receiving ends, the superframe structure is received and the global transmission timestamp is parsed. An initial time deviation is calculated based on the global transmission timestamp and the local reception time of the audio receiving end. The local playback clock frequency of the audio receiving end is adjusted according to the initial time deviation to obtain a unified playback clock. Based on the unified playback clock, audio frame data is extracted from the audio data segments of the superframe structure. The audio frame data is decoded and played synchronously according to the unified playback clock.
[0019] In specific implementation, please refer to Figure 2 The audio transmitter extracts the master clock reference time from the synchronization header of the superframe structure. The synchronization header of the superframe structure contains a preset field, in which a global clock reference value provided by the master clock source of the audio transmitter is written. The audio transmitter reads the global clock reference value from the preset field of the synchronization header and uses it as the master clock reference time. In some embodiments, the master clock source of the audio transmitter is a high-precision crystal oscillator, and the global clock reference value provided by the master clock source increases according to a fixed clock period. The audio transmitter reads the global clock reference value from the master clock source and writes it into the preset field of the synchronization header when generating the superframe structure.
[0020] In practice, the audio transmitter obtains the reading of its local timer corresponding to the transmission time of the superframe structure. The audio transmitter is equipped with a local timer, which uses its local crystal oscillator clock as the counting reference. The audio transmitter reads the current count value of the local timer when the superframe structure begins transmission and uses this read count value as the local timer reading. Optionally, the audio transmitter reads the current count value of the local timer one local crystal oscillator clock cycle before the transmission time of the superframe structure to reduce the deviation between the read time and the actual transmission time of the superframe structure.
[0021] In practice, the audio transmitter uses the difference between its local timer reading and the master clock reference time as the original time offset for the superframe structure. The original time offset is calculated using the following formula:
[0022] in, Represents the global sending timestamp; This indicates the master clock reference time, specifically the master clock reference time extracted from the synchronization header of the superframe structure; This indicates the local timer reading at the sending end, specifically the local timer reading at the sending time of the superframe structure. This represents the original time offset, which is the difference between the local timer reading at the transmitting end and the master clock reference time.
[0023] The audio transmitter adds the original time offset to the master clock reference time to obtain the global transmission timestamp. In specific implementations, the audio transmitter adds the original time offset to the master clock reference time to form the global transmission timestamp. Optionally, the audio transmitter writes the global transmission timestamp into the timestamp field of the synchronization header of the superframe structure, with the timestamp field located after the master clock reference time field in the synchronization header.
[0024] In practice, the audio transmitter sends a superframe structure carrying a global transmission timestamp to multiple audio receivers via a Bluetooth broadcast channel. The audio transmitter repeatedly transmits the superframe structure on the Bluetooth broadcast channel according to a predetermined broadcast period. The global transmission timestamp in each superframe structure is recalculated based on the transmitter's local timer reading corresponding to the actual transmission time of the superframe structure.
[0025] In practice, the audio receiver parses the global transmission timestamp in the superframe structure to obtain the corresponding global timing value of the transmitter. The audio receiver reads the global transmission timestamp from the timestamp field in the synchronization header of the received superframe structure and uses the read global transmission timestamp value as the global timing value of the transmitter. Optionally, the timestamp field is located after the preset field in the synchronization header, the timestamp field has a bit width of 32 bits, and the value of the timestamp field represents the global time count value of the audio transmitter at the time of transmission of the superframe structure.
[0026] In practice, the audio receiver reads the value of its local timer at the end of the synchronization header of the superframe structure, and uses this value as the local reception time. The audio receiver is equipped with a local timer, which uses its local crystal oscillator clock as the counting reference. When the audio receiver detects that the last symbol of the superframe structure's synchronization header has been received, it generates a synchronization header end interrupt. In the synchronization header end interrupt service routine, it reads the current count value of the local timer and uses this count value as the local reception time.
[0027] In practice, the audio receiver calculates the difference between the global timing value of the transmitter and the local reception time as the original deviation value. Optionally, the original deviation value is obtained by subtracting the local reception time from the global timing value of the transmitter. When the global timing value of the transmitter is greater than the local reception time, the original deviation value is positive, indicating that the global timing value of the transmitter leads the local timer value of the audio receiver.
[0028] In practice, the audio receiver subtracts the original deviation value from the preset air transmission delay estimate to obtain the initial time deviation. The initial time deviation is calculated using the following formula:
[0029] in, This represents the initial time deviation, which is the initial time deviation value used by the audio receiver to adjust the local playback clock frequency. This represents the global timing value of the sending end, which is the global timing value of the sending end corresponding to the global transmission timestamp parsed by the audio receiver from the synchronization header of the received superframe structure; This indicates the local reception time, which is the local timer value of the audio receiver at the end of the synchronization header of the received superframe structure; This represents the preset air transmission delay estimate, which is an adaptive delay compensation amount that is dynamically updated based on the historical round-trip delay measurements between the audio transmitter and receiver.
[0030] In specific implementation, the preset air transmission delay estimate is obtained as follows: After receiving the superframe structure, the audio receiver sends a response packet in a predetermined response time slot. The response packet contains the local timer value of the audio receiver at the time of response packet transmission. The audio transmitter receives the response packet and records the local timer value of the audio transmitter at the time of response packet reception. The audio transmitter calculates the round-trip delay measurement, which is the time difference from sending the superframe structure to receiving the response packet minus the response packet processing time. The audio transmitter uses half of the round-trip delay measurement as the new air transmission delay estimate and updates the preset air transmission delay estimate with the new air transmission delay estimate. Optionally, the audio receiver executes the response packet transmission process every time it receives a superframe structure, and the preset air transmission delay estimate is updated each time a new air transmission delay estimate is obtained.
[0031] See Figure 4 In the figure, the horizontal axis represents the audio receiver serial number, ranging from 0 to 500, and the vertical axis represents the time deviation, in ticks. The figure shows the discrete distribution of the three types of time deviation data involved in the above embodiment, namely "original deviation value", "preset air transmission delay estimate" and "initial time deviation".
[0032] Specifically, the blue dots represent the original deviation values. The data points are distributed in the range of approximately 75 to 175 ticks. The overall fluctuation is relatively large, but the random fluctuations remain relatively stable and without obvious trend throughout the entire sequence range. This indicates that there is a certain degree of jitter in the difference between the global timing value of the transmitting end and the local reception time of the audio receiving end, but the overall deviation level remains stable.
[0033] The orange squares represent the preset air transmission delay estimates. The data points are concentrated in the range of approximately 10 to 30 ticks, with a fluctuation range significantly smaller than the original deviation value. Furthermore, the data points remain essentially constant as the audio receiver sequence number changes, indicating that the air transmission delay estimate is a stable adaptive delay compensation value used to reduce the impact of transmission delay.
[0034] The green triangle represents the initial time deviation, as shown by the formula. Calculations show that subtracting the preset air transmission delay estimate from the original deviation value reveals that the initial time deviation is mainly distributed in the range of approximately 50 to 150 ticks. The overall amplitude is lower than the original deviation value, and the data points do not show a significant upward or downward trend throughout the entire sequence range. This indicates that by subtracting the air transmission delay estimate, the fluctuation range of the initial time deviation is effectively compressed, demonstrating the role of delay compensation.
[0035] In practice, the audio receiver uses the initial time deviation as the input error value of the proportional-integral (PI) controller. The initial time deviation is obtained through the superframe structure reception process and represents the deviation between the global timing value at the transmitting end and the local reception time, as well as the preset estimated air transmission delay. After each superframe structure reception and calculation, the audio receiver writes the initial time deviation into the input register of the PI controller.
[0036] In practical implementation, the proportional-integral (PI) controller consists of a proportional unit, an integral unit, and an adder. The proportional and integral units are connected in parallel. The input error value of the PI controller is input to both the proportional and integral units. The proportional unit multiplies the input error value by a proportional gain coefficient to obtain the proportional control component. The integral unit integrates the input error value over time and multiplies the result by an integral gain coefficient to obtain the integral control component. The adder adds the proportional control component and the integral control component to obtain the frequency adjustment control quantity. The output of the PI controller is connected to the local crystal oscillator frequency division coefficient generation module of the audio receiver, and the PI controller sends the frequency adjustment control quantity to the local crystal oscillator frequency division coefficient generation module.
[0037] In practical implementation, the frequency adjustment control quantity is calculated using the following formula:
[0038] in, This represents the frequency adjustment control quantity, which is the control quantity output by the proportional-integral controller used to adjust the local crystal oscillator frequency division coefficient. This represents the input error value, which is the initial time deviation. This represents the proportional gain coefficient, with a value of 0.5. This represents the integral gain coefficient, the value of which is determined based on the integral time constant. ; Indicates the integration time constant; Represents the integral variable, with values ranging from 0 to... ; This indicates the current moment, the moment when the proportional-integral controller performs the calculation of the frequency adjustment control quantity; Indicates the reference time unit (values are...) seconds or (Number of clock cycles) is used to normalize the time deviation into a dimensionless value.
[0039] In practical implementation, the proportional gain coefficient The value of 0.5 is based on the proportional gain coefficient. The proportional gain coefficient is used to adjust the contribution ratio of the proportional control component to the output frequency adjustment control quantity. An excessively high value will cause oscillations in the frequency adjustment control quantity, affecting the proportional gain coefficient. A value that is too small will result in insufficient correction speed for the initial time deviation. Proportional gain coefficient. When set to 0.5, the proportional control component can quickly track the initial time deviation without causing significant jitter in the uniform playback clock.
[0040] In practical implementation, the integral gain coefficient The value of is determined by the integral time constant. Determined. When the integration time constant... When set to 50 milliseconds, the proportional gain coefficient Substitute 0.5 into The integral gain coefficient is calculated. The value is 10, which is the integral gain coefficient. The value is 10.
[0041] In practical implementation, the integral time constant is dynamically configured based on the local crystal oscillator frequency drift rate of the audio receiver. The audio receiver statistically analyzes the rate of change of the local crystal oscillator frequency division coefficient correction within a preset measurement period to obtain the local crystal oscillator frequency drift rate. When the local crystal oscillator frequency drift rate increases, the integral time constant decreases; when the local crystal oscillator frequency drift rate decreases, the integral time constant increases. The value range of the integral time constant is 10 milliseconds to 100 milliseconds. The mapping relationship between the integral time constant and the local crystal oscillator frequency drift rate is as follows: when the local crystal oscillator frequency drift rate is less than 0.5 parts per million, the integral time constant is 100 milliseconds; when the local crystal oscillator frequency drift rate is between 0.5% and 1.5% per million, the integral time constant is 50 milliseconds; when the local crystal oscillator frequency drift rate is greater than 1.5%, the integral time constant is 10 milliseconds. The basis for this mapping relationship is that the larger the local crystal oscillator frequency drift rate, the faster the proportional-integral controller needs to track the local crystal oscillator frequency change; therefore, a smaller integral time constant is selected.
[0042] In practice, the audio receiver adds the frequency adjustment control value to the local crystal oscillator's division coefficient to obtain a corrected division coefficient. The initial value of the local crystal oscillator's division coefficient is determined by the ratio of the local crystal oscillator clock frequency to the target playback clock frequency. The corrected division coefficient is then used for subsequent frequency division processing.
[0043] In practice, the audio receiver divides the local crystal oscillator clock according to a correction division factor to generate a unified playback clock. The local crystal oscillator clock is the clock signal output by the local crystal oscillator of the audio receiver. The division process uses a programmable divider, which receives the local crystal oscillator clock signal and the correction division factor, and divides the local crystal oscillator clock signal according to the correction division factor. The divided clock signal is used as the unified playback clock. The unified playback clock is used to drive the playback timing and audio data extraction of the audio receiver.
[0044] In practical implementation, the integral unit of the proportional-integral (PI) controller performs integral accumulation each time a new input error value is received. The execution cycle of the PI controller is synchronized with the reception cycle of the superframe structure. After each superframe structure reception is completed, the audio receiver updates the input error value, and the PI controller calculates a new frequency adjustment control amount based on the updated input error value. Optionally, the PI controller performs amplitude limiting processing on the frequency adjustment control amount when calculating it. The amplitude limiting range of the frequency adjustment control amount is ±5% of the initial value of the local crystal oscillator frequency division coefficient to avoid excessive frequency adjustment control amount causing jitter in the unified playback clock.
[0045] In specific implementation, please refer to Figure 3 The audio receiver divides the audio data segment of the superframe structure into multiple audio frame units according to a fixed audio frame length. The fixed audio frame length is written by the audio sender in the frame length configuration field of the superframe structure's synchronization header. The audio receiver reads the frame length configuration field when parsing the superframe structure to obtain the fixed audio frame length. Using the fixed audio frame length as the unit of division, the audio receiver continuously divides the audio data segment, starting from the beginning address, to obtain multiple audio frame units. The starting address of each audio frame unit in the audio data segment is the product of the corresponding division number and the fixed audio frame length.
[0046] In practical implementation, the audio receiver labels each audio frame unit with a frame sequence number and a frame length identifier. The frame sequence number increases sequentially according to the order of the multiple audio frame units in the audio data segment, starting from 0. The frame length identifier is used to indicate the effective audio data length of each audio frame unit. For the divided audio frame units, when the total length of the audio data segment is divisible by the fixed audio frame length, the frame length identifier of each audio frame unit is equal to the fixed audio frame length. When the total length of the audio data segment is not divisible by the fixed audio frame length, the effective audio data length of the last audio frame unit is less than the fixed audio frame length, and the frame length identifier of the last audio frame unit is equal to the total length of the audio data segment minus the sum of the lengths of all preceding audio frame units; the frame length identifiers of the remaining audio frame units are equal to the fixed audio frame length. Optionally, the frame length identifier is in bytes, and the bit width of the frame length identifier is 12 bits.
[0047] In practice, the audio receiver queries the corresponding target frame number based on the cycle number of the current playback cycle within each playback period of the unified playback clock. Each playback cycle of the unified playback clock corresponds to the playback timing of one audio frame. The cycle number of the current playback cycle starts from 0 and increments sequentially according to the playback cycle of the unified playback clock. The audio receiver maintains the cycle number of the current playback cycle and increments it by 1 at the beginning of each playback cycle of the unified playback clock.
[0048] In practice, the mapping relationship between the period number and the target frame number is predefined by the frame mapping table field in the synchronization header of the superframe structure. When receiving the superframe structure, the audio receiver parses the frame mapping table field from the synchronization header. The frame mapping table field stores multiple target frame numbers sequentially, each occupying 16 bits. The 0th 16 bits of the frame mapping table field stores the target frame number corresponding to period number 0, the 1st 16 bits store the target frame number corresponding to period number 1, and so on. The audio receiver reads the corresponding target frame number from the frame mapping table field based on the period number of the current playback period.
[0049] In practice, the target frame number is obtained by looking up the following formula:
[0050] in, This indicates the target frame number, which is the target frame number corresponding to the current playback cycle's cycle number in the frame mapping table field. This indicates the cycle number of the current playback cycle, which is the count value of the playback cycles that have elapsed in the unified playback clock. Starting from 0 and increasing sequentially; This indicates the mapping function defined in the frame mapping table field. The input is the cycle number of the current playback cycle. , The output is the target frame number. .
[0051] In specific implementation, the audio receiver extracts the audio frame unit corresponding to the target frame number from the audio data segment based on the obtained target frame number, and uses this as the audio frame data. The audio receiver calculates the starting address of the audio frame unit corresponding to the target frame number in the audio data segment based on the target frame number and the fixed audio frame length of each audio frame unit. The starting address of the audio frame unit corresponding to the target frame number in the audio data segment is the product of the target frame number and the fixed audio frame length. Starting from the calculated starting address, the audio receiver reads data of the effective audio data length represented by the frame length identifier corresponding to the audio frame unit, thus obtaining the audio frame data. Optionally, when the audio frame unit corresponding to the target frame number is the last audio frame unit, the effective audio data length read by the audio receiver is the frame length identifier of the last audio frame unit; when the audio frame unit corresponding to the target frame number is not the last audio frame unit, the effective audio data length read by the audio receiver is the fixed audio frame length.
[0052] In practice, the audio receiver sends the audio frame data to the audio decoder for decoding, obtaining the decoded pulse-code modulation sample block. The audio receiver extracts the audio frame data from the audio data segment of the superframe structure; the audio frame data is the encoded audio data unit. The audio decoder is a low-complexity communication codec; its input is the audio frame data, and after decoding, it outputs a pulse-code modulation sample block. The pulse-code modulation sample block consists of multiple sequentially arranged sample values, each representing the amplitude of the audio waveform at the corresponding sampling time. The bit width of each sample value is 16 bits or 24 bits, determined in advance by the audio transmitter and receiver.
[0053] In practice, driven by a unified playback clock, pulse-code modulation sample blocks are written to the free area of the playback buffer. The playback buffer is a circular buffer, including a write pointer and a read pointer. The write pointer points to the starting address of the free area in the playback buffer, and the read pointer points to the starting address of the fill area. Driven by the unified playback clock, the audio receiver sequentially writes the sample values from the pulse-code modulation sample blocks to the free area pointed to by the write pointer. After writing a sample value, the audio receiver increments the write pointer by the storage bit width of that sample value, in the same direction as the address increment of the playback buffer.
[0054] In practice, starting from the beginning address of the playback buffer, sample values are read from the playback buffer according to the beat of a unified playback clock. The read address for reading sample values is calculated using the following formula:
[0055] in, Indicates the first The address at which each sample value is read from the playback buffer; This indicates the starting address for filling, which is the starting address of the area of already filled sample values in the playback buffer, determined by the current value of the read pointer of the playback buffer; This represents the sample value index, ranging from 0 to the total number of sample values contained in the pulse code modulation sample block minus 1. The total number of sample values contained in the pulse code modulation sample block is determined by the length of the pulse code modulation sample block output by the audio decoder. This represents the storage bit width for each sample value, and the number of bytes occupied by each sample value in the playback buffer. The value can be 2 or 3. When the value is 2, the bit width of each sample value is 16 bits. When the value is 3, the bit width of each sample value is 24 bits.
[0056] In practice, the audio receiver uses the sample value sequence number. and formula The read address is calculated, and the corresponding sample value is read from the calculated read address. Driven by a unified playback clock, the audio receiver sequentially reads each sample value from the pulse code modulation sample block. After reading each sample value, the sample value sequence number is recorded. Increment by 1 until all sample values in the pulse code modulation sample block have been read. The reading operation starts from the filling start address and proceeds in the order of address increment in the playback buffer.
[0057] In practice, the read sample values are sent to the audio digital-to-analog converter (DAC) for playback output. The audio receiver sends the read sample values to the DAC sequentially according to the reading order. The DAC receives the sample values and converts them into analog audio signals for playback output. Optionally, the audio receiver provides sample values to the DAC according to the beat of a unified playback clock, and the DAC completes one digital-to-analog conversion at each beat of the unified playback clock.
[0058] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for synchronous transmission of low-power Bluetooth low-latency audio data, characterized in that, include: Generate a superframe structure containing a synchronization header and audio data segments at the audio sending end; Based on the master clock reference time in the synchronization header of the superframe structure, calculate the global transmission timestamp of the superframe structure at the transmission time; The superframe structure carrying the global transmission timestamp is transmitted to multiple audio receivers via a Bluetooth broadcast channel; The audio receiving end receives the superframe structure and parses the global transmission timestamp. Calculate the initial time deviation based on the global transmission timestamp and the local reception time of the audio receiver; The local playback clock frequency of the audio receiver is adjusted according to the initial time deviation to obtain a unified playback clock; Based on the unified playback clock, audio frame data is extracted from the audio data segment of the superframe structure; The audio frame data is decoded and played synchronously according to the unified playback clock.
2. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 1, characterized in that, The step of calculating the global transmission timestamp of the superframe structure at the transmission time based on the master clock reference time in the synchronization header of the superframe structure includes: Extract the master clock reference time from the synchronization header of the superframe structure; Obtain the local timer reading at the transmitting end corresponding to the transmission time of the superframe structure; The difference between the local timer reading at the transmitting end and the reference time of the master clock is used as the original time offset of the superframe structure; The original time offset is superimposed on the master clock reference time to obtain the global transmission timestamp.
3. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 2, characterized in that, The step of calculating the initial time deviation based on the global transmission timestamp and the local reception time of the audio receiver includes: Parse the global transmission timestamp in the superframe structure to obtain the global timing value of the sending end corresponding to the global transmission timestamp; The local timer value of the audio receiver at the end of the synchronization header of the superframe structure is read and used as the local reception time. Calculate the difference between the global timing value at the transmitting end and the local receiving time, and use it as the original deviation value; The initial time deviation is obtained by subtracting the original deviation value from the preset air transmission delay estimate.
4. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 1, characterized in that, The step of adjusting the local playback clock frequency of the audio receiver based on the initial time deviation to obtain a unified playback clock includes: The initial time deviation is used as the input error value of the proportional-integral controller; The control quantity is adjusted by outputting the frequency of the proportional-integral controller. The frequency adjustment control value is superimposed on the local crystal oscillator frequency division coefficient of the audio receiver to obtain the corrected frequency division coefficient; The local crystal oscillator clock is divided according to the modified frequency division coefficient to generate the unified playback clock.
5. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 1, characterized in that, The step of extracting audio frame data from the audio data segment of the superframe structure based on the unified playback clock includes: The audio data segment of the superframe structure is divided into multiple audio frame units according to a fixed audio frame length; Each audio frame unit is labeled with a frame number and a frame length identifier; Within each playback cycle of the unified playback clock, the corresponding target frame number is queried based on the cycle number of the current playback cycle. Extract the audio frame unit corresponding to the target frame number from the audio data segment, and use it as the audio frame data.
6. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 1, characterized in that, The step of decoding the audio frame data and playing it synchronously according to the unified playback clock includes: The audio frame data is sent to an audio decoder for decoding to obtain a decoded pulse code modulation sample block. Driven by the unified playback clock, the pulse code modulation sample block is written into the free area of the playback buffer; Starting from the filling start address of the playback buffer, sample values are read from the playback buffer according to the beat of the unified playback clock; The read sample values are sent to the audio digital-to-analog converter for playback output.
7. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 2, characterized in that, The step of extracting the master clock reference time from the synchronization header of the superframe structure includes reading the global clock reference value provided by the master clock source of the audio transmitter from a preset field of the synchronization header.
8. The method for low-power Bluetooth low-latency audio data synchronization transmission according to claim 3, characterized in that, The preset over-the-air transmission delay estimate is an adaptive delay compensation amount that is dynamically updated based on the historical round-trip delay measurements between the audio transmitter and the audio receiver.
9. A method for synchronous transmission of low-power Bluetooth low-latency audio data according to claim 4, characterized in that, The integral time constant of the proportional-integral controller is dynamically configured based on the local crystal oscillator frequency drift rate of the audio receiver.
10. A method for synchronous transmission of low-power Bluetooth low-latency audio data according to claim 5, characterized in that, The mapping relationship between the cycle number and the target frame number is predefined by the frame mapping table field in the synchronization header of the superframe structure.
