Method and device for merging integration operation and sending operation of audio stream, and terminal

By combining the integrated operation and sending operation of audio streams in a CPU core, using ring buffer and clock adjustment technology, the problem that the CPU core cannot run at full load in traditional audio playback is solved, and the support of MQA hard decoding and DSD512 playback is realized , improves sound quality and system efficiency.

CN119031300APending Publication Date: 2024-11-26DONGGUAN KAIYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411123124.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

During traditional audio playback, two CPU cores are required to handle the integration and sending of audio streams respectively, resulting in the inability to effectively support MQA hard decoding and DSD512 playback, and the CPU core cannot run at full capacity.

Method used

By combining the integrated operation and sending operation of audio streams in a CPU core, the output speed of audio data is adjusted using ring buffer and clock adjustment technology, the combined processing of audio streams is realized, and the decoded data is sent to the DAC module for output.

Benefits of technology

It realizes MQA hard decoding and DSD512 playback simultaneous support, saving a CPU core for MQA rendering operations, improving sound quality and improving system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031300A_ABST
    Figure CN119031300A_ABST
Patent Text Reader

Abstract

The invention discloses an audio stream integration operation and sending operation merging method and device and a terminal. The method comprises the steps that an audio stream which is sent by an audio output module and comprises USB audio data and SPDIF audio data is acquired; judging a difference value between a read pointer and a write pointer of the first annular buffer area, and adjusting the output of the USB audio data through a first processor; the difference value of a read pointer and a write pointer of the second annular buffer area is judged, and a second processor conducts clock adjustment through a clock source so as to adjust output of the SPDIF audio data; the MAQ decoder is used for decoding the data in the annular buffer area; and the DAC module outputs audio outwards according to the clock adjustment signal of the clock source. According to the invention, the integration operation and the sending operation of the audio stream can be merged into one CPU core for operation, so that another CPU core in the traditional audio processing operation is saved, the MQA rendering operation is carried out, and the simultaneous support of MQA hard decoding and DSD512 playing can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the technical field of audio playback, and in particular to a method, device and terminal for combining an integration operation and a sending operation of an audio stream. [Background technology]

[0002] In the traditional audio playback process, two CPU (Central Processing Unit) cores are usually required to be responsible for data processing, one of which is responsible for integrating audio stream operations, and the other is responsible for sending audio stream operations, resulting in the subsequent MAQ (Master Quality Authenticated, an audio coding technology) rendering operation not being performed well or requiring another CPU core to be responsible. In fact, these two CPU cores cannot run at full capacity, and there are blank periods. In addition, since the integration operation and the sending operation of the audio stream are not performed at the same time, it is impossible to support MQA hard decoding and DSD512 playback at the same time. Therefore, how to integrate the integration and sending operations of the audio stream into one CPU core for processing, so as to free up one CPU core to process the rendering operation of MQA, has become an urgent problem to be solved.

[0003] In view of this, it is necessary to provide a method, device and terminal for combining the integration operation and the sending operation of audio streams to overcome the above-mentioned defects. [Summary of the invention]

[0004] The purpose of the present invention is to provide a method, device and terminal for merging the integration operation and the sending operation of an audio stream, aiming to solve the problem of how to integrate the integration operation and the sending operation of the audio stream into one CPU core for processing, so as to free up one CPU core to process the rendering operation of MQA, and realize the simultaneous support of MQA hard decoding and DSD512 playback.

[0005] In order to achieve the above object, the first aspect of the present invention provides a method for combining an audio stream integration operation and a sending operation, comprising:

[0006] Receive a playback request for the target audio, and obtain an audio stream including USB audio data and SPDIF audio data sent by the audio output module;

[0007] Writing the USB audio data into a first ring buffer and writing the SPDIF audio data into a second ring buffer;

[0008] Determine whether the difference between the read pointer and the write pointer of the first ring buffer is greater than 0, if the result is yes, speed up the output of the USB audio data through the first processor; otherwise, slow down the output of the USB audio data;

[0009] Determine whether the difference between the read pointer and the write pointer of the second ring buffer is greater than 0, if the result is yes, the second processor performs clock adjustment through the clock source to speed up the output of the SPDIF audio data, otherwise slow down the output of the SPDIF audio data;

[0010] The MAQ decoder decodes the data in the first ring buffer and the second ring buffer, and sends the decoded data to the DAC module;

[0011] The DAC module parses and processes the decoded data sent by the MQA decoder, and outputs audio to the outside according to the clock adjustment signal of the clock source.

