CN112887773A - Synchronization method and device of audio equipment - Google Patents

Synchronization method and device of audio equipment Download PDF

Info

Publication number
CN112887773A
CN112887773A CN202110092878.2A CN202110092878A CN112887773A CN 112887773 A CN112887773 A CN 112887773A CN 202110092878 A CN202110092878 A CN 202110092878A CN 112887773 A CN112887773 A CN 112887773A
Authority
CN
China
Prior art keywords
audio
read
clock
audio device
synchronization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110092878.2A
Other languages
Chinese (zh)
Inventor
陈世柱
李振
陈博文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
KT MICRO Inc
Original Assignee
KT MICRO Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by KT MICRO Inc filed Critical KT MICRO Inc
Priority to CN202110092878.2A priority Critical patent/CN112887773A/en
Publication of CN112887773A publication Critical patent/CN112887773A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The embodiment of the application provides a synchronization method and a synchronization device of audio equipment, which relate to the technical field of audio, and the synchronization method of the audio equipment comprises the following steps: firstly, acquiring the read-write pointer state of a data cache unit in audio equipment, and calculating the read-write pointer difference according to the read-write pointer state; and finally, the audio equipment is synchronously processed according to the synchronous control scheme, so that the problem that the audio equipment is not synchronous with an external sound source can be solved, and the application effect of the audio equipment is improved.

Description

