Audio synchronization circuit and audio synchronization method

By designing an audio synchronization circuit in the wireless network audio playback system, using wireless network technology and digital audio processing technology to calculate and compensate the frequency deviation value, the problem of out-synchronization of the speaker audio signal playback time is solved, and more accurate audio synchronization and Better user experience.

CN115664577BActive Publication Date: 2025-02-25REALTEK SEMICON CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211316085.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-26
Publication Date
2025-02-25
Estimated Expiration
2042-10-26

Smart Images

  • Figure CN115664577B_ABST
    Figure CN115664577B_ABST
Patent Text Reader

Abstract

The present application discloses an audio synchronization circuit and an audio synchronization method. At least one beacon packet is received by the audio synchronization circuit to generate a wireless network time synchronization function data. According to a synchronization control signal, the wireless network time synchronization function data and a digital audio time synchronization function data are compared to obtain a frequency deviation value. The digital audio clock is compensated according to the frequency deviation value. Thus, the audio circuit can adjust the digital audio clock frequency according to the frequency deviation value to complete synchronization with the sending device, avoid unpredictable delays caused by software processing and wireless channel competition, and achieve the purpose of more accurate time synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of audio circuits, and in particular to an audio synchronization circuit and an audio synchronization method of a wireless network audio playback system. Background Art

[0002] The current audio system includes a host and a plurality of speakers, wherein the host is connected to the plurality of speakers by cables respectively, and the host transmits an audio signal to the plurality of speakers via the cables, so as to transmit the audio signal of the host to the plurality of speakers for playing.

[0003] With the popularization of wireless networks, existing audio systems apply wireless networks to the audio systems. The host transmits the audio signal to the multiple speakers through the wireless network, and the multiple speakers receive the audio signal through the wireless network and play according to the audio signal. Wireless network transmission reduces the wiring generated by connecting the host and the multiple speakers through cables and the problem of severe attenuation of the audio signal due to the cables.

[0004] However, in the sound system that transmits the audio signal via a wireless network, the host and the multiple speakers use different crystal oscillators, and the crystal oscillators are installed in different devices. The crystal oscillators are also affected by different temperatures in different devices, resulting in differences in oscillation frequencies between the crystal oscillators. As a result, after receiving the audio signal, the multiple speakers play the audio signal at different times, which greatly affects the user's listening to the audio signal.

[0005] The prior art uses a Precision Time Protocol (PTP) or a WiFi Time Synchronization Function (WiFi TSF). The PTP mainly executes a synchronization program on the host and a speaker. In the synchronization program, the host sends a synchronization message (SynchronizeMessage) and a follow-up message (Follow Up Message) to the speaker. Then, after receiving the synchronization message and the follow-up message, the speaker sends a delay request message (Delay Request Message) to the host.

[0006] In detail, when the host sends the synchronization message and the follow-up message to the speaker, the host will record a synchronization message sending time and a synchronization message arrival time of the synchronization message, and encapsulate the synchronization message sending time in the follow-up message, and then send the follow-up message to the speaker. Then, when the speaker sends the delay request message, it records a delay request message sending time. Then, when the host obtains the delay request message, it records a delay request message arrival time of the delay request message. After that, the host encapsulates the delay request message arrival time in a delay request response message (Delay Response Message) and transmits the delay request response message to the speaker. When the speaker obtains the synchronization message sending time, the synchronization message arrival time, the delay request message sending time and the delay request response message arrival time, a time offset data (Offset) and a transmission delay data (Delay) are calculated.

[0007] However, when synchronizing in PTP mode, the host and the speaker must obtain the synchronization message sending time, the synchronization message arrival time, the delay request message sending time and the delay request response message arrival time before they can obtain the time deviation data. When the speaker does not receive one of the synchronization message sending time, the synchronization message arrival time, the delay request message sending time and the delay request response message arrival time, the synchronization procedure will fail, and the transmission delay data will not be sent until after the steps of recording the sending time, software processing, carrier monitoring or channel contention. After the riser receives the aforementioned message and passes it to the software layer to record the arrival time, the transmission delay data will have a value that cannot be determined due to the aforementioned steps. Therefore, there is still no way to achieve synchronization in the synchronization procedure.

