Method for simultaneously outputting xmos-based spdif and i2s signals
By using hardware blocking interleaving technology on the XMOS processor, the simultaneous output of SPDIF and I2S signals is achieved, solving the problem of insufficient processor resources and improving hardware resources and processing efficiency.
Patent Information
- Application Number
- CN202310326801.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-03-29
AI Technical Summary
Existing technologies struggle to simultaneously output high-quality SPDIF and I2S signals when XMOS processor resources are insufficient, and require the use of two processor cores.
A single processor core is used to send SPDIF and I2S signals simultaneously. Audio data is interleaved into IOBUF for output using hardware blocking, and the IOBUF is used for interleaving and transmission.
This saves the resources of one processor core, improving hardware resources and the overall processing efficiency of the processor.
Smart Images

Figure CN116339676B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of audio signal output method, and in particular to a method for simultaneously outputting SPDIF and I2S signals based on xmos. BACKGROUND
[0002] The existing digital signal processor (DSP), especially the processor in the field of audio, commonly used is the arm architecture processor under the xmos flag. Mqa is an audio encoding technology, which provides an efficient method to compress high-fidelity audio signals into smaller files while retaining all the information of the original audio data for restoration when playing.
[0003] Under the mqa technology, the xmos chip is generally adopted, and six xmos cores are responsible for: 1, decoding, 2, process, 3, data processing, 4, clock management, 5, communication management, and 6, data transmission; In application, the cores of the xmos will also perform task allocation according to the scene and the characteristics of the hardware device, for example, six xmos are responsible for: 1, decoding, 2, reconstruction (mainly reconstructing high-frequency signals to improve resolution and dynamic range), 3, aliasing (aliasing the reconstructed signal with the original signal), 4, filtering, 5, clock management, and 6, data transmission.
[0004] In order to provide the output of the back-end SPDIF and I2S signals, and provide the IO / device control function, that is, one xmos core is responsible for the SPDIF output, one xmos core is responsible for the I2S output, and one core is responsible for the IO / device control. However, under the mqa framework, the six cores of the xmos are not enough, and high-quality audio output is also provided to the back-end, so the number of processing cores for audio function cannot be reduced or should not be reduced as much as possible, and in order to realize the simultaneous output of SPDIF and I2S, the existing technical solution needs to occupy two cores.
[0005] Therefore, there is an urgent need for a processing / audio output method that can simultaneously output SPDIF and I2S under the condition that the CPU core resources are insufficient, and guarantee the audio quality. SUMMARY
[0006] In order to solve one or more problems in the prior art, the present application provides a method for simultaneously outputting SPDIF and I2S signals based on xmos. The technical scheme adopted by the present application to solve the above problems is: a method for simultaneously outputting SPDIF and I2S signals based on xmos, comprising: using one processor core to simultaneously send two different formats of digital audio signals, the digital audio signals comprising: SPDIF and I2S audio signals;
[0007] The method comprises: S010, acquiring audio data, wherein the audio data is audio data transmitted to a left or right channel;
[0008] S020, data conversion, converting part or all of the audio data into an SPDIF format according to requirements and settings, the converted data being recorded as first audio data, and transmitting the first audio data to an IOBUF;
[0009] S030, acquiring the audio data in an I2S format, the audio data being recorded as second audio data, and transmitting part or all of the second audio data to the IOBUF according to requirements and settings;
[0010] S040, if the audio data has a remainder, recording the remainder of the audio data as excess audio data, converting part or all of the excess audio data into an SPDIF format according to requirements and settings, then transmitting the first audio data obtained in this stage to the IOBUF, and repeatedly circulating until all the audio data is transmitted;
[0011] S041, if the audio data has a remainder, transmitting part or all of the second audio data to the IOBUF according to requirements and settings, and repeatedly circulating until all the audio data is transmitted;
[0012] S050, re-executing the acquisition of the audio data or ending;
[0013] The first audio data and the second audio data are transmitted to the IOBUF in a hardware blocking manner, and the IOBUF transmits the acquired first audio data and second audio data in an interleaved manner.
[0014] The present application has the following advantages: the present application uses one processor core to transmit digital audio signals, transmits two formats of data to the IOBUF in a hardware blocking manner, and transmits the I2S and SPDIF audio data in an interleaved manner through the IOBUF, thereby realizing the simultaneous output of the I2S and SPDIF audio data. This method of simultaneously outputting the I2S and SPDIF audio data can save one processor core, and the saved hardware resources can be used to process other data, thereby improving the utilization efficiency of hardware resources and the overall processing efficiency of the processor. The above greatly improves the practical value of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0015] Figure 1 The present application is a schematic block diagram. DETAILED DESCRIPTION
[0016] In order to make the above objectives, features and advantages of the present application more obvious and comprehensible, the specific embodiments of the present application will be described in detail below with reference to the drawings. In the following description, a large number of specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many different ways other than those described herein, and those skilled in the art can make similar improvements without departing from the spirit of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0017] As shown in Figure 1 The present application discloses a method for simultaneously outputting SPDIF and I2S signals based on xmos, which comprises: using one processor core for IO / device control, using another processor core for simultaneously sending digital audio signals in two different formats, wherein the digital audio signals comprise: SPDIF and I2S audio signals.
[0018] The method comprises: S010, acquiring audio data, wherein the audio data is audio data to be transmitted to left or right channels;
[0019] S020, data conversion, converting part or all of the audio data into SPDIF format according to requirements and settings, and recording the converted data as first audio data, and sending the first audio data to IOBUF;
[0020] S030, acquiring I2S format audio data, recording the I2S format audio data as second audio data, and sending part or all of the second audio data to IOBUF according to requirements and settings;
[0021] S040, if there is remaining audio data, recording the remaining audio data as excess audio data, converting part or all of the excess audio data into SPDIF format according to requirements and settings, and then sending the first audio data obtained in this stage to IOBUF, and repeating the cycle until all the audio data is transmitted;
[0022] S041, if there is remaining audio data, sending part or all of the second audio data to IOBUF according to requirements and settings, and repeating the cycle until all the audio data is transmitted;
[0023] S050, acquiring or ending the audio data again;
[0024] The first audio data and the second audio data are transmitted to IOBUF in a hardware blocking manner, and IOBUF interleaves and sends the acquired first audio data and second audio data.
[0025] IOBUF is the abbreviation of input / output buffer, which refers to an input / output buffer. The implementation of interleaved transmission of IOBUF is generally achieved by using asynchronous IO or non-blocking IO mechanism in the application. The size and number of IOBUF in the present application are determined according to actual needs, i.e. according to the initial audio data input and the audio data to be output.
[0026] In combination Figure 1 As shown, I2S and SPDIF data are interleaved and transmitted to IOBUF by hardware blocking, and then IOBUF stores and outputs the two kinds of data. In combination with S030, the acquired I2S data can be the original format of the audio data, or the audio data can be converted to I2S format as in S020, such as converting PCM / DSD to I2S format, and then performing S030. If the audio data obtained by S010 is in I2S format, no conversion is needed in S030, otherwise conversion is needed.
[0027] In S020-S041, according to the requirements and settings, it means that the I2S / SPDIF data converted and input into IOBUF is set according to the size and number of IOBUF, i.e. the audio data input can be directly converted and input in the appropriate size range, or the data after cutting and segmenting is converted and input in the inappropriate size range, until the transmission of a segment of the audio data is completed; and the transmission of corresponding I2S and SPDIF data is performed according to the requirements of the device / user. Therefore, the requirements and settings are determined according to the actual situation and are flexible and variable.
[0028] In combination with the above, if the first audio data input into IOBUF in S020 is the corresponding entire audio data, S040 does not need to be executed again; if the second audio data input into IOBUF in S030 is the corresponding entire audio data, S041 does not need to be executed again; otherwise, cutting and segmenting transmission is performed.
[0029] In particular, Figure 1 What is not pointed out in S020-S041 is that the I2S and SPDIF data are interleaved and transmitted to IOBUF by hardware blocking, not synchronous transmission to IOBUF.
[0030] In summary, by using the method, the transmission of the digital audio signal is performed by using one processor core, the data in two formats is transmitted to IOBUF by using the hardware blocking mode, the I2S and SPDIF audio data is interleaved and transmitted by IOBUF, and then the simultaneous output of the I2S and SPDIF audio data is realized. The simultaneous output of the I2S and SPDIF audio data can save one processor core resource, and the saved hardware resource is used for processing other data, so that the utilization efficiency of the hardware resource is improved, and the overall processing efficiency of the processor is improved.
[0031] The above embodiments only express one or more embodiments of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation of the present application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for simultaneous output of SPDIF and I2S signals based on XMOS, characterized in that, A single processor core is used to simultaneously transmit two different digital audio signal formats, including SPDIF and I2S audio signals. The method includes: S010, acquiring audio data, wherein the audio data is audio data transmitted to the left or right channel; S020, Data conversion: Convert part or all of the audio data into SPDIF format according to requirements and settings. The converted data is recorded as the first audio data and sent to IOBUF. S030, the acquired I2S format audio data is recorded as the second audio data, and part or all of the second audio data is sent to IOBUF according to requirements and settings; S040, if there is any remaining audio data, the remaining audio data is recorded as surplus audio data. According to the requirements and settings, some or all of the surplus audio data is converted into SPDIF format. Then, the first audio data obtained in this stage is sent to IOBUF. This process is repeated until all the audio data is transmitted. S041, if there is any remaining audio data, then according to the requirements and settings, some or all of the second audio data will be sent to IOBUF, and the process will be repeated until all the audio data has been transmitted. S050, execute the acquisition or termination of the audio data again; The first audio data and the second audio data are transmitted to IOBUF via hardware blocking. IOBUF then interleaves and transmits the acquired first audio data and second audio data.
Citation Information
Patent Citations
An audio test method and equipment
CN109743668A
KR20200025829A