[0012] In a preferred embodiment, the method further comprises the steps of:

[0013] Create a first ring buffer and a second ring buffer;

[0014] The data type in the audio stream is judged, and when it is judged to be USB audio data, it is written into the first ring buffer; when it is judged to be SPDIF audio data, it is written into the second ring buffer.

[0015] In a preferred embodiment, the method further comprises the step of integrating the USB audio data in the first ring buffer and the SPDIF audio data in the second ring buffer, and then sending the integrated audio data to the MQA decoder.

[0016] In a preferred embodiment, the method further comprises the steps of:

[0017] The DAC module sends a data request to the MQA decoder according to the clock adjustment signal of the clock source, and the MQA decoder reads data from the first ring buffer and the second ring buffer accordingly.

[0018] In a preferred embodiment, the first processor is a central processing unit, and the second processor is an I2C of a microprocessor. 2 C module.

[0019] A second aspect of the present invention provides a device for combining an audio stream integration operation and a sending operation, comprising:

[0020] The audio stream acquisition module is used to receive a playback request of the target audio and obtain the audio stream containing USB audio data and SPDIF audio data sent by the audio output module;

[0021] A buffer data writing module, used for writing the USB audio data into a first ring buffer and writing the SPDIF audio data into a second ring buffer;

[0022] a first buffer adjustment module, configured to determine whether a difference between a read pointer and a write pointer of the first ring buffer is greater than 0, and if so, speed up the output of the USB audio data through the first processor; otherwise, slow down the output of the USB audio data;

[0023] A second buffer adjustment module, used for determining whether the difference between the read pointer and the write pointer of the second ring buffer is greater than 0, if the result is yes, the second processor performs clock adjustment through a clock source to speed up the output of the SPDIF audio data, otherwise, slows down the output of the SPDIF audio data;

[0024] A MAQ decoder, configured to decode the data in the first ring buffer and the second ring buffer, and send the decoded data to the DAC module;

[0025] The DAC module is used to parse and process the decoded data sent by the MQA decoder, and output audio to the outside according to the clock adjustment signal of the clock source.

[0026] A third aspect of the present invention provides a terminal, comprising a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the computer program implements the steps of the method for merging the audio stream integration operation and the sending operation as described in any one of the above implementation modes.

[0027] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for merging the audio stream integration operation and the sending operation as described in any one of the above-mentioned implementation modes.

[0028] A fifth aspect of the present invention provides a computer program product, including a computer program or instructions, which, when processed and executed, implement the various steps of the method for merging the audio stream integration operation and the sending operation as described in any one of the above implementation modes.

[0029] The method, device and terminal for merging the audio stream integration operation and the sending operation provided by the present invention can merge the audio stream integration operation and the sending operation into one CPU core for execution by feedback adjusting the audio data transmission speed of the first ring buffer and the second ring buffer, thereby saving another CPU core in the traditional audio processing operation to perform MQA rendering operation, improve sound quality, and realize simultaneous support for MQA hard decoding and DSD512 playback.

Brief Description of the Drawings

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 A flowchart of a method for combining an audio stream integration operation and a sending operation provided by the present invention;

[0032] Figure 2 A framework diagram of a device for combining audio stream integration and sending operations provided by the present invention. [Specific implementation method]

[0033] In order to make the purpose, technical solution and beneficial technical effect of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be understood that the specific implementation methods described in this specification are only for explaining the present invention, not for limiting the present invention.

[0034] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0035] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0036] Embodiment 1

[0037] In an embodiment of the present invention, a method for merging an audio stream integration operation and a sending operation is provided, which is used to merge the audio stream integration operation (including USB audio stream and SPDIF audio stream) and the sending operation (sending the decoded audio data to DAC), and process them through a CPU core. Compared with the dual-core processing of the traditional audio processing method, the present invention can save a CPU core, which can be used for MQA rendering operations, thereby realizing simultaneous support for MQA hard decoding and DSD512 playback.

[0038] like Figure 1 As shown, the method for combining the audio stream integration operation and the sending operation includes steps S10-S60.

[0039] Step S10: receiving a play request of the target audio, and obtaining an audio stream including USB audio data and SPDIF audio data sent by the audio output module.

[0040] Among them, USB audio data can use isochronous transmission, interrupt transmission and control transmission to transmit audio data. Isochronous transmission is used to transmit audio data in real time, interrupt transmission is used to monitor the availability of audio clock, and control transmission is used to adjust settings such as volume and sampling rate. SPDIF (Sony / Philips Digital Interface Format, a digital audio connection standard created by Sony and Philips for transmitting uncompressed stereo PCM audio between home audio components) audio data supports lossless multi-channel audio and higher and higher resolution transmission.