Synchronization method and device of audio equipment
Technical Field
The present application relates to the field of audio technologies, and in particular, to a synchronization method and apparatus for an audio device.
Background
With the development and progress of society, more and more audio equipment appears in front of people, and people are given a hearing feast again and again. However, in practice, it is found that the current audio devices usually have the problem that the audio devices are not synchronized with the external sound source, thereby reducing the application effect of the audio devices.
Disclosure of Invention
An object of the embodiments of the present application is to provide a synchronization method and apparatus for audio equipment, which can solve the problem that the audio equipment is not synchronized with an external sound source, thereby improving the application effect of the audio equipment.
A first aspect of an embodiment of the present application provides a synchronization method for an audio device, including:
acquiring the read-write pointer state of a data cache unit in the audio equipment;
calculating the difference of the read-write pointer according to the state of the read-write pointer;
determining a synchronous control scheme according to the read-write pointer difference;
and carrying out synchronous processing on the audio equipment according to the synchronous control scheme.
In the implementation process, the read-write pointer state of a data cache unit in the audio equipment is obtained first, and the read-write pointer difference is calculated according to the read-write pointer state; and finally, the audio equipment is synchronously processed according to the synchronous control scheme, so that the problem that the audio equipment is not synchronous with an external sound source can be solved, and the application effect of the audio equipment is improved.
Further, before the obtaining of the read-write pointer state of the data cache unit in the audio device, the method further includes:
carrying out initialization calibration processing on the local clock of the audio equipment to obtain a local clock calibration value;
and carrying out coarse adjustment on the local clock according to a preset coarse adjustment clock frequency control word to obtain a coarse adjustment local clock.
In the implementation process, before the audio equipment is synchronized, the audio equipment needs to be initialized and calibrated, and the local clock needs to be coarsely adjusted, so that the synchronization process of the audio equipment is accelerated.
Further, the initializing and calibrating the local clock of the audio device to obtain a local clock calibration value includes:
acquiring a target frequency clock and a local clock of the audio equipment;
and carrying out initialization calibration on the local clock and the target frequency clock to obtain a local clock calibration value.
In the implementation process, when the audio device is initialized and calibrated, the target frequency clock and the local clock of the audio device are obtained first, and then the local clock and the target frequency clock are initialized and calibrated to make the frequencies of the two clocks consistent, thereby completing the initialization and calibration process.
Further, the determining a synchronization control scheme according to the read-write pointer difference includes:
calculating a comparison difference value according to a preset high-low threshold value and the reading and writing pointer difference;
and adjusting preset fine adjustment frequency control information according to the comparison difference value to obtain a synchronous control scheme.
In the implementation process, the self-adaptive synchronization of the audio frequency is actually realized by adjusting the local clock frequency of the audio equipment according to the difference of the read-write pointer, so that the local audio data sampling rate and the audio data sampling rate of the external sound source equipment reach dynamic balance matching, and further the audio frequency synchronization is realized.
Further, the synchronization control scheme performs synchronization processing on the audio device, and includes:
adjusting a clock oscillation frequency according to the synchronization control scheme to synchronize a frequency of a sampling clock local to the audio device with a data sampling frequency external to the audio device.
In the implementation process, the synchronization control scheme is to fine-tune the clock control word, adjust the fine-tune clock control word according to the read-write pointer difference, and further adjust the local clock frequency of the audio device, so that the local audio data sampling rate and the audio data sampling rate of the external sound source device reach dynamic balance matching, and further implement audio synchronization.
A second aspect of the embodiments of the present application provides a synchronization apparatus for an audio device, where the synchronization apparatus for an audio device includes:
the acquisition unit is used for acquiring the read-write pointer state of a data cache unit in the audio equipment;
the calculation unit is used for calculating the difference of the read-write pointer according to the state of the read-write pointer;
the scheme determining unit is used for determining a synchronous control scheme according to the read-write pointer difference;
and the synchronization unit is used for carrying out synchronization processing on the audio equipment according to the synchronization control scheme.
In the implementation process, the obtaining unit obtains the read-write pointer state of the data cache unit in the audio device, and the calculating unit calculates the read-write pointer difference according to the read-write pointer state; the scheme determining unit determines a synchronous control scheme according to the read-write pointer difference, and finally the synchronizing unit performs synchronous processing on the audio equipment according to the synchronous control scheme, so that the problem that the audio equipment is not synchronous with an external sound source can be solved, and the application effect of the audio equipment is improved.
Further, the synchronization apparatus of the audio device further includes:
the initialization calibration unit is used for performing initialization calibration processing on the local clock of the audio equipment before the read-write pointer state of the data cache unit in the audio equipment is acquired, so as to obtain a local clock calibration value;
and the coarse tuning unit is used for performing coarse tuning on the local clock according to a preset coarse tuning clock frequency control word to obtain a coarse tuning local clock.
In the implementation process, before the audio equipment is synchronized, the audio equipment needs to be initialized and calibrated, and the local clock needs to be coarsely adjusted, so that the synchronization process of the audio equipment is accelerated.
Further, the initializing calibration unit includes:
an acquisition subunit, configured to acquire a target frequency clock and a local clock of the audio device;
and the calibration subunit is used for carrying out initialization calibration on the local clock and the target frequency clock to obtain a local clock calibration value.
In the implementation process, when the audio device is initialized and calibrated, the acquiring subunit acquires the target frequency clock and the local clock of the audio device, and then the calibrating subunit performs initialization and calibration on the local clock and the target frequency clock to make the frequencies of the two clocks consistent, thereby completing the initialization and calibration process.
A third aspect of embodiments of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the synchronization method for an audio device according to any one of the first aspect of embodiments of the present application.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the synchronization method for an audio device according to any one of the first aspect of the embodiments of the present application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart illustrating a synchronization method of an audio device according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a synchronization method of an audio device according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a synchronization apparatus of an audio device according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of a synchronization apparatus of an audio device according to a fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of an audio device of an audio system according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a DCO regulation control unit according to a second embodiment of the present application.
Icon: 401-analog-to-digital converter, 402-output buffer unit, 403-analog DCO module, 404-digital-to-analog converter, 405-input buffer unit, 406-audio input unit, 407-audio output unit, 408-DCO adjustment control unit, 409-data uplink unit, 410-data downlink unit, 501-first internal data bus, 502-analog-to-digital converter clock, 503-frequency control word, 504-digital-to-analog converter clock, 505-second internal data bus, 506-uplink data bus, 507-downlink data bus, 600-external sound source device, 701-calibration parameter storage unit, 702-DCO frequency coarse adjustment calibration unit, 703-DCO frequency control word, 704-DCO frequency fine tuning unit, 705-on-chip clock control unit, 801-input reference clock, 802-internal bus, 803-coarse frequency control word, 804-local clock, 805-high frequency clock.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
Referring to fig. 1, fig. 1 is a flowchart illustrating a synchronization method of an audio device according to an embodiment of the present disclosure. The method is applied to the synchronous scene of the audio equipment and the external sound source equipment. The synchronization method of the audio equipment comprises the following steps:
s101, obtaining the read-write pointer state of a data cache unit in the audio equipment.
In the embodiment of the application, the main execution body of the method is audio equipment, and the audio equipment can be connected with external sound source equipment and receives audio data input by the sound source equipment.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an audio device of an audio system according to an embodiment of the present disclosure. As shown in fig. 5, the audio system audio device includes an analog-to-digital converter 401, an output buffer unit 402, an analog DCO module 403, a digital-to-analog converter 404, an input buffer unit 405, an audio input unit 406, an audio output unit 407, a DCO adjustment control unit 408, a data upstream unit 409, and a data downstream unit 410.
As shown in fig. 5, the analog-to-digital converter 401 is used for collecting an input analog audio signal and converting the analog audio signal into a digital signal.
An output buffer unit 402 for storing the digital signal converted by the analog-to-digital converter 401, typically a circular memory unit, sends the data requested to be read out to a data upstream unit 409 via a first internal data bus 501.
The analog DCO module 403, i.e. the digitally controlled on-chip oscillator, is used to generate a digital-to-analog converter clock 504 and an analog-to-digital converter clock 502, and the clock output frequency of the module is controlled by the DCO adjustment control unit 408 to continuously align and compensate the frequency difference between the local clock and the external audio source clock, thereby implementing the synchronous processing of the audio device of the audio system.
The digital-to-analog converter 404 is configured to convert the digital signal stored in the output buffer unit 402 into an analog signal, and transmit the analog signal to the audio output unit 407 for external playing.
The input buffer unit 405 is used for storing the data sent by the data downlink unit 410, and is also generally a circular storage unit.
The audio input unit 406 may be various audio capturing devices, such as a microphone, and the like.
The audio output unit 407 is typically an audio playing module, such as a playing box or a headphone.
The DCO adjustment control unit 408 is configured to adjust the analog DCO module 403 through an algorithm by monitoring the read-write pointer difference of the buffer units (including the output buffer unit 402 and the input buffer unit 405), so as to achieve the purpose of frequency synchronization.
A data uplink unit 409, configured to transmit the data in the output buffer unit 402 to the external sound source device 600 through the uplink data bus 506.
The data downlink unit 410 is responsible for receiving the data of the external audio source device 600 from the downlink data bus 507 and sending the data to the internal input buffer unit 405 for storage through the second internal data bus 505.
And S102, calculating the difference of the read-write pointer according to the state of the read-write pointer.
As shown in fig. 5, when the audio system audio device collects audio data, the audio input unit 406 inputs an analog audio signal into the analog-to-digital converter 401 inside the audio system audio device, and the analog-to-digital converter 401 converts the analog audio signal into a digital signal first, and then stores the converted digital signal into the internal input buffer unit 405 at a local sampling clock rate in time, which affects the write pointer of the input buffer unit 405, and at the same time, the external audio source device 600 requests to read the digital signal stored in the input buffer unit 405 through the interface unit, so that the data uplink unit 409 pulls the stored digital signal from the input buffer unit 405 according to the clock of the external audio source device, which affects the read pointer of the input buffer unit, if the frequency of the local sampling clock of the audio device (set as the local clock frequency) is equal to the frequency of the external audio device (i.e. the external audio source device) If the sampling frequency (set as the frequency of the audio source clock) of the data is different, the difference between the read pointer and the write pointer of the input buffer unit 405 will change continuously, and if the local clock is higher than the audio source clock, and if the local clock and the audio source clock are not synchronized continuously, the write pointer will catch up with the read pointer finally, so that the unread data is covered; conversely, if the local clock frequency is lower than the clock frequency of the sound source device, and if the local clock frequency and the sound source device are continuously asynchronous, the read pointer can catch up with the write pointer finally, so that the sound-off condition of the device playing sound occurs, and therefore, the read-write pointer state of the input buffer unit 405 needs to be acquired at this time, wherein the read-write pointer state of the input buffer unit 405 includes the read pointer state and the write pointer state, further, the read-write pointer difference can be calculated according to the read pointer state and the write pointer state, and finally, the audio device is synchronized according to the read-write pointer difference.
And S103, determining a synchronous control scheme according to the read-write pointer difference.
In the embodiment of the application, the difference between the read pointer and the write pointer can be calculated according to the state of the read pointer and the write pointer, and then the synchronization control scheme is determined according to the preset threshold value of the difference between the read pointer and the write pointer, wherein the preset threshold value of the difference between the read pointer and the write pointer comprises an upper threshold value and a lower threshold value of the difference between the read pointer and the write pointer. If the difference of the read-write pointers exceeds the upper threshold, the read speed is lower than the write speed, and the local clock frequency needs to be adjusted to be low at this time.
And S104, carrying out synchronous processing on the audio equipment according to the synchronous control scheme.
In this embodiment, by implementing the synchronization method for audio devices described in this embodiment, it is not necessary to provide a common clock for the audio device and the external audio source device, and it is also not necessary to establish a special protocol to adjust the code stream rate (i.e., the code stream rate of the input audio data), and it is only necessary for the audio device to continuously adjust the local oscillator frequency according to the size of the dynamic buffer area for receiving and sending the code stream to adapt to the code stream rate of the audio source device or the target audio device.
In the embodiment of the present application, the audio device is synchronized, which needs to be completed through the DCO adjustment control unit 408, and the fine-tuning clock control word of the analog DCO module 403 can be adjusted according to the difference between the read pointer and the write pointer, so that the local clock is adjusted, the local analog-to-digital data conversion rate and the local data storage rate are changed, and the rate is dynamically balanced and matched with the audio source device.
As another optional trial mode, when the audio device is used as a receiving device to receive audio data from the external sound source device 600, the external sound source device 600 sends the audio data to the data downlink unit 410 of the audio device, and the data downlink unit 410 pushes the received data to the output buffer unit 402, reads out the audio data in the input buffer unit 405 through the digital-to-analog converter 404, performs digital-to-analog conversion, and finally performs audio output or external playing through the audio output unit 407. Similarly, when data is pushed to the output buffer unit 402 through the data downlink unit 410, the write pointer of the output buffer unit 402 is adjusted, and at the same time, when the data is read out from the input buffer unit 405 by the digital-to-analog converter 404, the read pointer of the input buffer unit 405 is adjusted, and if there is a difference between the read speed and the write speed, the read pointer and the write pointer are continuously changed, so that the read pointer catches up with the write pointer, the audio terminal is caused, or the write pointer catches up with the read pointer, and the audio coverage is lost. Therefore, the above-described method still needs to be adopted, the read-write pointer difference (i.e. the second pointer difference value between the read pointer of the input buffer unit 405 and the write pointer of the output buffer unit 402) is transmitted to the DCO adjustment control unit 408, and the DCO adjustment control unit 408 can adjust the fine-tuning clock control word according to the second pointer difference value, so as to adjust the local clock frequency, so that the local audio data sampling rate and the audio data sampling rate of the external sound source device reach dynamic balance matching, thereby implementing audio synchronization.
In the above embodiment, the read-write pointer state includes the read-write pointer state of the input buffer unit 405 and the write-write pointer state of the output buffer unit 402, and further, the read-write pointer difference may be calculated according to the read-write pointer state and the write-write pointer state, and finally, the audio device may be synchronized according to the read-write pointer difference.
In the embodiment of the present application, the synchronization method for audio equipment described in this embodiment is a self-adaptive synchronization method, which not only simplifies external hardware, but also ensures audio quality, and better adapts to different external sound source devices.
Therefore, the synchronization method of the audio device described in this embodiment can solve the problem that the audio device is not synchronized with an external sound source, thereby improving the application effect of the audio device.
Example 2
Referring to fig. 2, fig. 2 is a flowchart illustrating a synchronization method of an audio device according to an embodiment of the present application. As shown in fig. 2, wherein the synchronization method of the audio device includes:
s201, acquiring a target frequency clock and a local clock of the audio equipment.
In this embodiment, the target frequency clock is an off-chip accurate clock source, and the target frequency is the accurate clock frequency to be calibrated.
S202, performing initialization calibration on the local clock and the target frequency clock to obtain a local clock calibration value.
In this embodiment, the local clock calibration value is an initial coarse clock frequency control word. The coarse frequency control word of the local clock is an initial clock calibration value obtained when the local clock and the off-chip accurate clock source are continuously calibrated by the calibration logic so that the local clock and the off-chip accurate clock source are basically consistent (or have an error within a certain range).
In the embodiment of the present application, by implementing the steps S201 to S202, the present clock of the audio device can be initialized and calibrated, so as to obtain the coarse calibration value of the local clock.
And S203, carrying out coarse adjustment on the local clock according to the preset coarse adjustment clock frequency control word to obtain a coarse adjustment local clock.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a DCO regulation control unit 408 according to an embodiment of the present disclosure. As shown in fig. 6, the DCO adjustment control unit 408 includes a calibration parameter storage unit 701, a DCO frequency coarse adjustment calibration unit 702, a DCO frequency control word 703, and a DCO frequency fine adjustment unit 704. In addition, the whole adjusting loop also includes the analog DCO module 403 and the on-chip clock control unit 705 in fig. 5, and the output buffer unit 402 and the input buffer unit 405 provide the read/write pointer position information as the basis for adjusting the clock frequency control word.
In practical application, in order to make the audio device track the sampling clock of the external audio source device more quickly and achieve dynamic balance with the sampling clock of the external audio source device when the system is running, calibration operation (i.e. calibration operation at the time of chip factory) needs to be performed in the audio device in advance, this operation is performed by the DCO frequency coarse tuning calibration unit 702, this operation is generally performed in a special test mode, when the device is switched to the test mode, the reference clock 801 is input from the outside to the internal DCO frequency coarse tuning calibration unit 702, another clock input is provided by the on-chip clock control unit 705, the on-chip clock control unit 705 divides the frequency of the high-frequency clock 805 output by the analog DCO module 403 to obtain a local clock 804 close to the input reference clock 801, at this time, the coarse tuning unit adjusts the coarse tuning frequency control word 803 according to the coarse tuning flow of the analog DCO module 403, therefore, the DCO frequency control word 703 is changed, then the DCO frequency control word 703 transmits all the relevant frequency control words 503 to the analog DCO module 403, the analog DCO module 403 adjusts the output high-frequency clock 805 according to the frequency control word 503, then completes the adjustment of the local clock 804 through the clock feedback path, finally makes the frequency of the local clock 804 consistent with the frequency of the input reference clock 801 (i.e. the target frequency clock), thereby completing the calibration process, and then records the final coarse tuning calibration value (i.e. the preset coarse tuning clock frequency control word) into the on-chip nonvolatile memory module, here, the calibration parameter memory unit 701, thereby completing the whole coarse tuning calibration process.
In the embodiment of the present application, when the audio device is in a normal application process, the calibration result of the previous coarse tuning is directly taken out from the calibration parameter storage unit 701 after power-on, and then stored in the coarse tuning register of the DCO frequency control word 703. Although the preset coarse clock frequency control word is loaded, a certain difference still exists between the local sampling clock and the sampling clock of the external sound source equipment, and in the data transmission process, the step S204 to the step S208 are implemented, and the fine frequency control word is adjusted through the synchronous system.
In the embodiment of the present application, the coarse tuning control word (i.e. the preset coarse tuning clock frequency control word) is loaded after the audio device is powered on, so that the synchronization process of the audio device can be accelerated.
After step S203, the following steps are also included:
s204, obtaining the read-write pointer state of a data cache unit in the audio equipment.
And S205, calculating the read-write pointer difference according to the read-write pointer state.
After step S205, the following steps are also included:
and S206, calculating and comparing a difference value according to a preset high-low threshold value and a read-write pointer difference.
And S207, adjusting the preset fine adjustment frequency control information according to the comparison difference value to obtain a synchronous control scheme.
In the embodiment of the application, the difference between the read pointer and the write pointer can be calculated according to the state of the read pointer and the write pointer, then a comparison difference value is determined according to a preset read pointer difference threshold value, and then a synchronization control scheme is determined according to the comparison difference value, wherein the preset read pointer difference threshold value comprises an upper threshold value and a lower threshold value of the read pointer difference. If the difference of the read-write pointers exceeds the upper threshold, the read speed is lower than the write speed, and the local clock frequency needs to be adjusted to be low at this time.
In the embodiment of the present application, by implementing the above step S206 to step S207, the synchronization control scheme can be determined according to the read/write pointer difference.
After step S207, the following steps are also included:
and S208, adjusting the clock oscillation frequency according to the synchronous control scheme to synchronize the frequency of the local sampling clock of the audio equipment with the data sampling frequency outside the audio equipment.
In the embodiment of the present application, the step S208 is implemented, so that the audio device can be synchronized according to the synchronization control scheme.
In the embodiment of the application, after the audio equipment is powered on, the audio equipment enters the normal working state, at this time, the audio device starts data communication with the external sound source device, data output from the audio device is continuously written into the output buffer unit 402, while the data inputted from the audio device will be continuously written into the input buffer unit 405, in order to ensure that the frequency of the local sampling clock of the audio device and the data sampling frequency of the external (i.e. external audio device) of the audio device reach dynamic balance, the DCO frequency fine tuning unit 704 will read the read-write pointer status from the output buffer unit 402 and the input buffer unit 405 at regular time, and compare the read-write pointer difference with the set upper and lower thresholds, and then gradually adjusting the fine adjustment control word of the frequency step by step, so that the frequency of a local sampling clock of the audio equipment and the data sampling frequency outside the audio equipment (namely outside sound source equipment) reach dynamic balance.
In the embodiment of the application, the problem of synchronization between the audio equipment and the sound source equipment is solved by adopting lower hardware cost, the cost and the expense of the whole system are reduced, the complexity of system synchronization is reduced, special protocols and interfaces do not need to be customized, and the audio system has wide adaptability.
Therefore, the synchronization method of the audio device described in this embodiment can solve the problem that the audio device is not synchronized with an external sound source, thereby improving the application effect of the audio device.
Example 3
Referring to fig. 3, fig. 3 is a schematic structural diagram of a synchronization apparatus of an audio device according to an embodiment of the present application. As shown in fig. 3, the synchronization apparatus of the audio device includes:
the obtaining unit 310 is configured to obtain a read-write pointer status of a data caching unit in the audio device.
A calculating unit 320 for calculating the read-write pointer difference according to the read-write pointer status.
And a scheme determining unit 330, configured to determine a synchronization control scheme according to the read-write pointer difference.
A synchronization unit 340, configured to perform synchronization processing on the audio device according to a synchronization control scheme.
In the embodiment of the present application, for the explanation of the synchronization apparatus of the audio device, reference may be made to the description in embodiment 1 or embodiment 2, and details are not repeated in this embodiment.
Therefore, the synchronization device for the audio device described in this embodiment can solve the problem that the audio device is not synchronized with an external sound source, thereby improving the application effect of the audio device.
Example 4
Referring to fig. 4, fig. 4 is a schematic structural diagram of a synchronization apparatus of an audio device according to an embodiment of the present disclosure. The synchronization apparatus of the audio device shown in fig. 4 is optimized by the synchronization apparatus of the audio device shown in fig. 3. As shown in fig. 4, the synchronization apparatus of the audio device further includes:
the initialization calibration unit 350 is configured to perform initialization calibration processing on the local clock of the audio device before obtaining the read-write pointer state of the data cache unit in the audio device, so as to obtain a local clock calibration value.
And a coarse tuning unit 360, configured to perform coarse tuning on the local clock according to a preset coarse tuning clock frequency control word, so as to obtain a coarse tuning local clock.
As an alternative embodiment, initializing the calibration unit 350 includes:
the acquiring subunit 351 is configured to acquire the target frequency clock and the local clock of the audio device.
The calibration subunit 352 is configured to perform initial calibration on the local clock and the target frequency clock to obtain a local clock calibration value.
As an alternative embodiment, the scheme determining unit 330 includes:
and the calculating subunit 331 is configured to calculate a comparison difference value according to a preset high-low threshold and a read-write pointer difference.
And an adjusting subunit 332, configured to adjust the preset fine tuning frequency control information according to the comparison difference, so as to obtain a synchronization control scheme.
As an alternative embodiment, the synchronization unit 340 is specifically configured to adjust the clock oscillation frequency according to a synchronization control scheme to synchronize the frequency of the sampling clock local to the audio device with the data sampling frequency external to the audio device.
In the embodiment of the present application, for the explanation of the synchronization apparatus of the audio device, reference may be made to the description in embodiment 1 or embodiment 2, and details are not repeated in this embodiment.
Therefore, the synchronization device for the audio device described in this embodiment can solve the problem that the audio device is not synchronized with an external sound source, thereby improving the application effect of the audio device.
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a synchronization method of an audio device in embodiment 1 or embodiment 2 of the present application.
An embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the computer program instructions perform a synchronization method of an audio device in any one of embodiment 1 or embodiment 2 of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method of synchronization of an audio device, comprising:
acquiring the read-write pointer state of a data cache unit in the audio equipment;
calculating the difference of the read-write pointer according to the state of the read-write pointer;
determining a synchronous control scheme according to the read-write pointer difference;
and carrying out synchronous processing on the audio equipment according to the synchronous control scheme.
2. The audio device synchronization method according to claim 1, wherein before said obtaining the read/write pointer status of the data buffer unit in the audio device, the method further comprises:
carrying out initialization calibration processing on the local clock of the audio equipment to obtain a local clock calibration value;
and carrying out coarse adjustment on the local clock according to a preset coarse adjustment clock frequency control word to obtain a coarse adjustment local clock.
3. The audio device synchronization method according to claim 2, wherein the performing initialization calibration processing on the local clock of the audio device to obtain a local clock calibration value includes:
acquiring a target frequency clock and a local clock of the audio equipment;
and carrying out initialization calibration on the local clock and the target frequency clock to obtain a local clock calibration value.
4. The method for synchronizing audio equipment according to claim 1, wherein said determining a synchronization control scheme according to said read-write pointer difference comprises:
calculating a comparison difference value according to a preset high-low threshold value and the reading and writing pointer difference;
and adjusting preset fine adjustment frequency control information according to the comparison difference value to obtain a synchronous control scheme.
5. The audio device synchronization method according to claim 1, wherein the performing synchronization processing on the audio device according to the synchronization control scheme comprises:
adjusting a clock oscillation frequency according to the synchronization control scheme to synchronize a frequency of a sampling clock local to the audio device with a data sampling frequency external to the audio device.
6. A synchronization apparatus of an audio device, the synchronization apparatus of the audio device comprising:
the acquisition unit is used for acquiring the read-write pointer state of a data cache unit in the audio equipment;
the calculation unit is used for calculating the difference of the read-write pointer according to the state of the read-write pointer;
the scheme determining unit is used for determining a synchronous control scheme according to the read-write pointer difference;
and the synchronization unit is used for carrying out synchronization processing on the audio equipment according to the synchronization control scheme.
7. The audio device synchronization apparatus according to claim 6, wherein the audio device synchronization apparatus further comprises:
the initialization calibration unit is used for performing initialization calibration processing on the local clock of the audio equipment before the read-write pointer state of the data cache unit in the audio equipment is acquired, so as to obtain a local clock calibration value;
and the coarse tuning unit is used for performing coarse tuning on the local clock according to a preset coarse tuning clock frequency control word to obtain a coarse tuning local clock.
8. The synchronization apparatus of an audio device according to claim 7, wherein the initialization calibration unit comprises:
an acquisition subunit, configured to acquire a target frequency clock and a local clock of the audio device;
and the calibration subunit is used for carrying out initialization calibration on the local clock and the target frequency clock to obtain a local clock calibration value.
9. An electronic device, characterized in that the electronic device comprises a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the synchronization method of the audio device of any of claims 1 to 5.
10. A readable storage medium, in which computer program instructions are stored, which, when read and executed by a processor, perform the synchronization method of an audio device according to any one of claims 1 to 5.
CN202110092878.2A 2021-01-22 2021-01-22 Synchronization method and device of audio equipment Pending CN112887773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110092878.2A CN112887773A (en) 2021-01-22 2021-01-22 Synchronization method and device of audio equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110092878.2A CN112887773A (en) 2021-01-22 2021-01-22 Synchronization method and device of audio equipment