[0008] Furthermore, the wireless network time synchronization function is based on the 802.11 protocol defined by the Institute of Electrical and Electronics Engineer (IEEE). When a data transmission link is established between a wireless access device (AP) and a workstation (STA), the wireless access device can synchronize the corresponding timestamp information carried in a beacon frame (Beacon) or a probe response frame (probe Response) to the counter of the local time synchronization function (TSF) to keep the local TSF time value consistent with the time of the wireless access device, thereby achieving the purpose of time synchronization.

[0009] However, with the existing wireless network time synchronization function, the wireless access device only carries timestamp information in the beacon frame or the detection response frame, but does not synchronize the playback frequency of the audio signal. Therefore, in the audio system, the received audio signal cannot be synchronized.

[0010] Therefore, the prior art is indeed in need of further providing more improved solutions. Summary of the invention

[0011] In view of the above-mentioned deficiencies in the prior art, the main purpose of this application is to provide an audio synchronization circuit and an audio synchronization method, which synchronize and play digital audio through wireless network technology and digital audio processing technology, avoid unpredictable delays caused by software processing and wireless channel competition, and make the time more accurate.

[0012] The main technical means adopted to achieve the above purpose is to make the aforementioned audio synchronization circuit, which includes:

[0013] a synchronous control circuit which periodically outputs a synchronous control signal;

[0014] A wireless network time synchronization function conversion circuit receives a wireless network time synchronization function data from at least one beacon packet, and performs a value conversion procedure on the wireless network time synchronization function data to generate a converted wireless network time synchronization function data;

[0015] a digital audio time synchronization function counter receiving a digital audio clock frequency to output a digital audio time synchronization function count;

[0016] a digital audio time synchronization function circuit, which receives the digital audio time synchronization function count and generates a digital audio time synchronization function data; wherein the wireless network time synchronization function data is not synchronized with the digital audio time synchronization function data;

[0017] a processing circuit connected to the wireless network time synchronization function conversion circuit and the digital audio time synchronization function circuit, and receiving the synchronization control signal to simultaneously obtain the wireless network time synchronization function data and the digital audio time synchronization function data; wherein the processing circuit calculates a count deviation value and a frequency deviation value according to the wireless network time synchronization function data and the digital audio time synchronization function data;

[0018] Wherein, the digital audio clock frequency is compensated according to the frequency deviation value.

[0019] Preferably, the wireless network time synchronization function conversion circuit includes:

[0020] A wireless network time synchronization function circuit;

[0021] a compensation calculation circuit connected to the wireless network time synchronization function circuit and outputting a compensation value;

[0022] The compensation calculation circuit transmits the compensation value to the wireless network time synchronization function circuit to perform an addition operation procedure on the compensation value and the wireless network time synchronization function data to generate the converted wireless network time synchronization function data.

[0023] Preferably, the synchronization control circuit further comprises:

[0024] a timer, which performs a counting procedure according to the at least one beacon packet to generate a beacon count value;

[0025] The synchronization control circuit compares the beacon count value according to a count threshold value to output the synchronization control signal.

[0026] Preferably, the processing circuit obtains a notifying playing time data, and plays a digital audio data according to the notifying playing time data.

[0027] Through the above-mentioned structure, when the audio synchronization circuit receives the at least one beacon packet to generate the synchronization control signal, the wireless network time synchronization function data and the digital audio time synchronization function data are compared according to the synchronization control signal to obtain the frequency deviation value, and the digital audio clock is compensated according to the frequency deviation value. Thereby, the audio synchronization circuit can adjust the digital audio clock frequency according to the frequency deviation value to complete synchronization with the sending device, avoiding unpredictable delays caused by software processing and wireless channel competition, and achieving the purpose of more accurate time synchronization.

[0028] Another main technical means adopted to achieve the above purpose is to use the aforementioned audio synchronization method, wherein the audio synchronization method is performed by an audio synchronization circuit to perform the following steps:

[0029] Obtain at least one beacon packet and at least one digital audio data through a wireless network channel;

[0030] Parsing the at least one beacon packet to obtain wireless network time synchronization function data;

[0031] Obtaining a digital audio clock frequency of the audio synchronization circuit;

[0032] Generate a digital audio time synchronization function data according to the digital audio clock frequency; wherein the wireless network time synchronization function data is not synchronized with the digital audio time synchronization function data;