[0041] Step S20: writing the USB audio data into the first circular buffer (buffer1), and writing the SPDIF audio data into the second circular buffer (buffer2).

[0042] Specifically, this step includes: creating a first circular buffer and a second circular buffer; judging the data type in the audio stream, and when judging it to be USB audio data, writing it into the first circular buffer; when judging it to be SPDIF audio data, writing it into the second circular buffer.

[0043] Step S30: determine whether the difference between the read pointer and the write pointer of the first ring buffer is greater than 0. If the result is yes, speed up the output of the USB audio data through the first processor; otherwise, slow down the output of the USB audio data so that the read pointer value of buffer1 is consistent with the write pointer value, so that the audio stream data in buffer1 will not overflow or be insufficient, thereby avoiding the CPU core from running in a full state.

[0044] The first processor is a central processor, that is, a CPU core of an electronic computer (PC).

[0045] Step S40: Determine whether the difference between the read pointer and the write pointer of the second ring buffer is greater than 0. If the result is yes, the second processor performs clock adjustment (clock adj.) through the clock source (CLK) to speed up the output of the SPDIF audio data, otherwise it slows down the output of the SPDIF audio data so that the read pointer value of buffer2 is consistent with the write pointer value. The second processor is an I2C microprocessor (MCU). 2 C module.

[0046] Step S50: The MAQ decoder decodes the data in the first ring buffer and the second ring buffer, and sends the decoded data to the DAC module.

[0047] The DAC (Digital-to-Analog Converter) module is responsible for converting digital audio signals into analog audio signals, thereby driving speakers or headphones to produce sound.

[0048] Specifically, the method further includes the step of integrating the USB audio data in the first ring buffer and the SPDIF audio data in the second ring buffer, and then sending them to the MQA decoder. It should be noted that the audio data integration method can refer to the prior art, and the present invention will not be repeated here.

[0049] Step S60: The DAC module parses and processes the decoded data sent by the MQA decoder, and outputs the audio according to the clock adjustment signal of the clock source.

[0050] The DAC module sends data requests to the MQA decoder according to the clock adjustment signal of the clock source, and the MQA decoder reads data from the first ring buffer and the second ring buffer accordingly. Therefore, the audio data integration and sending operations can be realized through one CPU core, thereby saving one CPU core.

[0051] Embodiment 2

[0052] The present invention provides a device 100 for merging an integration operation of an audio stream with a sending operation, which is used to merge the integration operation of an audio stream with the sending operation and process them through a CPU core. It should be noted that the implementation principle and specific implementation method of the device 100 for merging an integration operation of an audio stream with a sending operation can refer to the above-mentioned method for merging an integration operation of an audio stream with a sending operation, so it will not be repeated below.

[0053] like Figure 1 As shown, the device 100 for combining the audio stream integration operation and the sending operation includes:

[0054] The audio stream acquisition module 10 is used to receive a play request of a target audio and acquire an audio stream including USB audio data and SPDIF audio data sent by the audio output module;

[0055] The buffer data writing module 20 is used to write the USB audio data into the first ring buffer and write the SPDIF audio data into the second ring buffer;

[0056] The first buffer adjustment module 30 is used to determine whether the difference between the read pointer and the write pointer of the first ring buffer is greater than 0, and if the result is yes, speed up the output of the USB audio data through the first processor; otherwise, slow down the output of the USB audio data;

[0057] The second buffer adjustment module 40 is used to determine whether the difference between the read pointer and the write pointer of the second ring buffer is greater than 0. If the result is yes, the second processor performs clock adjustment through the clock source to speed up the output of the SPDIF audio data, otherwise, the output of the SPDIF audio data is slowed down;

[0058] A MAQ decoder 50, for decoding the data in the first ring buffer and the second ring buffer, and sending the decoded data to the DAC module;

[0059] The DAC module 60 is used to parse and process the decoded data sent by the MQA decoder, and output audio to the outside according to the clock adjustment signal of the clock source.

[0060] Embodiment 3

[0061] The present invention provides a terminal, which includes a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the computer program implements the steps of the method for merging the audio stream integration operation and the sending operation as described in any one of the above implementation modes.

[0062] Embodiment 4

[0063] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method for merging the audio stream integration operation and the sending operation as described in any one of the above-mentioned implementation modes.

