Search

CN-121996461-A - Method, device, equipment and medium for measuring audio playing time delay in segments

CN121996461ACN 121996461 ACN121996461 ACN 121996461ACN-121996461-A

Abstract

The invention discloses a segmentation measurement method, device, equipment and medium for audio playing time delay, the method comprises the steps of calculating time consumption from when an audio playing application is started to when an audio data writing interface is called to obtain first processing time delay information, calculating time consumption from when an audio framework is started to when the audio framework sends audio data to an audio hardware abstraction layer to obtain second processing time delay information, calculating time consumption from when audio data is received to when the audio data is written into a memory access area by an audio driver to obtain third processing time delay information, and calculating time consumption from when the audio processing module finishes processing the audio data in the memory access area to obtain fourth processing time delay information. The invention can determine the time delay of each link, accurately position the root cause of the delay problem in the audio data, and is convenient for the targeted optimization of the part with larger time delay, thereby effectively reducing the total time delay to the required range and realizing the accurate optimization of the audio data.

Inventors

  • ZHAO XIN

Assignees

  • 北斗智联科技有限公司

Dates

Publication Date
20260508
Application Date
20260123

Claims (10)

  1. 1. The method for measuring the audio playing time delay in a segmentation way is characterized in that the method for measuring the audio playing time delay in a segmentation way is applied to a control module of a player, the control module is in signal transmission connection with a test terminal, and the method for measuring the audio playing time delay in a segmentation way comprises the following steps: Receiving an audio playing instruction sent by a user side, and calculating time consumption from when an audio playing application is started to when a write audio data interface is called so as to obtain first processing time delay information; Calculating the time consumption from when the audio framework is started to when the audio framework transmits audio data to the audio hardware abstraction layer so as to obtain second processing time delay information; Writing the audio data into an audio driver from the audio hardware abstraction layer for processing, and calculating the time consumption of the audio driver from the time of receiving the audio data to the time of writing the audio data into a memory access area so as to obtain third processing time delay information; Calculating time consumption of the data processing module for completing processing of the audio data in the memory access area so as to obtain fourth processing time delay information; and uploading the first processing time delay information, the second processing time delay information, the third processing time delay information and the fourth processing time delay information to the test terminal.
  2. 2. The method for measuring audio playback delay according to claim 1, wherein receiving the audio playback instruction sent by the user terminal and calculating the time consumption from when the audio playback application is started to when the write audio data interface is invoked to obtain the first processing delay information comprises: acquiring a first timestamp when an audio playing instruction is sent by the user side; Acquiring a second time stamp from when the audio playing application is started to when the audio data writing interface is called; And calculating a difference value between the second timestamp and the first timestamp to obtain the first processing delay information.
  3. 3. The method of claim 1, wherein calculating the time taken for the audio framework to send the audio data to the audio hardware abstraction layer at the start-up time to obtain the second processing delay information comprises: Acquiring a third timestamp of the audio frame when the audio frame is started; Acquiring a fourth timestamp when the audio frame is started and the audio data is sent to the audio hardware abstraction layer; And calculating a difference value between the fourth timestamp and the third timestamp to obtain the second processing time delay information.
  4. 4. The method of claim 1, wherein calculating the time taken by the audio driver from receiving the audio data to writing the audio data to the memory access region to obtain the third processing delay information comprises: Acquiring a fifth timestamp of the audio driver when the audio data is received; Acquiring a sixth timestamp of the audio driver from receiving the audio data to writing the audio data into the memory access region; and calculating the difference between the sixth timestamp and the five timestamps to obtain the third processing delay information.
  5. 5. The method for segment measurement of audio playback delay of claim 1, wherein said data processing module comprises a digital signal processor and a power amplifier; The calculating the time consumption of the data processing module to finish processing the audio data in the memory access area to obtain fourth processing time delay information includes: the power amplifier is electrically connected with the GPIO pin of the digital signal processor and the power amplifier through two channels of the oscilloscope respectively to obtain a seventh time stamp when the GPIO signal is acquired and an eighth time stamp when the power amplifier output signal is acquired; And calculating a difference value between the eighth timestamp and the seventh timestamp to obtain the fourth processing time delay information.
  6. 6. The method for measuring audio playback delay according to claim 5, wherein the two channels passing through the oscilloscope are electrically connected to the GPIO pin of the digital signal processor and the power amplifier, respectively, so as to obtain a seventh timestamp when the GPIO signal is acquired and an eighth timestamp when the power amplifier output signal is acquired, comprising: one channel of the oscilloscope is used for recording the level jump time of the GPIO pin and is used as the seventh time stamp; And the other channel through the oscilloscope is used for recording the starting jump time of the audio signal and is used as the eighth time stamp.
  7. 7. The method for measuring audio playback delay of claim 5, wherein before said computing data processing module finishes processing said audio data in said memory access region to obtain fourth processing delay information, further comprising: generating an audio file to be detected with amplitude jump from the audio data; And converting the format of the audio file to be tested into a WAV format.
  8. 8. The utility model provides a segmentation measuring device of audio play time delay, its characterized in that, segmentation measuring device sets up in the control module of player, control module is connected with test terminal machine signal transmission, segmentation measuring device includes: The first calculation module is used for receiving an audio playing instruction sent by the user side and calculating time consumption from when the audio playing application is started to when the audio data writing interface is called so as to obtain first processing time delay information; The second calculation module is used for calculating the time consumption from when the audio framework is started to when the audio framework sends the audio data to the audio hardware abstraction layer so as to obtain second processing time delay information; The third calculation module is used for writing the audio data into an audio driver from the audio hardware abstraction layer for processing, and calculating the time consumption of the audio driver from the time of receiving the audio data to the time of writing the audio data into a memory access area so as to obtain third processing time delay information; the fourth calculation module is used for calculating the time consumption of the data processing module for completing the processing of the audio data in the memory access area so as to obtain fourth processing time delay information; And the data transmission module is used for uploading the first processing time delay information, the second processing time delay information, the third processing time delay information and the fourth processing time delay information to the test terminal.
  9. 9. A computer device, comprising a processor, a network interface, a memory, and a communication bus, wherein the processor, the network interface, and the memory communicate with each other via the communication bus; A memory for storing a computer program; A processor for implementing the steps of the method for segment measurement of audio playback delay of any one of claims 1-7 when executing a program stored on a memory.
  10. 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method for segment measurement of audio playback delay as claimed in any one of claims 1-7.