[0033] Periodically generate a periodic synchronization signal;

[0034] Performing a numerical conversion procedure on the wireless network time synchronization function data to obtain a converted wireless network time synchronization function data;

[0035] Calculating a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data;

[0036] The digital audio clock frequency is compensated according to the frequency deviation value.

[0037] Preferably, after the aforementioned method executes the step of "calculating a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data", the method comprises the following sub-steps:

[0038] Execute a phase difference calculation procedure according to the converted wireless network time synchronization function data and the converted wireless network time synchronization function data stored last time to obtain wireless network time synchronization function increment data;

[0039] After executing the phase difference calculation procedure according to the digital audio time synchronization function data and the digital audio time synchronization function data stored last time, a digital audio time synchronization function increment data is obtained;

[0040] The phase difference operation procedure is performed according to the wireless network time synchronization function increment data and the digital audio time synchronization function increment data to obtain the frequency deviation value.

[0041] Preferably, when the aforementioned method executes the step of "obtaining at least one beacon packet and at least one digital audio data through a wireless network channel", the method further executes the following sub-steps:

[0042] Get-notify playback time data;

[0043] The digital audio data is played according to the notified playing time data.

[0044] Preferably, when the method is executed to the step of "performing a numerical conversion procedure on the wireless network time synchronization function data to obtain a converted wireless network time synchronization function data", the method includes the following sub-steps:

[0045] obtaining a compensation value;

[0046] An addition operation procedure is performed according to the compensation value and the wireless network time synchronization function data to generate the converted wireless network time synchronization function data.

[0047] Preferably, the time unit of the compensation value is nanoseconds.

[0048] Preferably, when the aforementioned method executes the step of "playing the digital audio data", the method further comprises the following sub-steps:

[0049] Moving the digital audio data;

[0050] Converting the digital audio data into an analog audio signal;

[0051] The analog audio signal is played.

[0052] Through the above method, when the audio synchronization circuit receives the at least one beacon packet to generate the synchronization control signal, the wireless network time synchronization function data and the digital audio time synchronization function data are compared according to the synchronization control signal to obtain the frequency deviation value, and the digital audio clock is compensated according to the frequency deviation value. Thereby, the audio synchronization circuit can adjust the frequency of the digital audio clock according to the frequency deviation value to avoid unpredictable delays caused by software processing and wireless channel competition, thereby achieving the purpose of more accurate time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0054] Figure 1 It is a block diagram of the application scenario of the audio synchronization circuit of the present application.

[0055] Figure 2 It is a block diagram of a specific embodiment of the audio synchronization circuit of the present application.

[0056] Figure 3 It is a block diagram of a specific embodiment of the wireless network time synchronization function conversion circuit of the present application.

[0057] Figure 4 It is a block diagram of a specific embodiment of the synchronous control circuit of the present application.

[0058] Figure 5 This is a flow chart of an embodiment of the audio synchronization method of the present application.

[0059] Figure 6 This is a flow chart of another embodiment of the audio synchronization method of the present application.

[0060] Figure 7 This is a flow chart of another embodiment of the audio synchronization method of the present application.

[0061] Figure 8 This is a flow chart of another embodiment of the audio synchronization method of the present application.

[0062] Fig. 9 This is a flow chart of another embodiment of the audio synchronization method of the present application.

[0063] Fig.10 This is a flow chart of another embodiment of the audio synchronization method of the present application. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0065] The audio synchronization circuit of the present application is applied to a wireless network audio playback system, such as Figure 1As shown, the wireless network audio playback system includes a transmitting device (Transmitter, Tx) 10 and a receiving device (Received, Rx) 20, the transmitting device 10 is linked to the receiving device 20 through a wireless network channel, the receiving device 20 includes a wireless network media access control layer (WiFi Media Access Control, WiFi MAC) 21, and the wireless network media access control layer 21 includes a wireless network time synchronization function counter (Wifi Time Synchronization Function Timer, Wifi TSFT) 210, and the receiving device 20 further includes a digital audio playback clock (Integrated Interchip Sound Phase-Locked Loops, I2S PLL) 22, a buffer (Buffer) 23, a digital audio circuit (Integrated Interchip Sound, I2S) 24 and a digital to analog converter (Digital to Analog Converter, DAC) 25. The audio synchronization circuit 30 is electrically connected to the wireless network media access control layer 21, the wireless network time synchronization function counter 210, the digital audio playback clock 22, the buffer 23 and the digital audio circuit 24. The wireless network media access control layer 21 is electrically connected to the buffer 23. The digital audio circuit 24 is electrically connected to the digital audio playback clock 22 and the digital-to-analog converter 25. In this embodiment, the receiving device 20 is a speaker with a wireless network connection.

[0066] Specifically, the digital audio playback clock 22 generates a digital audio clock. When the wireless network media access control layer 21 receives at least one beacon packet (Beacon) and at least one digital audio data from a wireless network channel, the beacon packet includes a timestamp information (Timestamp), and the wireless network time synchronization function counter 210 receives the timestamp information to generate a wireless network time synchronization function data (Wifi Time Synchronization Function, Wifi TSF). In addition, the wireless network media access control layer 21 stores the digital audio data in the buffer 23.

[0067] In this embodiment, the digital audio circuit 24 includes a direct memory access (DMA) circuit 240 .

[0068] Regarding the specific embodiment of the audio synchronization circuit 30 of the present application, as shown in FIG. Figure 2 As shown, the audio synchronization circuit 30 includes a wireless network time synchronization function conversion circuit 31, a digital audio time synchronization function circuit 32, a digital audio time synchronization function counter 33, a count deviation calculation circuit 34, a synchronization request circuit 35, a processing circuit 36 ​​and a synchronization control circuit 37. In one embodiment, the synchronization request circuit 35 can be omitted, and the processing circuit 36 ​​directly receives the control signal of the synchronization control circuit 37.

[0069] In this embodiment, the wireless network time synchronization function conversion circuit 31 is electrically connected to the synchronization control circuit 37 .

[0070] In this embodiment, the digital audio time synchronization function counter 33 is electrically connected to the digital audio playback clock 22 , the digital audio time synchronization function circuit 32 , and the counting deviation calculation circuit 34 , respectively.

[0071] In this embodiment, the processing circuit 36 ​​is electrically connected to the wireless network time synchronization function conversion circuit 31, the digital audio time synchronization function circuit 32, the counting deviation calculation circuit 34 and the synchronization request circuit 35, and the processing circuit 36 ​​is electrically connected to the digital audio playback clock 22, the buffer 23 and the digital audio circuit 24, respectively.

[0072] In this embodiment, the digital audio circuit 24 further includes a resampler 26 and a DMA 240 .

[0073] In this embodiment, the synchronization control circuit 37 periodically outputs a synchronization control signal to the wireless network time synchronization function conversion circuit 31, the digital audio time synchronization function circuit 32 and the processing circuit 36, so that the processing circuit 36 ​​can simultaneously obtain a wireless network time synchronization function data from the wireless network time synchronization function conversion circuit 31 and a digital audio time synchronization function data from the digital audio time synchronization function circuit 32 according to the synchronization control signal. In another embodiment, the synchronization control circuit 37 generates the synchronization control signal based on the triggering of the at least one beacon packet. Such a design can ensure that the time synchronization mechanism can be activated when the at least one beacon packet is received. For example, the synchronization control signal can be triggered to generate after about 10 of the at least one beacon packets. In this embodiment, the digital audio time synchronization function data of the digital audio time synchronization function circuit 32 comes from the digital audio time synchronization function counter 33.

[0074] In this embodiment, the wireless network time synchronization function conversion circuit 31 receives the wireless network time synchronization function data (Wifi Time Synchronization Function, Wifi TSF) from the wireless network time synchronization function counter 210, the time unit of the wireless network time synchronization function data is microseconds (us), and performs a numerical conversion procedure on the value of the received wireless network time synchronization function data to convert the wireless network time synchronization function data into a digital audio frequency domain (I2S domain). At this time, the time unit of the converted wireless network time synchronization function data is nanoseconds (ns). The numerical conversion procedure converts the data with a time unit of microseconds (us) into data with a time unit of nanoseconds (ns).

[0075] In this embodiment, if Figure 3 As shown, the wireless network time synchronization function conversion circuit 31 also includes a wireless network time synchronization function circuit 310 and a compensation calculation circuit 311, and the wireless network time synchronization function circuit 310 is electrically connected to the compensation calculation circuit 311. Since the function of the wireless network time synchronization function conversion circuit 31 is to convert the numerical unit of microseconds (us) into nanoseconds (ns), the compensation calculation circuit 311 in the wireless network time synchronization function conversion circuit 31 is used to calculate its compensation value to compensate the converted wireless network time synchronization function data.

[0076] In this embodiment, if Figure 4 As shown, the synchronization control circuit 37 stores a counting threshold value, and the synchronization control circuit 37 includes a timer 370. The timer 370 performs a counting procedure according to the at least one beacon packet to generate a beacon count value. The synchronization control circuit 37 compares the beacon count value according to the counting threshold value to output the wireless network time synchronization function data. By counting the at least one beacon packet, the wireless network time synchronization function data is output with the least delay, so that the digital audio data can be more easily synchronized.

[0077] In this embodiment, the processing circuit 36 ​​obtains the wireless network time synchronization function data and the digital audio time synchronization function data simultaneously according to a synchronization request signal, and calculates the count deviation value (Drift) and a frequency deviation value (unit: Parts Per Million, PPM) according to the wireless network time synchronization function data and the digital audio time synchronization function data in the digital audio frequency domain. According to the frequency deviation value, the digital audio clock 22 is corrected by feedback compensation. At this time, the frequency of the digital audio clock corrected by feedback compensation achieves a synchronization effect. Preferably, the digital audio time synchronization function counter 33 performs compensation according to the count deviation value (Drift) at the same time.

[0078] In this embodiment, the synchronization request signal is an interrupt request signal for the processing circuit 36. Thus, when the processing circuit 36 ​​receives the synchronization request signal, it can immediately interrupt other programs and immediately process synchronization-related programs. In this embodiment, when the processing circuit 36 ​​receives the interrupt request signal, the processing circuit 36 ​​also performs a phase difference operation procedure based on the wireless network time synchronization function data in the digital audio frequency domain and the wireless network time synchronization function data of the last stored digital audio frequency domain (for example, stored in the wireless network time synchronization function circuit 310) to obtain a wireless network time synchronization function increment data in the digital audio frequency domain, and the digital audio time synchronization function data and the last stored digital audio time synchronization function data (for example, stored in the digital audio time synchronization function circuit 32) are subjected to the phase difference operation procedure to obtain a digital audio time synchronization function increment data. Then, the processing circuit 36 ​​performs the phase difference operation procedure based on the wireless network time synchronization function increment data in the digital audio frequency domain and the digital audio time synchronization function increment data to obtain the counting deviation value, and performs a proportional operation procedure based on the counting deviation value and the wireless network time synchronization function increment data in the digital audio frequency domain to obtain the frequency deviation value. In this embodiment, the phase difference operation procedure is to obtain the difference between the data, for example: subtracting the wireless network time synchronization function data in the digital audio frequency domain from the wireless network time synchronization function data in the digital audio frequency domain at the last time to find the difference between the wireless network time synchronization function data in the digital audio frequency domain and the wireless network time synchronization function data in the digital audio frequency domain at the last time.

[0079] In this embodiment, when the processing circuit 36 ​​performs a subtraction operation according to the converted wireless network time synchronization function data and the wireless network time synchronization function data to calculate a compensation value, the compensation calculation circuit 311 stores the compensation value and transmits the compensation value to the wireless network time synchronization function circuit 310 to perform an addition operation on the compensation value and the wireless network time synchronization function data to compensate the converted wireless network time synchronization function data. In this embodiment, the compensation value is obtained by performing a subtraction operation on the wireless network time synchronization function data and the wireless network time synchronization function data in the digital audio frequency domain.

[0080] In one embodiment, the play time is determined by the TX end (master device), and the play time is notified to each slave device through a WIFI packet. The processing circuit 36 ​​thereby obtains a play time data, and transmits the play time data to each circuit to play the sampled audio data.

[0081] Then, when the digital audio circuit 24 receives the notification playing time data, the direct memory access circuit 240 in the digital audio circuit 24 will move the digital audio data from the buffer 23, and then transmit the digital audio data to the digital-to-analog converter 25 to convert the digital audio data into an analog audio signal, and then play the analog audio signal. Specifically, the frequency of the digital audio clock is used as the clock of the digital audio after frequency division, and the audio data is sent to the audio codec (CODEC) through the digital audio (I2S) protocol for D / A conversion, converted into an analog audio signal and played out. In other words, the frequency of the digital audio clock 22 affects the speed of audio playback.