[0064] Embodiment 5

[0065] The present invention provides a computer program product, including a computer program or an instruction, which, when processed and executed, implements the steps of the method for combining the audio stream integration operation and the sending operation as described in any one of the above implementation modes.

[0066] In summary, the method, device and terminal for merging the audio stream integration operation and the sending operation provided by the present invention can merge the audio stream integration operation and the sending operation into one CPU core for execution by feedback adjusting the audio data transmission speeds of the first ring buffer and the second ring buffer, thereby saving another CPU core in the traditional audio processing operation to perform MQA rendering operations, improve sound quality, and realize simultaneous support for MQA hard decoding and DSD512 playback.

[0067] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0068] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0069] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0070] In the embodiments provided by the present invention, it should be understood that the disclosed systems or devices / terminal equipment and methods can be implemented in other ways. For example, the system or device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the system or unit can be electrical, mechanical or other forms.

[0071] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0072] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0073] The present invention is not limited to what is described in the specification and implementation modes, and therefore additional advantages and modifications can be easily realized by those skilled in the art. Therefore, without departing from the spirit and scope of the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details, representative devices, and illustrative examples shown and described herein.

Claims

1. A method for combining an audio stream integration operation and a sending operation, characterized in that: include: Receive a playback request for the target audio, and obtain an audio stream including USB audio data and SPDIF audio data sent by the audio output module; Writing the USB audio data into a first ring buffer and writing the SPDIF audio data into a second ring buffer; Determine whether the difference between the read pointer and the write pointer of the first ring buffer is greater than 0, if the result is yes, speed up the output of the USB audio data through the first processor; otherwise, slow down the output of the USB audio data; Determine whether the difference between the read pointer and the write pointer of the second ring buffer is greater than 0, if the result is yes, the second processor performs clock adjustment through the clock source to speed up the output of the SPDIF audio data, otherwise slow down the output of the SPDIF audio data; The MAQ decoder decodes the data in the first ring buffer and the second ring buffer, and sends the decoded data to the DAC module; The DAC module parses and processes the decoded data sent by the MQA decoder, and outputs audio to the outside according to the clock adjustment signal of the clock source.

2. The method for combining the audio stream integration operation and the audio stream sending operation as claimed in claim 1, characterized in that: Also includes: Create a first ring buffer and a second ring buffer; Determine the data type in the audio stream, and when it is determined to be USB audio data, write it into the first ring buffer; When it is determined to be SPDIF audio data, it is written into the second ring buffer.

3. The method for combining the audio stream integration operation and the audio stream sending operation as claimed in claim 2, characterized in that: Also includes: The USB audio data in the first ring buffer and the SPDIF audio data in the second ring buffer are integrated and then sent to the MQA decoder.

4. The method for combining the audio stream integration operation and the audio stream sending operation as claimed in claim 3, characterized in that: Also includes: The DAC module sends a data request to the MQA decoder according to the clock adjustment signal of the clock source, and the MQA decoder reads data from the first ring buffer and the second ring buffer accordingly.

5. The method for combining the audio stream integration operation and the audio stream sending operation as claimed in claim 1, characterized in that: The first processor is a central processing unit, and the second processor is an I 2 C module.

6. A device for combining audio stream integration and sending operations, characterized in that: include: The audio stream acquisition module is used to receive a playback request of the target audio and obtain the audio stream containing USB audio data and SPDIF audio data sent by the audio output module; A buffer data writing module, used for writing the USB audio data into a first ring buffer and writing the SPDIF audio data into a second ring buffer; a first buffer adjustment module, configured to determine whether a difference between a read pointer and a write pointer of the first ring buffer is greater than 0, and if so, speed up the output of the USB audio data through the first processor; otherwise, slow down the output of the USB audio data; A second buffer adjustment module, used for determining whether the difference between the read pointer and the write pointer of the second ring buffer is greater than 0, if the result is yes, the second processor performs clock adjustment through a clock source to speed up the output of the SPDIF audio data, otherwise, slows down the output of the SPDIF audio data; A MAQ decoder, configured to decode the data in the first ring buffer and the second ring buffer, and send the decoded data to the DAC module; The DAC module is used to parse and process the decoded data sent by the MQA decoder, and output audio to the outside according to the clock adjustment signal of the clock source.

7. A terminal, characterized in that: The terminal includes a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, each step of the method for combining an integration operation and a sending operation of an audio stream as described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method for combining the audio stream integration operation and the sending operation as described in any one of claims 1 to 5.