Description

Method, device, equipment and medium for measuring audio playing time delay in segments Technical Field The present invention relates to the field of technologies, and in particular, to a method, an apparatus, a device, and a medium for measuring audio playback delay in segments. Background In a conventional audio system, the measurement of audio delay is often an overall measurement, and the delay contributions of each link cannot be accurately distinguished, for example, when the audio is played, delay caused by a software layer or a hardware layer is difficult to determine, and part of app is required for the total delay of played sound. Disclosure of Invention In order to overcome the defects of the prior art, the embodiment of the invention provides a method, a device, equipment and a medium for measuring audio playing time delay in a segmentation way. The technical scheme adopted for solving the technical problems is as follows: in a first aspect, the present invention provides a method for measuring audio playing delay in segments, where the method for measuring audio playing delay in segments is applied to a control module of a player, and the control module is connected with a test terminal in signal transmission, and the method for measuring audio playing delay in segments includes: Receiving an audio playing instruction sent by a user side, and calculating time consumption from when an audio playing application is started to when a write audio data interface is called so as to obtain first processing time delay information; Calculating the time consumption from when the audio framework is started to when the audio framework transmits audio data to the audio hardware abstraction layer so as to obtain second processing time delay information; Writing the audio data into an audio driver from the audio hardware abstraction layer for processing, and calculating the time consumption of the audio driver from the time of receiving the audio data to the time of writing the audio data into a memory access area so as to obtain third processing time delay information; Calculating time consumption of the data processing module for completing processing of the audio data in the memory access area so as to obtain fourth processing time delay information; and uploading the first processing time delay information, the second processing time delay information, the third processing time delay information and the fourth processing time delay information to the test terminal. In a second aspect, the present invention further provides a segment measurement device for audio playing delay, where the segment measurement device is disposed on a control module of a player, and the control module is connected with signal transmission of a test terminal, and the segment measurement device includes: The first calculation module is used for receiving an audio playing instruction sent by the user side and calculating time consumption from when the audio playing application is started to when the audio data writing interface is called so as to obtain first processing time delay information; The second calculation module is used for calculating the time consumption from when the audio framework is started to when the audio framework sends the audio data to the audio hardware abstraction layer so as to obtain second processing time delay information; The third calculation module is used for writing the audio data into an audio driver from the audio hardware abstraction layer for processing, and calculating the time consumption of the audio driver from the time of receiving the audio data to the time of writing the audio data into a memory access area so as to obtain third processing time delay information; the fourth calculation module is used for calculating the time consumption of the data processing module for completing the processing of the audio data in the memory access area so as to obtain fourth processing time delay information; And the data transmission module is used for uploading the first processing time delay information, the second processing time delay information, the third processing time delay information and the fourth processing time delay information to the test terminal. The invention also provides a computer device, which comprises a processor, a network interface, a memory and a communication bus, wherein the processor, the network interface and the memory are communicated with each other through the communication bus; A memory for storing a computer program; and a processor, configured to implement the step of the method for measuring audio playback delay according to any one of the first aspect when executing the program stored in the memory. The invention further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for segment measurement of audio playback delay as described in any one of the first a