[0082] In this embodiment, since the frequency of the digital audio clock 22 directly affects the speed of audio playback, and the frequency of the digital audio clock 22 will feedback the dynamic correction synchronization of the compensation. In order to make the broadcasting effect better, the receiving device 20 also includes a re-sampler 26 to improve the broadcasting effect. The re-sampler 26 is electrically connected to the digital audio circuit 24 and the audio synchronization circuit 30.

[0083] The clock of the wireless network time synchronization function (Wifi Time Synchronization Function, Wifi TSF) is associated with the digital audio playback clock 22 through the audio synchronization circuit, and the digital audio clock frequency of the digital audio playback clock 22 drives the digital audio time synchronization function counter 33. The frequency deviation value of the digital audio frequency relative to the digital audio playback clock 22 and the count deviation value relative to the digital audio time synchronization function counter 33 are obtained by calculating the deviation between the digital audio time synchronization function counter 33 and the wireless network time synchronization function counter 210, so as to overcome the problem of asynchrony caused by transmission delay, so that each player can play the digital audio data synchronously.

[0084] In addition, according to the aforementioned audio synchronization circuit 30 of the present application being applied in the wireless network audio playback system, the present application further summarizes an audio synchronization method, such as Figure 5 FIG. 2 is an embodiment of the audio synchronization method. The audio synchronization method can be performed by the aforementioned audio synchronization circuit 30 to perform the following steps:

[0085] Obtaining at least one beacon packet and at least one digital audio data through a wireless network channel (S10);

[0086] Parsing the at least one beacon packet to obtain wireless network time synchronization function data (S20);

[0087] Obtaining a digital audio clock frequency of the audio synchronization circuit (S30);

[0088] According to the digital audio clock frequency, a digital audio time synchronization function data is generated (S40); wherein the wireless network time synchronization function data is not synchronized with the digital audio time synchronization function data;

[0089] Periodically generating a synchronization control signal (S50);

[0090] A numerical conversion procedure is performed on the wireless network time synchronization function data to obtain a corresponding converted wireless network time synchronization function data (S60); in this embodiment, the numerical conversion procedure mainly converts the wireless network time synchronization function data into the digital audio (Inter Interchip Sound, I2S) domain (Domain) to obtain the wireless network time synchronization function data in the digital audio frequency domain.

[0091] Calculating a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data (S70);

[0092] The digital audio clock frequency is compensated according to the frequency deviation value (S80).

[0093] In this embodiment, if Figure 6 As shown, after the aforementioned method executes the step of "calculating a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data (S70)", the method further executes the following sub-steps:

[0094] Executing a phase difference calculation procedure according to the converted wireless network time synchronization function data (WIFI_TSF) and the converted wireless network time synchronization function data (WIFI_TSF_LastSync) stored last time to obtain a wireless network time synchronization function incremental data (WIFI_TSF_Delta) (S71A);

[0095] Executing the phase difference calculation procedure according to the digital audio time synchronization function data (I2S_TSF) and the digital audio time synchronization function data (I2S_TSF_LastSync) stored last time to obtain a digital audio time synchronization function incremental data (I2S_TSF_Delta) (S72A);

[0096] The phase difference operation procedure is performed according to the wireless network time synchronization function increment data and the digital audio time synchronization function increment data to obtain the count deviation value and the frequency deviation value (S73A).

[0097] In this embodiment, the phase difference calculation procedure is described as follows:

[0098] WIFI_TSF_Delta=WIFI_TSF-WIFI_TSF_LastSync;

[0099] I2S_TSF_Delta=I2S_TSF–I2S_TSF_LastSync

[0100] When the clocks of the wireless network time synchronization function counter (WIFI TSF Timer) 210 and the digital audio time synchronization function counter (I2S TSF Timer) 33 are synchronized, WIFI_TSF_Delta = I2S_TSF_Delta. When the clocks of the wireless network time synchronization function counter (WIFI TSF Timer) 210 and the digital audio time synchronization function counter (I2S TSF Timer) 33 are not synchronized, WIFI_TSF_Delta-I2S_TSF_Delta is only related to the difference between the two clocks, so that this feature can be used to accurately obtain the difference between the two clocks, as described later.

[0101] Through these two values ​​WIFI_TSF_Delta and I2S_TSF_Delta, the count deviation value (Drift) of the count value of the wireless network time synchronization function counter (WIFI TSF Timer) 210 and the frequency deviation value (PPM) of the digital audio playback clock (I2S PLL) 22 can be calculated, wherein,

[0102] Count deviation value (Drift) = WIFI_TSF_Delta - I2S_TSF_Delta;

[0103] Frequency deviation value (PPM) = Drift / WIFI_TSF_Delta

[0104] Therefore, the clock frequency of the digital audio playback clock (I2S PLL) 22 can be calibrated by the frequency deviation value (PPM), and the digital audio data can be resampled.

[0105] In addition, the count value of the wireless network time synchronization function counter (WIFI TSF Timer) 210 may be compensated. After each compensation, the count value of the wireless network time synchronization function data (WIFI_TSF) is equal to the count value of the digital audio time synchronization function data (I2S_TSF). At the next synchronization:

[0106] Count deviation value (Drift) = WIFI_TSF - I2S_TSF;

[0107] Of course, the compensation function of the count deviation value (Drift) can be implemented according to the needs. In other words, the compensation function of the count deviation value (Drift) can be omitted.

[0108] In this embodiment, if Figure 7As shown, when the aforementioned method executes the step of "obtaining at least one beacon packet and at least one digital audio data through a wireless network channel (S10)", the method further executes the following sub-steps:

[0109] Acquire a notification play time data (S11);

[0110] The digital audio data is played according to the notified playing time data (S12).

[0111] In this embodiment, if Figure 8 As shown, when the method executes the step of "performing a numerical conversion procedure on the wireless network time synchronization function data to obtain a converted wireless network time synchronization function data (S60)", the method includes the following sub-steps:

[0112] A compensation value is obtained (S61); the compensation value includes some delays caused by the circuit processing itself and the time unit of the wireless network time synchronization function timer (Wifi TSFT) 210 is microseconds (us), and the time unit of the digital audio (Inter Interchip Sound, I2S) domain (Domain) is nanoseconds (ns) for nanosecond level compensation. The compensation value is estimated by the compensation calculation circuit 311 according to the processing speed of the entire circuit or obtained by using circuit simulation in advance. In other words, the time unit of the compensation value is nanoseconds.

[0113] An addition operation is performed according to the compensation value and the wireless network time synchronization function data to compensate the converted wireless network time synchronization function data (S62).

[0114] In this embodiment, if Fig. 9 When the method reaches the step of “obtaining a compensation value (S61)”, the method further comprises the following sub-steps:

[0115] The compensation value is estimated by the compensation calculation circuit 311 according to the processing speed of the entire circuit or obtained by using circuit simulation in advance (S610).

[0116] In this embodiment, if Fig.10 As shown, when the aforementioned method executes the step of "playing the digital audio data according to the notified playing time data (S12)", the method further comprises the following sub-steps:

[0117] Moving the digital audio data (S120);

[0118] Converting the digital audio data into an analog audio signal (S121);

[0119] The analog audio signal is played (S122).

[0120] To summarize, the audio synchronization circuit 30 and the audio synchronization method of the present application, when the audio synchronization circuit 30 receives the at least one beacon packet to generate the synchronization control signal, performs a difference comparison on the wireless network time synchronization function data and the digital audio time synchronization function data according to the synchronization control signal to obtain the frequency deviation value, and compensates the digital audio clock frequency according to the frequency deviation value. Thus, the audio synchronization circuit 30 can adjust the digital audio clock frequency according to the frequency deviation value to avoid unpredictable delays caused by software processing and wireless channel competition, thereby achieving the purpose of more accurate time synchronization.

[0121] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0122] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present application and the claims, all of which belong to the scope of protection of the present application.

Claims

1. An audio synchronization method, characterized in that: The audio synchronization method is performed by an audio synchronization circuit to perform the following steps: Obtain at least one beacon packet and at least one digital audio data through a wireless network channel; Parsing the at least one beacon packet to obtain a wireless network time synchronization function data, and performing a numerical conversion procedure on the wireless network time synchronization function data to generate a converted wireless network time synchronization function data; Obtaining a digital audio clock frequency of the audio synchronization circuit; Outputting a digital audio time synchronization function count according to the digital audio clock frequency to generate a digital audio time synchronization function data; wherein the wireless network time synchronization function data is not synchronized with the digital audio time synchronization function data; Periodically generating a synchronization control signal, and simultaneously obtaining the converted wireless network time synchronization function data and the digital audio time synchronization function data; Calculating a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data; The digital audio clock frequency is compensated according to the frequency deviation value.

2. The audio synchronization method according to claim 1, characterized in that: After the aforementioned method is executed to the step of "calculating a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data", the method comprises the following sub-steps: Execute a phase difference calculation procedure according to the converted wireless network time synchronization function data and the converted wireless network time synchronization function data stored last time to obtain wireless network time synchronization function increment data; After executing the phase difference calculation procedure according to the digital audio time synchronization function data and the digital audio time synchronization function data stored last time, a digital audio time synchronization function increment data is obtained; The phase difference operation procedure is performed according to the wireless network time synchronization function increment data and the digital audio time synchronization function increment data to obtain the counting deviation value.

3. The audio synchronization method according to claim 1, characterized in that: When the aforementioned method reaches the step of “obtaining at least one beacon packet and at least one digital audio data through a wireless network channel”, the method further performs the following sub-steps: Get-notify playback time data; The digital audio data is played according to the notified playing time data.

4. The audio synchronization method according to claim 1, characterized in that: When the method reaches the step of "performing a numerical conversion procedure on the wireless network time synchronization function data to obtain a converted wireless network time synchronization function data", the method includes the following sub-steps: obtaining a compensation value; An addition operation procedure is performed according to the compensation value and the wireless network time synchronization function data to generate the converted wireless network time synchronization function data.

5. The audio synchronization method according to claim 4, characterized in that: The time unit of the compensation value is nanoseconds.

6. The audio synchronization method according to claim 3, characterized in that: When the aforementioned method reaches the step of "playing the digital audio data according to the notified playing time data", the method further comprises the following sub-steps: Moving the digital audio data; Converting the digital audio data into an analog audio signal; The analog audio signal is played.

7. An audio synchronization circuit, characterized in that: The audio synchronization circuit comprises: a synchronous control circuit which periodically outputs a synchronous control signal; a wireless network time synchronization function conversion circuit, receiving a wireless network time synchronization function data from at least one beacon packet, and performing a numerical conversion procedure on the wireless network time synchronization function data to generate a converted wireless network time synchronization function data; a digital audio time synchronization function counter receiving a digital audio clock frequency to output a digital audio time synchronization function count; a digital audio time synchronization function circuit, which receives the digital audio time synchronization function count and generates a digital audio time synchronization function data; wherein the wireless network time synchronization function data is not synchronized with the digital audio time synchronization function data; a processing circuit connected to the wireless network time synchronization function conversion circuit and the digital audio time synchronization function circuit, and receiving the synchronization control signal to simultaneously obtain the converted wireless network time synchronization function data and the digital audio time synchronization function data; wherein the processing circuit calculates a count deviation value and a frequency deviation value according to the converted wireless network time synchronization function data and the digital audio time synchronization function data; Wherein, the digital audio clock frequency is compensated according to the frequency deviation value.

8. The audio synchronization circuit as claimed in claim 7, characterized in that: The wireless network time synchronization function conversion circuit includes: A wireless network time synchronization function circuit; a compensation calculation circuit connected to the wireless network time synchronization function circuit and outputting a compensation value; The compensation calculation circuit transmits the compensation value to the wireless network time synchronization function circuit to perform an addition operation procedure on the compensation value and the wireless network time synchronization function data to generate the converted wireless network time synchronization function data.

9. The audio synchronization circuit according to claim 7, characterized in that: The synchronous control circuit further comprises: a timer, which performs a counting procedure according to the at least one beacon packet to generate a beacon count value; The synchronization control circuit compares the beacon count value according to a count threshold value to output the synchronization control signal.

10. The audio synchronization circuit according to claim 7, characterized in that: The processing circuit obtains a notifying playing time data, and plays a digital audio data according to the notifying playing time data.

Citation Information

Patent Citations

  • IEEE 1588-based synchronization system and synchronization method thereof

    CN102104475A