Publications (1)

Publication Number Publication Date
CN112887773A true CN112887773A (en) 2021-06-01

Family

ID=76050690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110092878.2A Pending CN112887773A (en) 2021-01-22 2021-01-22 Synchronization method and device of audio equipment

Country Status (1)

Country Link
CN (1) CN112887773A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923497A (en) * 2021-10-08 2022-01-11 上海物骐微电子有限公司 Audio synchronization adjusting method and audio equipment
CN115426066A (en) * 2022-08-29 2022-12-02 苏州联芸科技有限公司 Data synchronization circuit, multiport Ethernet transceiver and data synchronization method
CN115904697A (en) * 2022-09-30 2023-04-04 深圳市拔超科技股份有限公司 EARC control method and device based on FPGA

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105429724A (en) * 2015-10-20 2016-03-23 北京小鸟听听科技有限公司 Clock correction method, clock correcting device, and sound box
CN105611222A (en) * 2015-12-25 2016-05-25 北京紫荆视通科技有限公司 Voice data processing method, device and system and controlled device
CN108089834A (en) * 2017-11-07 2018-05-29 潍坊歌尔电子有限公司 A kind of broadcasting synchronous method, device and USB sound cards
CN108964748A (en) * 2018-08-21 2018-12-07 中国科学院空间应用工程与技术中心 A kind of clock recovery method under maximum Doppler frequency shift
CN109565466A (en) * 2017-03-23 2019-04-02 华为技术有限公司 More equipment room labial synchronization method and apparatus
CN110166894A (en) * 2018-02-11 2019-08-23 北京小鸟听听科技有限公司 A kind of data processing method, output equipment and computer storage medium
US20200059504A1 (en) * 2018-08-19 2020-02-20 Pixart Imaging Inc. Schemes capable of synchronizing native clocks and audio codec clocks of audio playing for bluetooth wireless devices

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105429724A (en) * 2015-10-20 2016-03-23 北京小鸟听听科技有限公司 Clock correction method, clock correcting device, and sound box
CN105611222A (en) * 2015-12-25 2016-05-25 北京紫荆视通科技有限公司 Voice data processing method, device and system and controlled device
CN109565466A (en) * 2017-03-23 2019-04-02 华为技术有限公司 More equipment room labial synchronization method and apparatus
CN108089834A (en) * 2017-11-07 2018-05-29 潍坊歌尔电子有限公司 A kind of broadcasting synchronous method, device and USB sound cards
CN110166894A (en) * 2018-02-11 2019-08-23 北京小鸟听听科技有限公司 A kind of data processing method, output equipment and computer storage medium
US20200059504A1 (en) * 2018-08-19 2020-02-20 Pixart Imaging Inc. Schemes capable of synchronizing native clocks and audio codec clocks of audio playing for bluetooth wireless devices
CN108964748A (en) * 2018-08-21 2018-12-07 中国科学院空间应用工程与技术中心 A kind of clock recovery method under maximum Doppler frequency shift

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923497A (en) * 2021-10-08 2022-01-11 上海物骐微电子有限公司 Audio synchronization adjusting method and audio equipment
CN115426066A (en) * 2022-08-29 2022-12-02 苏州联芸科技有限公司 Data synchronization circuit, multiport Ethernet transceiver and data synchronization method
CN115426066B (en) * 2022-08-29 2024-03-29 苏州联芸科技有限公司 Data synchronization circuit, multiport Ethernet transceiver and data synchronization method
CN115904697A (en) * 2022-09-30 2023-04-04 深圳市拔超科技股份有限公司 EARC control method and device based on FPGA

Similar Documents

Publication Publication Date Title
CN112887773A (en) Synchronization method and device of audio equipment
EP3780656A1 (en) Systems and methods for providing personalized audio replay on a plurality of consumer devices
JP4251094B2 (en) Asynchronous signal input device and sampling frequency converter
US9054821B2 (en) Apparatus and method for frequency locking
US8259891B2 (en) Adaptable phase lock loop transfer function for digital video interface
CN108010476B (en) Video signal transmission clock generating device and method
US20170373824A1 (en) Distributed phase locked loop in hearing instruments
CN110888619B (en) Digital audio power amplifier synchronization circuit and method and electronic equipment
AU2004325701A1 (en) Hearing aid with feedback model gain estimation
US8793128B2 (en) Speech signal processing system, speech signal processing method and speech signal processing method program using noise environment and volume of an input speech signal at a time point
US7310056B2 (en) Method and system for adjustable sample rate conversion
EP4016847A2 (en) Phase-locked loop with dual input reference and dynamic bandwidth control
US9608640B1 (en) Receiving circuit and method for controlling frequency
CN109918038B (en) Audio playing speed synchronization method and system
US20170330599A1 (en) Method for synchronously accessing audio data and audio playback system using the same
US7443213B2 (en) Staged locking of two phase locked loops
CN113689871A (en) Echo cancellation method and device
US11916526B2 (en) Methods and systems for equalisation
US8127170B2 (en) Method and apparatus for audio receiver clock synchronization
JP6929995B1 (en) Data transfer circuit and communication equipment
JP2000250577A (en) Voice recognition device and learning method and learning device to be used in the same device and recording medium on which the same method is programmed and recorded
US20060017600A1 (en) Image signal processing system
CN114339345A (en) Source end synchronization device and synchronization method applied to audio and video signals
CN106911994B (en) Hearing device
US20240013818A1 (en) Semiconductor device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination