Movatterモバイル変換


[0]ホーム

URL:


CN114697817A - Audio data processing systems and electronic equipment - Google Patents

Audio data processing systems and electronic equipment
Download PDF

Info

Publication number
CN114697817A
CN114697817ACN202011624764.XACN202011624764ACN114697817ACN 114697817 ACN114697817 ACN 114697817ACN 202011624764 ACN202011624764 ACN 202011624764ACN 114697817 ACN114697817 ACN 114697817A
Authority
CN
China
Prior art keywords
audio data
audio
frame
data
channel
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.)
Granted
Application number
CN202011624764.XA
Other languages
Chinese (zh)
Other versions
CN114697817B (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN202011624764.XApriorityCriticalpatent/CN114697817B/en
Publication of CN114697817ApublicationCriticalpatent/CN114697817A/en
Application grantedgrantedCritical
Publication of CN114697817BpublicationCriticalpatent/CN114697817B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application provides an audio data processing system and an electronic device. First, the control processing device acquires first audio data. And then, the control processing device encapsulates the first audio data according to the adopted preset standard mode to obtain second audio data comprising a plurality of frames with the same length, and the second audio data is suitable for being transmitted on the adopted bus. And then the control processing device sends the second audio time into the bus frame by frame, and the interface conversion chip receives the second audio data from the bus frame by frame. And finally, the interface conversion chip modulates the second audio data according to the type of the digital audio transmission channel to obtain third audio data which can be used for transmission on the digital audio transmission channel. Thereby enabling the transfer of audio data with a single bus.

Description

Translated fromChinese
音频数据处理系统和电子设备Audio data processing systems and electronic equipment

技术领域technical field

本申请属于数字音频技术领域,尤其涉及音频数据处理系统和电子设备。The present application belongs to the technical field of digital audio, and in particular relates to audio data processing systems and electronic equipment.

背景技术Background technique

音响数据的采集、处理和传输是多媒体技术的重要组成部分。众多的数字音频系统已经进入消费市场,例如数字音频录音带、数字声音处理器。对于设备和生产厂家来说,标准化的信息传输结构可以提高系统的适应性。例如,可根据传输标准在时钟信号的控制下进行左右声道数据切换,实现用总线传输双声道音频数据;或者用多个总线传输多声道音频数据,其中每个总线传输两个声道的音频数据。目前,尚没有一种通用的方法能很好地实现用单个总线传输双声道和多声道音频数据。The acquisition, processing and transmission of audio data is an important part of multimedia technology. Numerous digital audio systems have entered the consumer market, such as digital audio cassettes, digital sound processors. For equipment and manufacturers, a standardized information transmission structure can improve the adaptability of the system. For example, the left and right channel data can be switched under the control of the clock signal according to the transmission standard, so that two-channel audio data can be transmitted by bus; or multi-channel audio data can be transmitted by multiple buses, wherein each bus transmits two channels audio data. At present, there is no general method to transmit two-channel and multi-channel audio data well with a single bus.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请提供一种音频数据处理系统,在本申请的第一方面,该音频数据处理系统包括控制处理装置和接口转换装置,控制处理装置和接口转换装置之间通过总线连接进行数据的传输。首先,控制处理装置获取第一音频数据,根据所采用的预设标准方式对第一音频数据进行封装,封装后得到第二音频数据,该第二音频数据中包含若干个长度相同的帧,第二音频数据的这种格式适用于在总线上进行传输。然后,控制处理装置根据总线所遵循的时钟信号,即根据帧时钟信号的周期和位时钟信号变化的次数,将第二音频数据中的若干个帧逐个送入总线传输;其中,帧时钟信号的频率小于位时钟信号的频率,且在帧时钟信号的半个周期内,位时钟信号变化的次数不小于第二音频数据的一个帧的比特长度的两倍,从而确保在帧时钟信号的半个周期内总线可以传输第二音频数据的一个帧。接下来,接口转换装置根据帧时钟信号的周期和位时钟信号变化的次数,从总线中逐个接收第二音频数据中的若干个帧,从而接口转换接装置接收到第二音频数据。最后,接口转换装置根据数字音频传输通道的类型,对第二音频数据进行调制得到第三音频数据,该第三音频数据具有可以在数字音频传输通道上传输的数据形式。In view of this, the present application provides an audio data processing system. In a first aspect of the present application, the audio data processing system includes a control processing device and an interface conversion device, and the control processing device and the interface conversion device are connected through a bus to perform data processing. transmission. First, the control processing device obtains the first audio data, encapsulates the first audio data according to the adopted preset standard method, and obtains the second audio data after the encapsulation. The second audio data includes several frames of the same length. This format of audio data is suitable for transmission on the bus. Then, the control processing device sends several frames of the second audio data into the bus one by one for transmission according to the clock signal followed by the bus, that is, according to the period of the frame clock signal and the number of times the bit clock signal changes; The frequency is less than the frequency of the bit clock signal, and the number of changes of the bit clock signal in a half cycle of the frame clock signal is not less than twice the bit length of one frame of the second audio The bus can transmit one frame of the second audio data in one cycle. Next, the interface conversion device receives several frames of the second audio data one by one from the bus according to the period of the frame clock signal and the number of times the bit clock signal changes, so that the interface conversion device receives the second audio data. Finally, the interface conversion device modulates the second audio data according to the type of the digital audio transmission channel to obtain third audio data, where the third audio data has a data form that can be transmitted on the digital audio transmission channel.

本申请的第一方面提供的系统,使得控制处理装置可以经由单个总线将数据发送给接口转换芯片,是因为本申请提供的控制处理装置对第一音频数据进行了适应性的封装,从而使得封装后得到的第二音频数据具备适用于通过总线进行传输的数据格式。上述总线可以是集成电路内置音频(inter-IC sound,I2S)总线等类型的总线。In the system provided by the first aspect of the present application, the control and processing device can send data to the interface conversion chip via a single bus, because the control and processing device provided by the present application adaptively encapsulates the first audio data, so that the encapsulation The second audio data obtained afterward has a data format suitable for transmission through the bus. The above-mentioned bus may be a type of bus such as an integrated circuit built-in audio (inter-IC sound, I2S) bus.

基于本申请第一方面提供的系统,下面介绍控制处理装置根据帧时钟信号和位时钟信号发送第二音频数据的过程:Based on the system provided by the first aspect of the present application, the following describes the process of the control processing device sending the second audio data according to the frame clock signal and the bit clock signal:

首先,控制处理装置在一个帧时钟信号周期的前半个周期内,当读取到位时钟信号变化预设次数之后,开始发送第二音频数据中的某一帧,可将该帧称为第一帧。然后,控制处理装置在该帧时钟周期的后半个周期内,当读取到位时钟信号变化预设次数之后,开始发送第二音频数据中的位于第一帧之后的下一个帧,可将该帧称为第二帧。第二帧是第二音频数据中位于第一帧之后的下一个帧。从而重复上述过程,控制处理装置可实现将第二音频数据逐帧送入总线进行传输。First, in the first half of a frame clock signal cycle, the control processing device starts to send a certain frame of the second audio data after reading the bit clock signal changes a preset number of times, which can be called the first frame . Then, in the second half of the frame clock cycle, the control processing device starts to send the next frame after the first frame in the second audio data after the read-in-bit clock signal changes a preset number of times. The frame is called the second frame. The second frame is the next frame after the first frame in the second audio data. Thus, by repeating the above process, the control and processing device can realize that the second audio data is sent to the bus frame by frame for transmission.

基于上述控制处理装置发送第二音频数据的过程,下面介绍接口转换装置根据帧时钟信号和位时钟信号接收第二音频数据的过程:Based on the process of sending the second audio data by the above-mentioned control processing device, the following describes the process of the interface conversion device receiving the second audio data according to the frame clock signal and the bit clock signal:

首先,接口转换装置在一个帧时钟信号周期的前半个周期内,当读取到位时钟信号变化预设次数之后,开始接收第二音频数据中的第一帧。然后,接口转换装置在该帧时钟周期的后半个周期内,当读取到位时钟信号变化预设次数之后,开始接收第二音频数据中的第二帧。从而重复上述过程,接口转换装置可实现从总线逐帧接收第二音频数据。First, the interface conversion device starts to receive the first frame of the second audio data after the read bit clock signal changes a preset number of times in the first half of a frame clock signal period. Then, in the second half of the frame clock period, the interface conversion device starts to receive the second frame of the second audio data after the read bit clock signal changes a preset number of times. Thus, by repeating the above process, the interface conversion device can realize to receive the second audio data frame by frame from the bus.

在上述控制处理装置发送第二音频数据和接口转换装置接收第二音频数据的过程中,预设次数可以是二,即在每半个帧时钟周期内位信号变化第二次之后开始发送或接收一帧数据中的第一个比特,然后在该半个帧时钟周期内每当位时钟信号变化两次就依次发送或接收后续的比特,直到在该半个帧时钟周期内完成该帧数据的发送或接收。重复该过程即可完成全部帧的发送或接收。In the process that the control processing device sends the second audio data and the interface conversion device receives the second audio data, the preset number of times can be two, that is, the transmission or reception starts after the bit signal changes for the second time in every half-frame clock cycle The first bit in a frame of data, and then every time the bit clock signal changes twice within the half frame clock period, the subsequent bits are sent or received in turn, until the frame data is completed within the half frame clock period. send or receive. Repeat this process to complete the transmission or reception of all frames.

基于本申请第一方面提供的系统,下面介绍一种根据所采用的预设标准方式对第一音频数据进行封装的方式,将此种方式称为第一预设方式:Based on the system provided by the first aspect of this application, a method for encapsulating the first audio data according to the adopted preset standard method is introduced below, and this method is referred to as the first preset method:

控制处理装置根据IEC60958标准对第一音频数据进行封装,得到第二音频数据。该第二音频数据的格式包括:The control processing device encapsulates the first audio data according to the IEC60958 standard to obtain second audio data. The format of the second audio data includes:

第二音频数据中的一个帧包含两个长度相同的子帧,将其称为子帧A和子帧B,子帧A位于子帧B之前;子帧A和子帧B中都包含头码,但子帧A和子帧B中的头码不同;子帧A中包含第一音频数据的16比特的取样,子帧B中也包含第一音频数据的16比特的取样。A frame in the second audio data includes two subframes with the same length, which are called subframe A and subframe B, and subframe A is located before subframe B; subframe A and subframe B both contain headers, but The header codes in subframe A and subframe B are different; subframe A contains 16-bit samples of the first audio data, and subframe B also contains 16-bit samples of the first audio data.

基于上述根据IEC60985标准进行封装的方式,当第一音频数据为未经编码压缩的双声道音频数据时,即第一音频数据中包含第一声道音频数据和第二声道音频数据,封装得到的第二音频数据的格式还包括:Based on the above-mentioned encapsulation method according to the IEC60985 standard, when the first audio data is unencoded and compressed two-channel audio data, that is, the first audio data includes the first-channel audio data and the second-channel audio data, the encapsulation The format of the obtained second audio data further includes:

子帧A中包含的第一音频数据的取样,是第一音频中的第一声道音频数据的取样;子帧B中包含的第一音频数据的取样,是第一音频数据中第二声道音频数据的取样;同一个帧中的子帧A和子帧B包含的取样,是第一音频数据的两个声道音频数据在相同时间段的取样,即第一音频数据的相同比特位置的取样。The sampling of the first audio data contained in the subframe A is the sampling of the first channel audio data in the first audio; the sampling of the first audio data contained in the subframe B is the sampling of the second audio data in the first audio data. The sampling of channel audio data; the samples contained in subframe A and subframe B in the same frame are the sampling of two channels of audio data of the first audio data in the same time period, that is, the sampling of the same bit position of the first audio data sampling.

从而当第一音频数据为未经编码压缩的双声道音频数据时,控制处理装置根据IEC60958对第一音频数据进行封装,封装后得到的第二音频数据具有适用于通过总线传输的数据格式。Therefore, when the first audio data is unencoded and compressed two-channel audio data, the control processing device encapsulates the first audio data according to IEC60958, and the encapsulated second audio data has a data format suitable for transmission through the bus.

基于本申请第一方面提供的系统,下面介绍另一种根据所采用的预设标准方式对第一音频数据进行封装的方式,将此种方式称为第二预设方式:Based on the system provided by the first aspect of this application, another method for encapsulating the first audio data according to the adopted preset standard method is introduced below, and this method is referred to as the second preset method:

控制处理装置先根据IEC61937标准对第一音频数据进行封装,得到中间阶段数据;再根据IEC60958标准对中间阶段数据进行封装,得到第二音频数据。The control processing device first encapsulates the first audio data according to the IEC61937 standard to obtain intermediate stage data; and then encapsulates the intermediate stage data according to the IEC60958 standard to obtain second audio data.

该中间阶段数据的格式包括:中间阶段数据中包含头字段和数据字段,数据字段是第一音频数据或者第一音频数据中的一段数据;中间阶段数据的长度应是16比特的整数倍。The format of the intermediate stage data includes: the intermediate stage data includes a header field and a data field, and the data field is the first audio data or a segment of data in the first audio data; the length of the intermediate stage data should be an integer multiple of 16 bits.

该第二音频数据的格式包括:第二音频数据中的一个帧包含两个长度相同的子帧,将其称为子帧A和子帧B,子帧A位于子帧B之前;子帧A和子帧B中都包含头码,但子帧A和子帧B中的头码不同;子帧A中包含中间阶段数据的16比特的取样,子帧B中也包含中间阶段数据的16比特的取样。The format of the second audio data includes: a frame in the second audio data includes two subframes with the same length, which are called subframe A and subframe B, and subframe A is located before subframe B; Frame B all contain header codes, but subframe A and subframe B have different header codes; subframe A contains 16-bit samples of intermediate stage data, and subframe B also contains 16-bit samples of intermediate stage data.

基于上述先根据IEC61937标准进行封装、再根据IEC60985标准进行封装的方式,当第一音频数据为经多声道音频编码算法编码压缩的多声道音频数据时,例如第一音频数据为“.ac3”、“.dts”、“.mpeg”等格式,封装得到的第二音频数据的格式还包括:包含于同一个帧中的子帧A和子帧B,子帧A中包含的中间阶段数据的取样和子帧B中包含的中间阶段数据的取样是中间阶段数据中两个相邻的取样。Based on the above-mentioned method of first encapsulating according to the IEC61937 standard and then encapsulating according to the IEC60985 standard, when the first audio data is multi-channel audio data encoded and compressed by the multi-channel audio coding algorithm, for example, the first audio data is ".ac3" ", ".dts", ".mpeg" and other formats, the format of the encapsulated second audio data also includes: subframe A and subframe B included in the same frame, subframe A included in the intermediate stage data The samples and the samples of the intermediate stage data contained in subframe B are two adjacent samples in the intermediate stage data.

从而当第一音频数据为经多声道音频编码算法编码压缩的多声道音频数据时,控制处理装置先后根据IEC61937、IEC60958标准对第一音频数据进行封装,封装后得到的第二音频数据具有适用于通过I2S总线传输的数据格式;且先根据IEC61937标准封装得到的中间阶段数据具有适用于采用IEC60958标准进行进一步封装的格式Therefore, when the first audio data is multi-channel audio data encoded and compressed by the multi-channel audio coding algorithm, the control processing device encapsulates the first audio data according to the IEC61937 and IEC60958 standards successively, and the second audio data obtained after the encapsulation has It is suitable for the data format transmitted through the I2S bus; and the intermediate stage data first encapsulated according to the IEC61937 standard has a format suitable for further encapsulation using the IEC60958 standard

基于上述第一预设方式和第二预设方式,控制处理装置对第一音频数据进行封装后得到的第二音频数据均是适用于通过总线进行传输的包含若干个长度相同的帧的数据,且封装所根据的标准是数字音频传输通道另一端设备可以解析的标准,从而接口转换装置仅需对经总线接收到的数据进行简单的调制处理即可将数据发送给数字音频传输通道另一端设备,进而降低了系统对接口转换装置计算能力的要求,可以采用较为便宜的芯片作为接口转换装置中的芯片,降低生产该系统的成本。Based on the above-mentioned first preset mode and second preset mode, the second audio data obtained after the control processing device encapsulates the first audio data is all data including several frames of the same length suitable for transmission through the bus. And the standard that the package is based on is a standard that can be parsed by the device at the other end of the digital audio transmission channel, so the interface conversion device only needs to perform simple modulation processing on the data received through the bus to send the data to the device at the other end of the digital audio transmission channel. , thereby reducing the system's requirement on the computing capability of the interface conversion device, and a relatively cheap chip can be used as the chip in the interface conversion device, thereby reducing the cost of producing the system.

基于本申请第一方面提供的系统,数字音频传输系统是数字音频传输线;接口转化装置中包含接口转换芯片和数字音频接口,其中数字音频接口上可以插入上述数字音频传输线。Based on the system provided by the first aspect of the present application, the digital audio transmission system is a digital audio transmission line; the interface conversion device includes an interface conversion chip and a digital audio interface, wherein the digital audio transmission line can be inserted into the digital audio interface.

该系统的一种可能形式中,上述接口转换芯片可以为FPGA。In a possible form of the system, the above-mentioned interface conversion chip may be an FPGA.

该系统的另一种可能形式中,上述数字音频传输线为索尼/飞利浦数字音频接口(sony/philips digital interface format,S/PDIF)传输线,此时接口转换装置对所接收到的第二音频数据进行的调制可以是双相符号编码(biphase mark code,BMC)调制,使得调制后得到的数据适用于通过S/PDIF传输线传输。In another possible form of the system, the above-mentioned digital audio transmission line is a Sony/Philips digital interface format (S/PDIF) transmission line. The modulation can be biphase mark code (BMC) modulation, so that the modulated data is suitable for transmission through the S/PDIF transmission line.

该系统的再一种可能形式中,上述控制处理装置可以为CPU,该系统是CPU和上述接口转换芯片构成的芯片模组。In another possible form of the system, the above-mentioned control processing device may be a CPU, and the system is a chip module composed of the CPU and the above-mentioned interface conversion chip.

基于本申请第一方面提供的系统,该系统还包括音频装置,接口转换装置和音频装置之间通过数字音频传输通道传输第三音频数据。Based on the system provided in the first aspect of the present application, the system further includes an audio device, and the third audio data is transmitted between the interface conversion device and the audio device through a digital audio transmission channel.

第二方面,本申请提供一种电子设备,该电子设备中包含如前所述第一方面的多种实施方式。In a second aspect, the present application provides an electronic device, which includes various implementations of the first aspect as described above.

基于本申请第二方面提供的电子设备,上述电子设备可以为大屏设备或PC设备,例如智能大屏、智能电视、笔记本电脑、台式电脑、一体机等。Based on the electronic device provided in the second aspect of the present application, the above electronic device may be a large screen device or a PC device, such as a smart large screen, a smart TV, a notebook computer, a desktop computer, an all-in-one computer, and the like.

附图说明Description of drawings

图1是本申请一实施例提供的I2S总线传输信号的示意图;1 is a schematic diagram of an I2S bus transmission signal provided by an embodiment of the present application;

图2是本申请一实施例提供的一种接口转换装置示意图;2 is a schematic diagram of an interface conversion device provided by an embodiment of the present application;

图3A是本申请一实施例提供的一种应用场景示意图;3A is a schematic diagram of an application scenario provided by an embodiment of the present application;

图3B是本申请一实施例提供的一种应用场景内部结构示意图;3B is a schematic diagram of an internal structure of an application scenario provided by an embodiment of the present application;

图3C是本申请一实施例提供的另一种应用场景示意图;3C is a schematic diagram of another application scenario provided by an embodiment of the present application;

图3D是本申请一实施例提供的另一种应用场景内部结构示意图;FIG. 3D is a schematic diagram of the internal structure of another application scenario provided by an embodiment of the present application;

图4是本申请一实施例提供的电子设备的结构示意图;4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

图5是本申请一实施例提供的CPU经接口转换芯片向音箱传输数据的示意图;5 is a schematic diagram of a CPU transmitting data to a speaker via an interface conversion chip provided by an embodiment of the present application;

图6是本申请一实施例提供的封装可根据的一种IEC标准的报文示意图;6 is a schematic diagram of a message of an IEC standard to which the encapsulation provided by an embodiment of the present application can be based;

图7是本申请一实施例提供的封装可根据的另一种IEC标准的报文示意图;7 is a schematic diagram of a message of another IEC standard to which the encapsulation provided by an embodiment of the present application can be based;

图8是本申请一实施例提供的一种接口转换装置功能模块图;8 is a functional block diagram of an interface conversion device provided by an embodiment of the present application;

图9是本申请一实施例提供的一种音频数据传输流程图。FIG. 9 is a flowchart of audio data transmission provided by an embodiment of the present application.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

为了便于理解本方案实施例,此处先对本方案中涉及的集成电路内置音频(inter-IC sound,I2S)总线进行简要介绍。In order to facilitate the understanding of the embodiments of this solution, a brief introduction to the integrated circuit built-in audio (inter-IC sound, I2S) bus involved in this solution is given here first.

集成电路内置音频总线(下简称“12S总线”)是飞利浦公司为数字音频设备之间的音频数据传输而制定的一种总线标准,该总线用于音频设备之间的数据传输,广泛应用于各种多媒体系统,通常用于传输双声道音频数据。Integrated circuit built-in audio bus (hereinafter referred to as "12S bus") is a bus standard developed by Philips for audio data transmission between digital audio devices. This bus is used for data transmission between audio devices and is widely used in various A multimedia system typically used to transmit two-channel audio data.

图1是一种I2S总线传输信号的示意图,如图1所示,I2S总线至少传输三个信号:帧时钟信号(left-right clock,LRCK)、位时钟信号(bit clock,BCLK)和串行数据(serialdata,SDATA)。Figure 1 is a schematic diagram of an I2S bus transmission signal. As shown in Figure 1, the I2S bus transmits at least three signals: frame clock signal (left-right clock, LRCK), bit clock signal (bit clock, BCLK) and serial data (serialdata, SDATA).

其中,帧时钟信号用于提供分辨当前传输声道类型,例如,帧时钟信号为低电平时(LRCK=0时)传输左声道,帧时钟信号为高电平时(LRCK=1时)传输右声道;或者,帧时钟信号为高电平时(LRCK=1时)传输左声道,帧时钟信号为低电平时(LRCK=0时)传输右声道;一个帧时钟周期内的一半时间传输左声道,另一半时间传输右声道。Among them, the frame clock signal is used to distinguish the current transmission channel type. For example, when the frame clock signal is at a low level (when LRCK=0), the left channel is transmitted, and when the frame clock signal is at a high level (when LRCK=1), the right channel is transmitted. Or, when the frame clock signal is high (when LRCK=1), the left channel is transmitted, and when the frame clock signal is low (when LRCK=0), the right channel is transmitted; half time in a frame clock cycle is transmitted The left channel, the other half of the time transmits the right channel.

位时钟信号又称串行时钟信号(serialclock,SCLK),用于提供数字音频数据传输的时钟信号,即针对数字音频的每一位数据,都有一个对应的位时钟信号脉冲,通常,位时钟信号的频率=2×采样频率×采样位数。The bit clock signal, also known as the serial clock signal (serialclock, SCLK), is used to provide a clock signal for digital audio data transmission, that is, for each bit of digital audio data, there is a corresponding bit clock signal pulse. Usually, the bit clock The frequency of the signal=2×sampling frequency×sampling number of bits.

串行数据用于提供传输的音频数据,在半个帧时钟周期内可以传输的数据长度(word size),通常可以为16位、24位、32位或其它数据位数,不超过半个帧时钟周期内位时钟信号变化的次数。数据的最高位(most significant bit,MSB)被最先传输,通常在帧时钟信号变化后的第二个位时钟信号脉冲处开始传输。数据的最低位(least significantbit,LSB)依赖于数据的有效位数n,接收端和发送端的有效位数可以不同,例如,如果接收端能够处理的有效位数少于发送端发送的有效位数,接收端可以放弃数据帧中多余的低位数据;如果接收端能够处理的有效位数多于发送端发送的有效位数,接收端可以自行补足剩余的位,例如,补足为零。这种同步机制可以使得数字音频设备的互连更加方便,且不会造成数据错位。串行数据还可以是包含串行数据输入(serial data input,SDIN)和串行数据输出(serial data output,SDOUT)两个数据的数据传输通道,SDIN和SDOUT分别负责不同方向的数据传输,从而实现I2S总线两端设备的双向数据传输。Serial data is used to provide transmitted audio data. The data length (word size) that can be transmitted in half a frame clock cycle can usually be 16 bits, 24 bits, 32 bits or other data bits, no more than half a frame. The number of times the bit clock signal changes within a clock cycle. The most significant bit (MSB) of the data is transmitted first, usually at the second bit clock signal pulse after the frame clock signal changes. The least significant bit (LSB) of the data depends on the number of significant bits n of the data, and the number of significant bits at the receiver and the sender can be different, for example, if the receiver can handle fewer significant bits than the sender sends , the receiving end can discard the redundant low-order data in the data frame; if the receiving end can process more effective digits than the transmitting end can send, the receiving end can make up the remaining bits by itself, for example, make up to zero. This synchronization mechanism can facilitate the interconnection of digital audio equipment without causing data misalignment. The serial data can also be a data transmission channel including serial data input (serial data input, SDIN) and serial data output (serial data output, SDOUT), and SDIN and SDOUT are respectively responsible for data transmission in different directions, thereby Realize bidirectional data transmission between devices at both ends of the I2S bus.

此外,有时为了使系统时间能够更好地同步,还需要另外传输一个主时钟信号(master clock,MCLK),又称系统时钟信号(system clock,SysCLK),用于提供处理器的时钟主信号,通常可以为采样频率的256倍或284倍。In addition, sometimes in order to make the system time better synchronized, it is necessary to transmit another master clock signal (master clock, MCLK), also known as system clock signal (system clock, SysCLK), to provide the main clock signal of the processor, Usually it can be 256 times or 284 times the sampling frequency.

在时钟信号的控制下进行左右声道数据切换,I2S总线可以实现双声道音频数据的传输。The left and right channel data is switched under the control of the clock signal, and the I2S bus can realize the transmission of two-channel audio data.

以上介绍了I2S总线的数据传输方法,以及I2S如何实现双声道音频数据的传输。接下来,为了便于理解本方案实施例,此处对本方案所解决的技术问题进行简要介绍。The above introduces the data transmission method of I2S bus, and how I2S realizes the transmission of two-channel audio data. Next, in order to facilitate understanding of the embodiments of this solution, the technical problems solved by this solution are briefly introduced here.

随着万物互联时代的到来,人们的家中安装了越来越多的智能家电。各类智能大屏、智能电视逐渐取代了曾经功能单一的电视,成为人们在家中畅玩游戏、进行影音娱乐、享受视听盛宴的关键电子设备。With the advent of the Internet of Everything era, more and more smart appliances are installed in people's homes. Various types of smart large screens and smart TVs have gradually replaced the single-function TVs and become the key electronic devices for people to play games at home, perform audio-visual entertainment, and enjoy audio-visual feasts.

这类大屏产品的芯片上,通常具备多种数字音频接口,音箱、家庭影院等音频设备可以通过相应的数字音频传输线,建立与大屏芯片的连接。当用户想要在家中获得如同影院一般的沉浸式音频体验时,用户可以配置具备多声道音频解码播放能力的家庭影院。The chips of such large-screen products usually have a variety of digital audio interfaces, and audio equipment such as speakers and home theaters can be connected to the large-screen chips through corresponding digital audio transmission lines. When users want to get an immersive audio experience like a theater at home, users can configure a home theater with multi-channel audio decoding and playback capabilities.

例如,5.1声道的家庭影院通常包含一台主机、一个中置音箱、一个低音炮音箱、一个前置左音箱、一个前置右音箱、一个环绕左音箱、一个环绕右音箱,可以播放六声道的音频数据。用户将大屏的音频输出设置为相应的5.1声道模式,并将大屏与家庭影院中的主机通过数字音频传输线相连接,从而主机接收来自大屏的音频输出。主机再通过有线和/或无线的形式,将音频传输给各个音箱,从而播放多声道音频。上述数字音频接口,通常包含索尼/飞利浦数字音频接口(sony/philips digital interface format,S/PDIF)、高清晰多媒体接口(high definition multimedia interface,HDMI)、高清晰多媒体接口音频回传通道(high definition multimedia interface audio return channel,HDMI-ARC)等。For example, a 5.1-channel home theater usually consists of a main unit, a center speaker, a subwoofer speaker, a front left speaker, a front right speaker, a surround left speaker, and a surround right speaker, which can play six sounds channel audio data. The user sets the audio output of the large screen to the corresponding 5.1 channel mode, and connects the large screen with the host in the home theater through a digital audio transmission line, so that the host receives the audio output from the large screen. The host then transmits the audio to each speaker in a wired and/or wireless form, thereby playing multi-channel audio. The above-mentioned digital audio interface usually includes a Sony/Philips digital interface format (S/PDIF), a high-definition multimedia interface (high definition multimedia interface, HDMI), and a high-definition multimedia interface audio return channel (high definition multimedia interface). multimedia interface audio return channel, HDMI-ARC), etc.

在上述过程中,大屏在收到用户的输出多声道音频的设置后,会输出多声道音频压缩文件格式的多声道音频数据,例如杜比AC-3环绕声(dolby surrounding audioencoding-3,AC3)、数字化影院系统(digital theater system,DTS)、动态图像专家组(moving picture experts group,MPEG)等文件格式的多声道音频数据。然后,大屏通过与大屏芯片上的数字音频接口相连接的数字音频传输线,将多声道音频数据发送给家庭影院的主机。家庭影院的主机具备相应的解码能力,从而进行解码处理还原出六个声道,然后将六个声道转换为脉冲编码调制(pulse code modulation,PCM)码流。进一步地,家庭影院的主机将六个声道的PCM码流,通过有线和/或无线的形式,分别发送给六个音箱。每个音箱对接收到的PCM码流进行数模转换、功率放大之后,通过喇叭播放该声道的音频。从而实现多声道音频的播放。In the above process, after receiving the user's settings for outputting multi-channel audio, the large screen will output multi-channel audio data in a multi-channel audio compression file format, such as Dolby AC-3 surround sound (dolby surrounding audioencoding- 3, AC3), digital theater system (digital theater system, DTS), moving picture experts group (moving picture experts group, MPEG) and other file formats of multi-channel audio data. Then, the large screen sends the multi-channel audio data to the host of the home theater through a digital audio transmission line connected to the digital audio interface on the large screen chip. The host of the home theater has the corresponding decoding capability, so that the decoding process is performed to restore the six channels, and then the six channels are converted into a pulse code modulation (PCM) stream. Further, the host of the home theater sends the six-channel PCM code stream to the six speakers respectively in a wired and/or wireless form. After each speaker performs digital-to-analog conversion and power amplification on the received PCM stream, the audio of the channel is played through the speaker. So as to realize the playback of multi-channel audio.

除了可以与音频设备配合,提供卓越的音频体验,智能大屏产品中的应用种也类越来越丰富。如今,除了看电视,用户还可以用智能大屏播放网络视频,用智能大屏玩各种画面绚丽的电子游戏,这就对智能大屏中的芯片的计算能力提出了新的要求。目前市面上的智能大屏,通常使用低性能的电视专用芯片,随着时代的发展,智能大屏中运行的应用程序越来越多、越来越复杂,这种低性能的电视专用芯片已经不能很好地支撑多种多样的应用,用户会体验到大屏操作系统的卡顿,降低用户体验。In addition to cooperating with audio equipment to provide an excellent audio experience, the applications in smart large-screen products are becoming more and more abundant. Nowadays, in addition to watching TV, users can also use the smart big screen to play online videos and play various video games with gorgeous pictures, which puts forward new requirements for the computing power of the chips in the smart big screen. At present, smart large screens on the market usually use low-performance TV-specific chips. With the development of the times, there are more and more and more complex applications running on smart large-screen screens. This low-performance TV-specific chip has been It cannot support a variety of applications well, and users will experience the lag of the large-screen operating system, which reduces the user experience.

针对上述问题可行的解决方法,就是使用手机专用芯片,替代原来的电视专用芯片。手机专用芯片的计算能力通常优于电视专用芯片,能够流畅地运行各种应用程序,为用户带来更好的使用体验。A feasible solution to the above-mentioned problems is to use a mobile phone dedicated chip to replace the original TV dedicated chip. The computing power of the dedicated chips for mobile phones is usually better than that of the dedicated chips for TVs, and can run various applications smoothly, bringing users a better experience.

然而,由于手机专用芯片一开始的设计目的是用于手机,手机并非专业的音频设备,手机中的音频器件通常只有扬声器和麦克风。手机也没有与各类专业音频设备,通过数字音频传输线进行连接,以传输多声道音频的需求。However, because the mobile phone-specific chip was originally designed for use in mobile phones, mobile phones are not professional audio equipment, and the audio devices in mobile phones usually only have speakers and microphones. The mobile phone also does not need to be connected with various professional audio equipment through digital audio transmission lines to transmit multi-channel audio.

因此,手机专用芯片设计之初,只需满足其与扬声器和麦克风的音频传输需求,使得手机专用芯片所能够提供的音频接口,相比于电视专用芯片极其缺乏。例如,手机专用芯片上的音频接口,通常只包含两到三个I2S接口,其中一个需要分配给麦克风,其中还可能有一个需要进行预留。因此,手机专用芯片中,可供扬声器(即音频输出)使用的音频接口,通常只有一个I2S接口。Therefore, at the beginning of the design of the mobile phone special chip, it only needs to meet the audio transmission requirements with the speaker and the microphone, so that the audio interface provided by the mobile phone special chip is extremely lacking compared with the TV special chip. For example, the audio interface on the special chip of the mobile phone usually only contains two to three I2S interfaces, one of which needs to be allocated to the microphone, and one of them may need to be reserved. Therefore, in the special chip of the mobile phone, the audio interface that can be used by the speaker (that is, the audio output) usually has only one I2S interface.

因此,要想用手机专用芯片替代智能大屏现在所使用的电视专用芯片,就必须解决手机专用芯片音频接口缺乏所引发的问题。即,手机专用芯片上没有电视专用芯片上通常含有的S/PDIF、HDMI、HDMI-ARC等接口,不能够直接通过数字音频传输线与音频设备连接。手机专用芯片上可用于音频输出的音频接口,只有一个I2S接口。因此,必须解决利用一个I2S接口实现手机专用芯片与音频设备之间数据传输的问题。Therefore, in order to replace the TV-specific chips currently used in smart large screens with mobile phone-specific chips, it is necessary to solve the problems caused by the lack of audio interfaces of mobile phone-specific chips. That is, there is no S/PDIF, HDMI, HDMI-ARC and other interfaces that are usually included on the dedicated TV chip, and cannot be directly connected to the audio device through a digital audio transmission line. The audio interface that can be used for audio output on the special chip of the mobile phone has only one I2S interface. Therefore, it is necessary to solve the problem of using an I2S interface to realize the data transmission between the special chip of the mobile phone and the audio equipment.

根据前述对I2S总线介绍可知,I2S总线可以根据I2S总线协议,通过在帧时钟信号的控制下进行左右声道数据切换,实现双声道音频数据的传输。若想要通过I2S总线传输多声道音频,一种可能的方法,是使用多个I2S接口。例如,用三个I2S接口传输六声道音频、用四个I2S接口传输八声道音频,其中每个I2S接口传输两个声道的音频数据。但这种方法,仍无法解决只有一个I2S接口情况下的多声道音频传输问题。According to the aforementioned introduction to the I2S bus, the I2S bus can realize the transmission of two-channel audio data by switching the left and right channel data under the control of the frame clock signal according to the I2S bus protocol. If you want to transmit multi-channel audio through the I2S bus, one possible method is to use multiple I2S interfaces. For example, three I2S interfaces are used to transmit six-channel audio, and four I2S interfaces are used to transmit eight-channel audio, wherein each I2S interface transmits two channels of audio data. However, this method still cannot solve the multi-channel audio transmission problem with only one I2S interface.

针对上述问题,本方案采用的解决方法,是设计一种接口转换装置,实现接口转换的功能。如图2所示,接口转换装置可包含接口转换芯片和数字音频接口,接口转换芯片与手机专用芯片通过一个I2S总线连接,数字音频接口可插入数字音频传输线,从而与音频设备通过数字音频传输线连接。手机专用芯片和接口转换芯片经过了相适应的软硬件配置,能够通过I2S总线传输多声道音频。从而接口转换装置和手机专用芯片作为一个整体,具备与外接的音频设备进行多声道音频传输的能力。手机专用芯片和接口转换芯片进行的配置方式,将在后续实施例中详细介绍,在此不做赘述。Aiming at the above problem, the solution adopted in this solution is to design an interface conversion device to realize the function of interface conversion. As shown in Figure 2, the interface conversion device may include an interface conversion chip and a digital audio interface, the interface conversion chip and the mobile phone dedicated chip are connected through an I2S bus, and the digital audio interface can be inserted into a digital audio transmission line, so as to connect with audio equipment through a digital audio transmission line . The mobile phone dedicated chip and interface conversion chip have been configured with appropriate software and hardware, and can transmit multi-channel audio through the I2S bus. Therefore, the interface conversion device and the mobile phone dedicated chip as a whole have the capability of multi-channel audio transmission with the external audio equipment. The configuration method of the mobile phone dedicated chip and the interface conversion chip will be described in detail in the subsequent embodiments, and will not be repeated here.

有鉴于此,本方案提供一种方法,实现用单个I2S总线接口传输多声道音频。接下来,结合附图依次介绍本方案的实施例。In view of this, this solution provides a method to realize multi-channel audio transmission with a single I2S bus interface. Next, the embodiments of the present solution are sequentially introduced with reference to the accompanying drawings.

图3A-图3B是本方案提供的实施例的应用场景示意图。3A-3B are schematic diagrams of application scenarios of the embodiments provided by this solution.

如图3A所示,智能大屏301和音箱302之间通过数字音频传输线303连接,音频数据通过数字音频传输线303由智能大屏301传输到音箱302,从而音箱302播放音频。As shown in FIG. 3A , thesmart screen 301 and thespeaker 302 are connected through a digitalaudio transmission line 303 , and audio data is transmitted from thesmart screen 301 to thespeaker 302 through the digitalaudio transmission line 303 , so that thespeaker 302 plays audio.

与图3A相对应的图3B,进一步描述了该场景中,所涉及的智能大屏的内部结构。如图3B所示,智能大屏内常可包含中央处理器(central processing unit,CPU)和接口转换装置,该接口转换装置具有如图2所示的内部架构。CPU作为智能大屏的运算和控制核心,执行信息处理、程序运行等多种功能。CPU上通常包含与各类总线连接的各类接口,从而使得CPU可以与其他模块或装置进行通信。例如,在本实施例中,CPU上包含I2S接口,通过I2S总线与接口转换装置中的接口转换芯片连接,CPU可通过该I2S总线向接口转换芯片发送数据。接口转换装置中的数字音频接口可插入数字音频传输线。接口转换芯片可将数据处理为可由数字音频传输线传输的形式,然后将该数据通过数字音频接口,经由数字音频传输线发送给音箱。FIG. 3B corresponding to FIG. 3A further describes the internal structure of the smart large screen involved in this scenario. As shown in FIG. 3B , the smart large screen often includes a central processing unit (CPU) and an interface conversion device, and the interface conversion device has an internal structure as shown in FIG. 2 . As the computing and control core of the intelligent large screen, the CPU performs various functions such as information processing and program running. The CPU usually includes various interfaces connected to various buses, so that the CPU can communicate with other modules or devices. For example, in this embodiment, the CPU includes an I2S interface, which is connected to the interface conversion chip in the interface conversion device through the I2S bus, and the CPU can send data to the interface conversion chip through the I2S bus. The digital audio interface in the interface conversion device can be inserted into the digital audio transmission line. The interface conversion chip can process the data into a form that can be transmitted by a digital audio transmission line, and then send the data to the speaker through the digital audio interface and via the digital audio transmission line.

可选地,该接口转换芯片还可以具备相反方向的接口转换功能,即,接收从数字音频传输线传输过来的音频类数据,将其转换为可由I2S总线传输的形式,再经I2S总线传输给CPU。可选地,该接口转换芯片还可以同时具备上述两个方向的接口转换功能,从而支持双向数据转换。本方案不限定接口转换芯片能够支持的数据传输方向,可以是单向的,也可以是双向的,均不超出本方案的范围。Optionally, the interface conversion chip can also have the interface conversion function in the opposite direction, that is, to receive the audio data transmitted from the digital audio transmission line, convert it into a form that can be transmitted by the I2S bus, and then transmit it to the CPU via the I2S bus. . Optionally, the interface conversion chip may also have the interface conversion function in the above two directions at the same time, thereby supporting bidirectional data conversion. This solution does not limit the data transmission direction that the interface conversion chip can support, which can be unidirectional or bidirectional, which does not exceed the scope of this solution.

在如图3A和图3B所示的场景中,接口转换装置安装在智能大屏内部,用户无需再额外配备外接的音频转接头就可将数字音频传输线直接插入智能大屏上的数字音频接口,从而以用户无感知的方式,实现音频传输的接口转换功能,进而提升用户体验。In the scenario shown in Figure 3A and Figure 3B, the interface conversion device is installed inside the smart screen, and the user can directly insert the digital audio transmission line into the digital audio interface on the smart screen without additionally equipping an external audio adapter. Therefore, the interface conversion function of audio transmission is realized in a way that the user does not perceive, thereby improving the user experience.

在图3A和图3B所示的场景中,CPU和接口转换装置还可共同构成一个模组,该模组整体上具备与外接的音频设备进行多声道音频传输的能力。In the scenarios shown in FIG. 3A and FIG. 3B , the CPU and the interface conversion device may also form a module together, and the module as a whole has the capability of performing multi-channel audio transmission with an external audio device.

可选地,在本方案提供的另一种实施例应用场景中,如图3C和图3D所示,智能大屏301与扩展坞304连接,扩展坞304和音箱302之间通过数字音频传输线303连接,音频数据经由扩展坞304转换为可由数字音频传输线303传输的数据形式,再经数字音频传输线303传输给音箱302,从而音箱302播放音频。本实施例中的扩展坞内通常安装有如图2所示接口转换装置,从而实现接口转换的功能,类似地,该接口转换功能可以是相反方向的或双向的,均不超出本方案的范围。Optionally, in another embodiment application scenario provided by this solution, as shown in FIG. 3C and FIG. 3D , the smartlarge screen 301 is connected to thedocking station 304 , and the digitalaudio transmission line 303 is used between thedocking station 304 and thespeaker 302 . Connected, the audio data is converted into a data form that can be transmitted by the digitalaudio transmission line 303 via thedocking station 304, and then transmitted to thespeaker 302 via the digitalaudio transmission line 303, so that thespeaker 302 plays audio. The docking station in this embodiment is usually installed with an interface conversion device as shown in FIG. 2 , so as to realize the function of interface conversion. Similarly, the interface conversion function can be in the opposite direction or bidirectional, which does not exceed the scope of this solution.

在如图3C和图3D所示的场景中,智能大屏的接口转换功能有限,此时可以通过配备外接的扩展坞的方式,实现与更多类型的传输线的连接,扩展智能大屏的接口种类。In the scenarios shown in Figure 3C and Figure 3D, the interface conversion function of the smart large screen is limited. At this time, the connection with more types of transmission lines can be realized by equipping an external docking station to expand the interface of the smart large screen. type.

在本方案的应用场景中,可选地,智能大屏还可以是其他类型的包含CPU的电子设备,包括但不限于电视、智能电视、个人电脑、笔记本电脑、一体机、多媒体播放器、手机、平板、智能手表。In the application scenario of this solution, optionally, the smart large screen can also be other types of electronic devices including CPUs, including but not limited to TVs, smart TVs, personal computers, notebook computers, all-in-one computers, multimedia players, mobile phones , tablet, smart watch.

上述电子设备可以具备如图4所示的结构。电子设备400可以包括处理器402,显示屏4011,摄像头4012,按键4013,音频模块4014,传感器模块4015,通信模块4016,存储模块4017,电源管理模块4018等。可以理解的是,本发明实施例示意的结构并不构成对电子设备400的具体限定。在本申请另一些实施例中,电子设备400可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。The above electronic device may have a structure as shown in FIG. 4 . The electronic device 400 may include a processor 402, a display screen 4011, a camera 4012, a key 4013, an audio module 4014, a sensor module 4015, a communication module 4016, a storage module 4017, a power management module 4018, and the like. It can be understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 400 . In other embodiments of the present application, the electronic device 400 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

可选地,CPU还可以是例如片上系统(system on chip,SoC)等其他具有信息处理、程序运行功能的芯片装置,均不超出本方案的范围。Optionally, the CPU may also be other chip devices having functions of information processing and program running, such as a system on chip (system on chip, SoC), which does not exceed the scope of this solution.

可选地,接口转换芯片可以是定制化芯片、通用芯片、现场可编程逻辑门阵列(field programmable gate array,FPGA)等形式的芯片,本方案不限定此处所使用的芯片类型。可选地,当采用FPGA作为接口转换芯片时,一方面可以省去设计定制化芯片的开销,另一方面,FPGA通常比市面上各类通用芯片价格更低,从而降低接口转换芯片的成本,进而降低整个方案的成本。Optionally, the interface conversion chip may be a customized chip, a general-purpose chip, a field programmable gate array (FPGA) or other form of chip, and this solution does not limit the chip type used here. Optionally, when FPGA is used as the interface conversion chip, on the one hand, the cost of designing customized chips can be saved. On the other hand, FPGAs are usually cheaper than various general-purpose chips on the market, thereby reducing the cost of interface conversion chips. This in turn reduces the cost of the entire program.

可选地,数字音频接口的类型包括但不限于S/PDIF、HDMI、HDMI-ARC、USB接口,数字音频传输线的类型包括但不限于S/PDIF传输线、HDMI传输线、HDMI-ARC传输线、USB传输线。Optionally, the types of digital audio interfaces include but are not limited to S/PDIF, HDMI, HDMI-ARC, and USB interfaces, and the types of digital audio transmission lines include but are not limited to S/PDIF transmission lines, HDMI transmission lines, HDMI-ARC transmission lines, and USB transmission lines. .

可选地,接口转换装置和音箱之间,或者扩展坞和音箱之间,除了采用数字音频传输线这种有线的形式,还可以采用无线的形式传输数据,包括但不限于蓝牙、Wi-Fi。此时,接口转换装置或扩展坞中还包含相应的蓝牙模块、Wi-Fi模块等,从而具备通过无线的数据传输通道向音箱传输数据、从音箱接收数据的功能。类似地,此时音箱中也包含相应的蓝牙、Wi-Fi模块,从而具备通过无线的数据传输通道向接口转换装置或扩展坞传输数据、从接口转换装置或扩展坞接收数据的功能。Optionally, between the interface conversion device and the speaker, or between the docking station and the speaker, in addition to the wired form of a digital audio transmission line, data can also be transmitted wirelessly, including but not limited to Bluetooth and Wi-Fi. At this time, the interface conversion device or the docking station also includes a corresponding Bluetooth module, a Wi-Fi module, etc., so as to have the function of transmitting data to and receiving data from the speaker through a wireless data transmission channel. Similarly, the corresponding Bluetooth and Wi-Fi modules are also included in the speaker at this time, so as to have the function of transmitting data to the interface conversion device or the docking station through the wireless data transmission channel, and receiving data from the interface conversion device or the docking station.

可选地,图3C和图3D中的扩展坞还可以是其他具有上述接口转换功能的设备,包括但不限于转接头、转接器、转接桥、中继器。Optionally, the docking station in FIG. 3C and FIG. 3D may also be other devices having the above interface conversion function, including but not limited to adapters, adapters, adapter bridges, and repeaters.

可选地,音箱还可以是其他类型的音频设备,包括但不限于家庭影院、家庭影院主机、蓝牙音箱、智能音箱、麦克风、语音助手、耳机。Optionally, the speakers may also be other types of audio devices, including but not limited to home theaters, home theater hosts, Bluetooth speakers, smart speakers, microphones, voice assistants, and headphones.

应当明确,虽然图3A-图3D所绘制的场景中包含一个音箱,但本方案适用的范围不限于一个音箱的场景,还可以是包含两个及两个以上音箱的场景,,从而可以实现更佳的立体声、环绕式的多声道音频播放体验。例如,图示中的音箱还可以是能够提供优质音频体验的家庭影院,此时,数字音频传输线通常与家庭影院中的主机相连接,主机再通过有线和/或无线的方式,与位于智能大屏附近和/或房间各个角落的多个音箱相连接。It should be clear that although the scene depicted in Figure 3A-Figure 3D includes one speaker, the scope of application of this solution is not limited to the scene of one speaker, but also to the scene containing two or more speakers, so that more The best stereo, surround multi-channel audio playback experience. For example, the speaker in the illustration can also be a home theater that can provide high-quality audio experience. At this time, the digital audio transmission line is usually connected to the host in the home theater, and the host is wired and/or wirelessly connected to the smart home theater. Connect multiple speakers near the screen and/or in various corners of the room.

本方案提供的方法,可以应用于如上所述的场景及多种可选场景中,而不超出本方案的范围。The method provided by this solution can be applied to the above scenarios and various optional scenarios without exceeding the scope of this solution.

基于上述实施例中描述的本方案的应用场景,接下来结合附图,详细讲述本方案的一种实施方式。Based on the application scenarios of the solution described in the foregoing embodiments, an implementation manner of the solution is described in detail below with reference to the accompanying drawings.

图5示例性地展示了当数字音频传输线为S/PDIF传输线时,本申请提出的一种解决方案示意图。如图5所示,首先,CPU获取第一音频数据501,第一音频数据501可以是经多声道音频编码算法编码压缩的多声道音频数据。上述多声道音频编码算法,可以是AC3、DTS、MPEG等,相应地,第一音频数据501可以是“.ac3”、“.dts”、“.mpeg”等格式的音频文件。多声道音频编码算法将多声道音频编码压缩为一个数据流,压缩后的数据流不对某一字节属于哪个声道进行区分。音频消费端的设备,例如音箱,接收到该数据流后进行解码即解压缩处理,从中还原出多个声道的音频数据从而进行播放。FIG. 5 exemplarily shows a schematic diagram of a solution proposed by the present application when the digital audio transmission line is an S/PDIF transmission line. As shown in FIG. 5 , first, the CPU acquiresfirst audio data 501 , which may be multi-channel audio data encoded and compressed by a multi-channel audio coding algorithm. The above-mentioned multi-channel audio coding algorithm may be AC3, DTS, MPEG, etc. Correspondingly, thefirst audio data 501 may be an audio file in formats such as ".ac3", ".dts", ".mpeg", etc. The multi-channel audio coding algorithm compresses the multi-channel audio coding into a data stream, and the compressed data stream does not distinguish which channel a certain byte belongs to. A device on the audio consumer side, such as a speaker, decodes and decompresses the data stream after receiving it, and restores the audio data of multiple channels for playback.

可选地,第一音频数据501可以是智能大屏中音乐播放软件当前播放时刻接下来一段时间的音频数据,上述一段时间可以是5毫秒、10毫秒等。CPU可从操作系统应用层获取到这段音频数据。Optionally, thefirst audio data 501 may be audio data for a period of time following the current playing time of the music playing software in the smart large screen, and the above period of time may be 5 milliseconds, 10 milliseconds, or the like. The CPU can obtain this audio data from the application layer of the operating system.

然后,CPU根据预设标准封装方式,对第一音频数据501进行封装,得到第二音频数据502。上述预设标准方封装方式,可以是参考国际电工委员会(internationalelectrotechnical commission,IEC)的有关标准所制定的封装方式,有关标准例如IEC61937、IEC60958等。有关采用IEC61937、IEC60958进行封装的具体过程,将在后续实施例中详细介绍,此处不做赘述。应当明确,本方案不限定具体根据何种标准进行封装,只要封装后得到的数据适用于通过I2S总线传输、音频消费端设备可根据标准进行解封装即可。上述封装,可以是通过在第一音频数据501中添加额外的数据字段实现的,因此第二音频数据502的长度通常大于第一音频数据501的长度。所添加的额外的数据字段,可以包含对第一音频数据501的描述性信息,例如第一音频数据501的文件格式等,具体根据所选用的标准决定。Then, the CPU encapsulates thefirst audio data 501 according to a preset standard encapsulation manner to obtain thesecond audio data 502 . The above-mentioned preset standard square packaging method may be a packaging method formulated with reference to relevant standards of the International Electrotechnical Commission (IEC), such as IEC61937, IEC60958 and so on. The specific process of using IEC61937 and IEC60958 for encapsulation will be introduced in detail in subsequent embodiments, and will not be repeated here. It should be clear that this solution does not limit the specific standard for encapsulation, as long as the data obtained after encapsulation is suitable for transmission through the I2S bus, and the audio consumer device can be decapsulated according to the standard. The above-mentioned encapsulation may be implemented by adding an extra data field to thefirst audio data 501 , so the length of thesecond audio data 502 is generally greater than that of thefirst audio data 501 . The added additional data field may contain descriptive information on thefirst audio data 501, such as the file format of thefirst audio data 501, etc., which is specifically determined according to the selected standard.

第二音频数据502可以包含若干个帧(frame),其中一个帧可以在I2S总线的半个帧时钟周期内传输,从而实现将构成第二音频数据502的若干个帧逐帧地送入I2S接口发送,经过I2S总线传输给接口转换芯片。Thesecond audio data 502 may include several frames, one of which may be transmitted within a half frame clock cycle of the I2S bus, so as to realize that several frames constituting thesecond audio data 502 are sent to the I2S interface frame by frame Send, and transmit to the interface conversion chip through the I2S bus.

上述将一个帧送入I2S总线发送的过程,可以结合图1和前述对I2S总线的介绍理解。如图1所示,I2S总线可在帧时钟信号为低电平时传输左声道、为高电平时传输右声道,或者反之。当用I2S总线传输上述帧时,可在I2S的半个帧时钟周期内的位时钟信号的第二个脉冲变化之后开始传输该帧的第一个比特,然后随位时钟信号每隔一次变化依次传输该帧的后续比特,在上述半个帧时钟周期内完成该帧的最后一个比特的传输。重复上述过程,CPU可将若干个帧依次送入I2S总线。应当明确,本方案不限定从位时钟信号的第几个脉冲变化之后开始传输帧的第一个比特,本领域技术人员可进行符合I2S协议的自定义配置。The above process of sending a frame to the I2S bus for transmission can be understood in conjunction with Figure 1 and the aforementioned introduction to the I2S bus. As shown in Figure 1, the I2S bus can transmit the left channel when the frame clock signal is low, the right channel when it is high, or vice versa. When the above frame is transmitted by the I2S bus, the first bit of the frame can be transmitted after the second pulse of the bit clock signal within half a frame clock cycle of the I2S changes, and then the bit clock signal changes every other time. The subsequent bits of the frame are transmitted, and the transmission of the last bit of the frame is completed within the half-frame clock cycle. Repeating the above process, the CPU can send several frames to the I2S bus in turn. It should be clear that this solution does not limit the first bit of the frame to be transmitted after the number of pulses of the bit clock signal changes, and those skilled in the art can perform custom configurations conforming to the I2S protocol.

接口转换芯片通过I2S接口逐帧地接收经过I2S总线传输过来的若干个帧,从而接口转化芯片接收到第二音频数据503。The interface conversion chip receives several frames transmitted through the I2S bus frame by frame through the I2S interface, so that the interface conversion chip receives thesecond audio data 503 .

上述接收帧的过程与前述发送帧的过程相对应。即,接口转化芯片在I2S的半个帧时钟周期内的位时钟信号的第二个脉冲变化之后开始接收该帧的第一个比特,然后随位时钟信号的变化依次接收该帧的后续比特,在上述半个帧时钟周期内完成该帧的最后一个比特的接收。重复上述过程,接口转换芯片可从I2S总线依次接收若干个帧。相应的,本方案不限定从位时钟信号的第几个脉冲变化之后开始接收帧的第一个比特,只要与CPU发送帧所遵循的规则相对应即可。The foregoing process of receiving a frame corresponds to the foregoing process of sending a frame. That is, the interface conversion chip starts to receive the first bit of the frame after the second pulse of the bit clock signal within half a frame clock cycle of I2S changes, and then receives the subsequent bits of the frame in sequence with the change of the bit clock signal, The reception of the last bit of the frame is completed within the above-mentioned half frame clock period. Repeating the above process, the interface conversion chip can sequentially receive several frames from the I2S bus. Correspondingly, this solution does not limit the number of pulses of the bit clock signal to start receiving the first bit of the frame, as long as it corresponds to the rules followed by the CPU for sending frames.

接口转化芯片对第二音频数据503进行双相符号编码(biphase mark code,BMC)调制,得到第三音频数据504。第三音频数据504是可由S/PDIF传输线传输的音频数据。如图5所示,本实施例中所使用的数字音频传输线为S/PDIF传输线,SPDIF传输线中包含一个串行数据线,不包含时钟信号线。经BMC编码调制的数据可通过一个串行数据线而不依赖于时钟信号进行传输,因此,本实施例中接口转换芯片可对第二音频数据503进行BMC编码调制。应当明确,本方案不限定接口转换芯片对第二音频数据503进行的处理,只要处理后得到的第三音频数据504可由所使用的数字音频传输线传输即可。The interface conversion chip performs biphase mark code (BMC) modulation on thesecond audio data 503 to obtainthird audio data 504 . Thethird audio data 504 is audio data that can be transmitted by the S/PDIF transmission line. As shown in FIG. 5 , the digital audio transmission line used in this embodiment is an S/PDIF transmission line, and the SPDIF transmission line includes a serial data line and does not include a clock signal line. The data encoded and modulated by the BMC can be transmitted through a serial data line without depending on the clock signal. Therefore, in this embodiment, the interface conversion chip can perform BMC encoding and modulation on thesecond audio data 503 . It should be clear that this solution does not limit the processing of thesecond audio data 503 by the interface conversion chip, as long as thethird audio data 504 obtained after processing can be transmitted by the used digital audio transmission line.

接口转换芯片将第三音频数据504通过S/PDIF接口经S/PDIF传输线进行发送。根据前述对S/PDIF传输线的介绍可知,SPDIF传输线包含一个串行数据线,不包含时钟信号线,因此送入S/PDIF传输线的过程即为简单的串行数据送入。根据上述描述本领域技术人员可理解上述送入S/PDIF传输线的过程如何实现,因而在此不做赘述。The interface conversion chip transmits thethird audio data 504 through the S/PDIF transmission line through the S/PDIF interface. According to the above description of the S/PDIF transmission line, the SPDIF transmission line includes a serial data line and does not include a clock signal line. Therefore, the process of sending the S/PDIF transmission line is a simple serial data input. According to the above description, those skilled in the art can understand how the above-mentioned process of sending to the S/PDIF transmission line is implemented, and thus will not be repeated here.

音频消费端设备(本实施例中为音箱)通过S/PDIF接口接收到经S/PDIF传输线传输过来的第三音频数据504。The audio consumer device (speaker in this embodiment) receives thethird audio data 504 transmitted through the S/PDIF transmission line through the S/PDIF interface.

进一步地,音箱对第三音频数据504依次进行解调、解封装、解压缩、数模转化、功率放大等处理,转换为电信号,驱动喇叭播放音频。如图5所示,上述各处理过程可由音箱中的各功能模块实现。上述解调可以是BMC解调,从而音箱获得第二音频数据503。上述解封装可以是根据CPU中进行封装时所根据的标准方式进行相应的解封装,从而音箱获得第一音频数据。上述解压缩可以是根据第一音频数据的格式进行相应的多声道音频解码,从而音箱得到多声道音频中每个声道的音频数据。每个声道的音频数据可以是PCM码流形式的音频数据,上述PCM码流经数模转换、功率放大后,形成电信号从而驱动用于播放该声道音频的喇叭播放音频。Further, the speaker sequentially performs demodulation, decapsulation, decompression, digital-to-analog conversion, power amplification, etc. on thethird audio data 504, converts it into an electrical signal, and drives the speaker to play audio. As shown in FIG. 5 , the above processing processes can be implemented by various functional modules in the sound box. The above-mentioned demodulation may be BMC demodulation, so that the speaker obtains thesecond audio data 503 . The above-mentioned decapsulation may be corresponding decapsulation according to the standard method used in the encapsulation in the CPU, so that the sound box obtains the first audio data. The above-mentioned decompression may be to perform corresponding multi-channel audio decoding according to the format of the first audio data, so that the speaker obtains the audio data of each channel in the multi-channel audio. The audio data of each channel may be audio data in the form of a PCM stream. After the PCM stream is digital-to-analog converted and power amplified, an electrical signal is formed to drive a speaker for playing the audio of the channel to play the audio.

可选地,音频消费端设备可以是家庭影院,此时家庭影院中的主机通过S/PDIF传输线与S/PDIF接口连接。如前所述,该主机完成上述解调、解封装、解压缩等处理,得到每个声道的PCM码流形式的音频数据。进而该主机将每个PCM码流通过有线和/或无线的形式发送给家庭影院中的多个音箱,实现环绕式多声道音频的播放。Optionally, the audio consumer device may be a home theater, in which case the host in the home theater is connected to the S/PDIF interface through an S/PDIF transmission line. As mentioned above, the host completes the above-mentioned processes such as demodulation, decapsulation, and decompression, and obtains audio data in the form of PCM code stream for each channel. Further, the host sends each PCM code stream to multiple speakers in the home theater in a wired and/or wireless form, so as to realize the playback of surround-type multi-channel audio.

通常图5所示的音频消费端设备(本实施例中为音箱)具有的功能,为市售的可播放和/或录制多声道音频的设备均内在包含的功能,此处为了形象描述本方案对上述功能进行了介绍。应当明确,本方案所设计的方法,不需对音频消费端设备进行额外的软硬件配置即可实现。Generally, the functions of the audio consumer device (speaker in this embodiment) shown in FIG. 5 are included in all commercially available devices that can play and/or record multi-channel audio. The scheme introduces the above functions. It should be clear that the method designed in this solution can be implemented without additional software and hardware configuration on the audio consumer device.

接下来,结合图6、图7详细说明本方案提供的一种采用IEC61937、IEC60958标准封装第一音频数据501的实施例的具体过程。Next, a specific process of an embodiment of encapsulating thefirst audio data 501 using the IEC61937 and IEC60958 standards provided by this solution will be described in detail with reference to FIG. 6 and FIG. 7 .

先结合图6介绍IEC60958标准。IEC60958是一种传递数字音频的接口标准,IEC60958通过一根线同时传递时钟信号和数据信号。IEC60958通常用于传输双声道音频数据,报文格式如图6所示。First, the IEC60958 standard is introduced in conjunction with Figure 6. IEC60958 is an interface standard for transmitting digital audio. IEC60958 transmits clock signals and data signals simultaneously through one wire. IEC60958 is usually used to transmit two-channel audio data, and the message format is shown in Figure 6.

根据IEC60958标准,一个块(block)601可由192个帧(frame)602构成,每个帧602可由两个子帧(sub-frame)603构成。每个帧602可包含两个声道的一组取样(sample),例如声道A、声道B的一组取样。取样可指整段音频数据中的一小段。这一组取样中的声道A可以包含于子帧A(sub-frame A)中,声道B可以包含于子帧B(sub-frame B)中。According to the IEC60958 standard, oneblock 601 may be composed of 192frames 602 , and eachframe 602 may be composed of twosub-frames 603 . Eachframe 602 may contain a set of samples for two channels, eg, a set of samples for channel A, channel B. A sample may refer to a small section of an entire piece of audio data. Channel A in this set of samples may be included in sub-frame A (sub-frame A), and channel B may be included in sub-frame B (sub-frame B).

子帧603的数据长度可为32比特,子帧603内可包含头码(preamble)604、辅助数据(auxiliary)605、音频数据606以及4比特的信息与检查码607。其中:The data length of thesubframe 603 may be 32 bits, and thesubframe 603 may include apreamble 604 ,auxiliary data 605 , audio data 606 , and 4-bit information and a check code 607 . in:

头码604可位于子帧603的开头第0至第3比特,用来表示一个子帧603的开头。头码604可有三种形态,分别表示该子帧603为声道A采样信号、声道B采样信号或者是一个块的起始子帧603(为声道A)。Theheader 604 may be located in the 0th to 3rd bits at the beginning of thesubframe 603 to indicate the beginning of asubframe 603 . Theheader 604 can have three forms, which respectively indicate that thesubframe 603 is a channel A sampled signal, a channel B sampled signal, or a start subframe 603 (for channel A) of a block.

辅助数据605可位于子帧603的第4至第7比特。此区块的设计目的是用来传递一些使用者自行添加的信息,但目前比较常见的用途是当取样超过20比特时,用这4比特来传送多出的取样比特。例如,当要传送24比特的取样时,可用这4比特来存放该取样的末4个比特。Theauxiliary data 605 may be located in the 4th to 7th bits of thesubframe 603 . The design purpose of this block is to transmit some information added by the user, but the more common use at present is to use these 4 bits to transmit the extra sampling bits when the sampling exceeds 20 bits. For example, when a 24-bit sample is to be transmitted, these 4 bits can be used to store the last 4 bits of the sample.

音频数据606可位于子帧603的第8至第27比特,用于存放实际的取样数据,长度为20比特。音频数据606可以LSB优先的方式传送。当取样长度低于20Bit时,没有用到的LSB比特可设定为零。例如,当使用者要传送16比特的取样时,可用第12至第27比特的位置(LSB在第12比特)传输,将第8至第11比特填零。The audio data 606 can be located in the 8th to 27th bits of thesubframe 603 for storing the actual sample data, and the length is 20 bits. Audio data 606 may be transmitted in an LSB-first manner. When the sample length is less than 20Bit, the unused LSB bits can be set to zero. For example, when a user wants to transmit a 16-bit sample, the position of the 12th to 27th bits can be used for transmission (the LSB is in the 12th bit), and the 8th to 11th bits are filled with zeros.

信息与检查码607可位于子帧603的第28至第31比特,可包含:The information and check code 607 may be located in the 28th to 31st bits of thesubframe 603 and may include:

(1)有效位(validity bit,V)。可位于子帧603的第28比特,可用于设定该子帧603内的数据是否正确。若设定为0,可代表此子帧603内的数据是正确、可被接收的。若设定为1,可代表接收端应忽略该子帧603。例如,CD转盘读取CD数据时,若是有某一个取样读不到,就可将代表该取样所在子帧603中的有效位设为1;(1) Validity bit (validity bit, V). It can be located in the 28th bit of thesubframe 603, and can be used to set whether the data in thesubframe 603 is correct. If it is set to 0, it means that the data in thissubframe 603 is correct and can be received. If set to 1, it means that the receiver should ignore thesubframe 603 . For example, when a CD turntable reads CD data, if a certain sample cannot be read, the significant bit in thesubframe 603 representing the sample can be set to 1;

(2)使用者位(user bit,U)。可位于子帧603的第29比特,可为使用者自行定义的位。每组取样传送1比特,直至192组取样传完后组成192比特的信息,两个声道可各自有一组192比特的使用者信息;(2) User bit (user bit, U). It can be located in the 29th bit of thesubframe 603, and can be a user-defined bit. Each group of samples transmits 1 bit, until 192 groups of samples are transmitted to form 192-bit information, each of the two channels can have a group of 192-bit user information;

(3)信道状态位(channel status bit,C)。可位于子帧603的第30比特,可用于表示两种信道状态。例如,设为0可代表所使用的传输信道状态信息为一般家用(consumer)结构,设为1可代表所使用的传输信道状态信息为专业(professional)结构;(3) Channel status bit (channel status bit, C). It can be located in the 30th bit ofsubframe 603 and can be used to represent two channel states. For example, set to 0 to represent that the used transmission channel state information is a general consumer structure, and set to 1 to represent that the used transmission channel state information is a professional (professional) structure;

(4)同位检查位(parity bit,P)。可位于子帧603的第31比特,可用于判别是否有奇数个比特发生错误,可使用偶位同位检查(even parity check)简便地进行错误检查。(4) Parity bit (parity bit, P). It can be located in the 31st bit of thesubframe 603, and can be used to determine whether an error occurs in an odd number of bits, and an even parity check can be used to easily perform an error check.

接下来结合图7介绍IEC61937标准。相比IEC 60958通常只用于传送两个声道的音频数据,IEC61937可以传送更复杂的音频数据,例如“.ac3”、“.dts”、“.mpeg”等格式的压缩的多声道音频数据,报文格式如图7所示。Next, the IEC61937 standard is introduced in conjunction with Figure 7. Compared with IEC 60958, which is usually only used to transmit two-channel audio data, IEC61937 can transmit more complex audio data, such as compressed multi-channel audio in ".ac3", ".dts", ".mpeg" and other formats. Data, the message format is shown in Figure 7.

根据IEC61937标准,数据(data)701可包含头码(preamble)703和有效载荷数据(data payload)704。根据IEC61937规范进行封装得到的数据701,可在信道中通过添加填充(stuffing)702进行传输。填充702可用于使数据701与时钟信号对齐。According to the IEC61937 standard, thedata 701 may include apreamble 703 and adata payload 704 . Thedata 701 encapsulated according to the IEC61937 specification can be transmitted by adding stuffing 702 in the channel. Padding 702 may be used to aligndata 701 with the clock signal.

其中,有效载荷数据704可为上述压缩的多声道音频数据,或者上述压缩的多声道音频数据中的一小段数据。Thepayload data 704 may be the above-mentioned compressed multi-channel audio data, or a small piece of data in the above-mentioned compressed multi-channel audio data.

头码703的长度可为64比特,可包含Pa、Pb、Pc和Pd,Pa、Pb、Pc和Pd的长度可分别为16比特。Pa、Pb可用于同步,其值可根据规范为固定字段。Pc中可包含用于表示数据类型的7个比特、用于表示数据有效性的1个比特、用于表示与数据类型无关的信息的5个比特、用于表示有效载荷数据704的序号的3个比特等。Pd可用于记录有效载荷数据704的比特长度。The length of theheader 703 may be 64 bits, and may include Pa, Pb, Pc, and Pd, and the lengths of Pa, Pb, Pc, and Pd may be 16 bits, respectively. Pa and Pb can be used for synchronization, and their values can be fixed fields according to the specification. The Pc can include 7 bits for indicating the data type, 1 bit for indicating the validity of the data, 5 bits for indicating information irrelevant to the data type, and 3 bits for indicating the serial number of thepayload data 704. bits etc. Pd can be used to record the bit length of thepayload data 704 .

基于以上对IEC60958标准和IEC61937标准的介绍,接下来详细描述本方案提供的一种实施例中进行封装的方法。Based on the above introduction to the IEC60958 standard and the IEC61937 standard, the encapsulation method in an embodiment provided by this solution is described in detail next.

本实施例提供的方法包括以下步骤:The method provided by this embodiment includes the following steps:

第一步,将压缩的多声道音频数据或者压缩的多声道音频数据中的一段数据(可对应于图5中的第一音频数据501或图7中的有效载荷数据704)先按照IEC61937标准进行封装,得到一种中间态的封装音频数据(可对应于图7中的数据701)。The first step is to convert the compressed multi-channel audio data or a piece of data in the compressed multi-channel audio data (which may correspond to thefirst audio data 501 in FIG. 5 or thepayload data 704 in FIG. 7 ) according to IEC61937 Standard encapsulation is performed to obtain an intermediate state encapsulated audio data (which may correspond todata 701 in FIG. 7 ).

第二步,将上述中间态的封装音频数据按照固定比特长度L(例如16比特)拆分得到的2N个取样(可对应于图6中子帧603的第12至第27比特数据)再逐一按照IEC60958标准进行封装,得到N个帧(可对应于图5中的第二音频数据502或图6中的块601),从而完成封装。In the second step, 2N samples (corresponding to the 12th to 27th bits of thesubframe 603 in FIG. 6 ) obtained by splitting the encapsulated audio data in the intermediate state according to the fixed bit length L (for example, 16 bits) are divided one by one. Encapsulation is performed according to the IEC60958 standard to obtain N frames (which may correspond to thesecond audio data 502 in FIG. 5 or theblock 601 in FIG. 6 ), thereby completing the encapsulation.

可选地,上述N可以是192。若N=192且上述固定比特长度L=16比特,此时可有如下计算:有效载荷数据704的长度可为(16比特×192×2-16比特×4)=6080比特。即,当CPU获取到来自操作系统应用层的一段音频数据,可从该段音频数据中截取6080比特进行上述封装处理,使得上述拆分等过程不出现剩余位数或空缺位数,这样可以使得上述封装过程在CPU中更为方便地执行。Optionally, the above N may be 192. If N=192 and the above-mentioned fixed bit length L=16 bits, the following calculation may be performed: the length of thepayload data 704 may be (16 bits×192×2−16 bits×4)=6080 bits. That is, when the CPU obtains a piece of audio data from the application layer of the operating system, it can intercept 6080 bits from the piece of audio data to perform the above-mentioned encapsulation processing, so that there are no remaining digits or vacant digits in the above-mentioned splitting and other processes, which can make The encapsulation process described above is more conveniently performed in the CPU.

封装完成后得到N个帧,如前述图5对应实施例中所述,CPU可进一步基于I2S总线的时钟信号,通过I2S总线逐帧地将其发送给接口转换芯片。更进一步的,接口转换芯片将接收到的数据进行处理,转换为可由数字音频传输线传输的数据;当所使用的数字音频传输线为S/PDIF传输线时,上述接口转换芯片进行的处理可以是BMC调制。After the encapsulation is completed, N frames are obtained. As described in the corresponding embodiment of FIG. 5, the CPU can further transmit the clock signal of the I2S bus to the interface conversion chip frame by frame through the I2S bus. Furthermore, the interface conversion chip processes the received data and converts it into data that can be transmitted by a digital audio transmission line; when the digital audio transmission line used is an S/PDIF transmission line, the processing performed by the interface conversion chip can be BMC modulation.

本方案提供的方法,使上述封装的过程在CPU中完成,且按照上述方法封装后得到的数据能够很方便地适用于通过I2S总线进行传输,从而接口转化芯片可只需进行较为简单的处理,即可得到可由数字音频传输线传输的数据,进而接口转换装置完成接口转化的功能。因此,本方法降低了对接口转化芯片计算能力的要求,从而可以使用成本较低的芯片(例如FPGA)作为本方案中的接口转换芯片,进而降低整个方案的成本。The method provided by this solution enables the above-mentioned encapsulation process to be completed in the CPU, and the data obtained after encapsulation according to the above-mentioned method can be easily adapted to be transmitted through the I2S bus, so that the interface conversion chip can only need to perform relatively simple processing, The data that can be transmitted by the digital audio transmission line can be obtained, and then the interface conversion device can complete the function of interface conversion. Therefore, the method reduces the requirement for the computing capability of the interface conversion chip, so that a lower-cost chip (eg, FPGA) can be used as the interface conversion chip in this solution, thereby reducing the cost of the entire solution.

本方案提供的实施例中的方法,可通过编写具有相应功能的计算机程序或计算机指令集合实现,本领域技术人员可根据本申请提供的描述实现上述计算机程序或计算机指令集合的开发。The methods in the embodiments provided by this solution can be implemented by writing computer programs or computer instruction sets with corresponding functions, and those skilled in the art can implement the development of the above computer programs or computer instruction sets according to the description provided in this application.

在如图5所示的实施例中,本方案应用的系统可以是包括智能大屏和音箱的系统,如图3A所示。此时,接口转换装置和CPU安装在智能大屏的内部。接口转换芯片和CPU还可以共同构成一个芯片模组,使得智能大屏整体上具备与外接的音频设备进行多声道音频传输的能力。在图5所示的实施例中,本方案应用的系统也可以是包括智能大屏、扩展坞和音箱的系统,如图3C所示。此时,扩展坞中安装有上述接口转换芯片或上述接口转换装置,为智能大屏和音箱之间的多声道音频传输提供接口转换的功能。应当明确,本方案应用的系统,还可以是如前所述的多种可选场景构成的系统,均不超出本方案的范围。In the embodiment shown in FIG. 5 , the system to which this solution is applied may be a system including a smart large screen and a speaker, as shown in FIG. 3A . At this time, the interface conversion device and the CPU are installed inside the smart screen. The interface conversion chip and the CPU can also form a chip module together, so that the smart large screen as a whole has the ability to perform multi-channel audio transmission with external audio equipment. In the embodiment shown in FIG. 5 , the system to which this solution is applied may also be a system including a large smart screen, a docking station and a speaker, as shown in FIG. 3C . At this time, the above-mentioned interface conversion chip or the above-mentioned interface conversion device is installed in the docking station, which provides the function of interface conversion for multi-channel audio transmission between the smart large screen and the speaker. It should be clear that the system to which this solution is applied may also be a system composed of a variety of optional scenarios as described above, which does not exceed the scope of this solution.

以上实施例以多声道音频即声道数大于等于三个的音频为例描述本方案的一种实施方法进行描述。但应当明确,本方案可以传输的音频数据不限于多声道的音频数据,还可以传输单声道、双声道音频数据。The above embodiments describe an implementation method of this solution by taking multi-channel audio, that is, audio with a number of channels greater than or equal to three, as an example. However, it should be clear that the audio data that can be transmitted in this solution is not limited to multi-channel audio data, and can also transmit monophonic and dual-channel audio data.

在本方案提供的一种实施例中,第一音频数据501可为双声道音频数据。此时,第一音频数据501可为原始的、未经过声道压缩编码的音频数据,即第一音频数据501的数据中可直接区分出两个声道的音频数据。根据前述对IEC60958标准的介绍可知,IEC60958标准通常可用于传输双声道音频数据,因此CPU对双声道音频数据进行封装的过程可以是根据IEC60958标准对上述未经压缩编码的双声道音频数据进行封装,得到若干个帧。进而CPU将经封装处理得到的若干帧逐个送入I2S总线进行传输,后续过程如前所述,在此不做赘述。In an embodiment provided by this solution, thefirst audio data 501 may be two-channel audio data. At this time, thefirst audio data 501 may be original audio data without channel compression encoding, that is, audio data of two channels can be directly distinguished from the data of thefirst audio data 501 . According to the aforementioned introduction to the IEC60958 standard, the IEC60958 standard can usually be used to transmit two-channel audio data, so the process of encapsulating the two-channel audio data by the CPU can be based on the IEC60958 standard. Encapsulate to obtain several frames. Further, the CPU sends several frames obtained by the encapsulation processing into the I2S bus one by one for transmission. The subsequent process is as described above, and will not be repeated here.

具体地,在本实施例的封装过程中,每次对未经压缩编码的双声道音频数据取样可得到一个左声道取样、一个右声道取样,可分别通过子帧A传送上述左声道取样、通过子帧B传送上述右声道取样。即,当音频数据为双声道音频数据时,此时CPU可省去先根据IEC61937标准对数据进行封装的过程,而直接对双声道音频数据进行根据IEC60958标准的封装。从而音频消费端设备也可省去根据IEC61937标准进行相应的解封装处理过程,只需对接收到的数据进行与CPU中封装过程相应的根据IEC60958标准的解封装。因此,这时CPU中封装的步骤、音频消费端设备中解封装的步骤可从两步简化为一步,便于CPU和音频消费端设备对音频的处理。Specifically, in the encapsulation process of this embodiment, one sample of the left channel and one sample of the right channel can be obtained each time the uncompressed and encoded binaural audio data is sampled, and the above-mentioned left channel can be transmitted through the subframe A respectively. channel samples, and the above-mentioned right channel samples are transmitted through subframe B. That is, when the audio data is two-channel audio data, the CPU can omit the process of first encapsulating the data according to the IEC61937 standard, and directly encapsulate the two-channel audio data according to the IEC60958 standard. Therefore, the audio consumer device can also omit the corresponding decapsulation process according to the IEC61937 standard, and only need to decapsulate the received data according to the IEC60958 standard corresponding to the encapsulation process in the CPU. Therefore, at this time, the encapsulation step in the CPU and the decapsulation step in the audio consumer device can be simplified from two steps to one step, which is convenient for the CPU and the audio consumer device to process audio.

类似地,当第一音频数据501为单声道音频数据时,也可参考上述双声道音频数据的封装方法,不进行根据IEC61937的封装而只进行根据IEC60958的封装。Similarly, when thefirst audio data 501 is monaural audio data, the above-mentioned encapsulation method for binaural audio data can also be referred to, and only encapsulation according to IEC60958 is performed without encapsulation according to IEC61937.

可选地,当第一音频数据501为单声道或双声道音频数据时,也可以按照上述当音频数据为多声道音频时的方法进行封装,即先根据IEC61937标准进行封装,再根据IEC60958标准进行封装。Optionally, when thefirst audio data 501 is monaural or dual-channel audio data, it can also be encapsulated according to the above-mentioned method when the audio data is multi-channel audio, that is, first encapsulate according to the IEC61937 standard, and then encapsulate according to the IEC61937 standard. IEC60958 standard for packaging.

应当明确,以上实施例对本方案对单声道、双声道、多声道音频可进行的封装方式的介绍,仅作为一种可行方法的举例而非用来限定。对单声道、双声道、多声道音频的封装方式,只要能使得封装后得到的第二音频数据502适用于通过I2S总线传输、音频消费端设备可根据封装处理过程进行相应的解封装处理即可,均不超出本方案的范围。It should be clear that the introduction of the encapsulation methods that can be performed on monophonic, dual-channel, and multi-channel audio in the present solution in the above embodiments is only an example of a feasible method, rather than a limitation. For the encapsulation methods of monophonic, dual-channel, and multi-channel audio, as long as thesecond audio data 502 obtained after encapsulation is suitable for transmission through the I2S bus, the audio consumer device can perform corresponding decapsulation according to the encapsulation process. It can be dealt with without going beyond the scope of this program.

应当明确,以上根据IEC60958标准和IEC61937标准进行封装的方法仅作为本方案提供的一种可行的方法,而非唯一的可行的方法。本领域技术人员可根据本方案提供的整体方案,应用其他标准或应用自定义方式实施封装过程,只要能使得封装后得到的第二音频数据502适用于通过I2S总线传输、音频消费端设备可根据封装处理过程进行相应的解封装处理即可,均不超出本方案的范围。It should be clear that the above encapsulation method according to the IEC60958 standard and the IEC61937 standard is only a feasible method provided by this solution, rather than the only feasible method. Those skilled in the art can implement the encapsulation process by applying other standards or applying custom methods according to the overall solution provided by this solution, as long as thesecond audio data 502 obtained after encapsulation is suitable for transmission through the I2S bus, and audio consumer devices can Corresponding decapsulation processing may be performed during the encapsulation process, which does not exceed the scope of this solution.

在本方案提供的一种实施例中提供一种接口转换装置,如图8所示,接口转换装置的各个功能可以由各个功能模块实现。接口转换装置可包含I2S总线接口模块、数据调制模块和数据传输通道接口模块。其中:In an embodiment provided by this solution, an interface conversion device is provided. As shown in FIG. 8 , each function of the interface conversion device can be implemented by each functional module. The interface conversion device may include an I2S bus interface module, a data modulation module and a data transmission channel interface module. in:

I2S总线接口模块用于接收来自I2S总线的数据,具体地,I2S总线接口模块可以根据I2S总线的帧时钟信号和位时钟信号的变化,从I2S总线的串行数据线逐帧接收数据。上述逐帧接收过程如前实施例所述,此处不再进行重复描述。The I2S bus interface module is used to receive data from the I2S bus. Specifically, the I2S bus interface module can receive data frame by frame from the serial data line of the I2S bus according to changes in the frame clock signal and the bit clock signal of the I2S bus. The foregoing frame-by-frame receiving process is as described in the previous embodiment, and the description is not repeated here.

数据调制模块用于调制从I2S总线接收到的数据,获得可由数字传输通道传输的数据。The data modulation module is used to modulate the data received from the I2S bus to obtain the data that can be transmitted by the digital transmission channel.

数据传输通道接口模块用于将上述可由数据传输通道传输的数据,送入数据传输通道进行传输。数据传输通道可以是有线和/或无线形式的传输通道,有线形式的数据传输通道可以包括但不限于S/PDIF传输线、HDMI传输线、HDMI-ARC传输线,无线形式的数据传输通道可以包括但不限于蓝牙、Wi-Fi。The data transmission channel interface module is used to send the above-mentioned data that can be transmitted by the data transmission channel into the data transmission channel for transmission. Data transmission channels can be wired and/or wireless transmission channels, wired data transmission channels can include but are not limited to S/PDIF transmission lines, HDMI transmission lines, HDMI-ARC transmission lines, and wireless data transmission channels can include but are not limited to Bluetooth, Wi-Fi.

图8中的上述功能模块的功能可以由具备相应功能的计算机程序或计算机指令集合实现,结合前述实施例的描述,本领域技术人员可编写出上述计算机程序或计算机指令集合。The functions of the above functional modules in FIG. 8 can be implemented by computer programs or computer instruction sets with corresponding functions. Those skilled in the art can write the above computer programs or computer instruction sets in combination with the description of the foregoing embodiments.

图8中的接口转换装置可具备如图2所示的架构。可选地,当上述接口转换装置中的接口转换芯片为FPGA时,可以减少设计和生产定制化接口转换芯片、省去采用较高计算性能的高价格芯片的开销,从而本方案可提供一种低成本的接口转化装置。The interface conversion device in FIG. 8 may have the structure shown in FIG. 2 . Optionally, when the interface conversion chip in the above interface conversion device is an FPGA, the design and production of customized interface conversion chips can be reduced, and the cost of using high-cost chips with higher computing performance can be saved, so that the solution can provide a Low cost interface conversion device.

在本方案提供的一种实施例中提供一种电子设备,该电子设备具备与外接音频设备之间进行单声道、双声道、多声道音频数据传输的能力,或者具备向外接音频设备传输单声道、双声道、多声道音频数据的能力。该电子设备包含上述CPU和接口转换装置,CPU和接口转换装置中的接口转换芯片可共同构成一个芯片模组。上述电子设备包括但不限于智能大屏、智能电视、电视、台式电脑、笔记本电脑、一体机、平板、手机等。In an embodiment provided by this solution, an electronic device is provided. The electronic device has the capability of performing single-channel, dual-channel, and multi-channel audio data transmission with an external audio device, or is capable of transmitting audio data to an external audio device. The ability to transmit mono, dual, and multi-channel audio data. The electronic device includes the above-mentioned CPU and an interface conversion device, and the CPU and the interface conversion chip in the interface conversion device can jointly form a chip module. The above-mentioned electronic devices include, but are not limited to, smart large screens, smart TVs, televisions, desktop computers, notebook computers, all-in-one computers, tablets, mobile phones, and the like.

在本方案提供的一种实施例中提供一种系统,该系统包含上述电子设备。In an embodiment provided by this solution, a system is provided, and the system includes the above electronic device.

在本方案提供的一种实施例中提供一种如图9所示方法,包含步骤901至906,各步骤在图9示出,在此不进行重复描述。可选地,本实施例的方法还可以包含步骤907(图9中未示出):音频设备通过数字音频传输通道接收第三音频数据。In an embodiment provided by this solution, a method as shown in FIG. 9 is provided, which includes steps 901 to 906 . Each step is shown in FIG. 9 and will not be described repeatedly here. Optionally, the method of this embodiment may further include step 907 (not shown in FIG. 9 ): the audio device receives third audio data through a digital audio transmission channel.

在本方案提供的一种实施例中提供一种系统,该系统可包含如上所述的任一实施例中的装置或者该系统可执行如上所述任一实施例中的方法。In an embodiment provided by this solution, a system is provided, and the system may include the apparatus in any of the above-mentioned embodiments or the system may execute the method in any of the above-mentioned embodiments.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使对应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it can still be used for the above-mentioned implementations. The technical solutions recorded in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in the within the scope of protection of this application.

最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that: the above are only the specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or replacements within the technical scope disclosed in the present application should be included in the present application. within the scope of protection of the application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

CN202011624764.XA2020-12-302020-12-30 Audio data processing system and electronic equipmentActiveCN114697817B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011624764.XACN114697817B (en)2020-12-302020-12-30 Audio data processing system and electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011624764.XACN114697817B (en)2020-12-302020-12-30 Audio data processing system and electronic equipment

Publications (2)

Publication NumberPublication Date
CN114697817Atrue CN114697817A (en)2022-07-01
CN114697817B CN114697817B (en)2023-06-02

Family

ID=82133669

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011624764.XAActiveCN114697817B (en)2020-12-302020-12-30 Audio data processing system and electronic equipment

Country Status (1)

CountryLink
CN (1)CN114697817B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116721678A (en)*2022-09-292023-09-08荣耀终端有限公司Audio data monitoring method, electronic equipment and medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5815583A (en)*1996-06-281998-09-29Intel CorporationAudio serial digital interconnect
US5999220A (en)*1997-04-071999-12-07Washino; KinyaMulti-format audio/video production system with frame-rate conversion
KR20060008152A (en)*2004-07-232006-01-26주식회사 한네트디지털 Router using XTDM Transmit and Receive Module
US20100158043A1 (en)*2008-11-282010-06-24Bodo Martin JMethod and apparatus for reformatting and retiming digital telecommunications data for reliable retransmission via USB
CN102736999A (en)*2011-03-282012-10-17雅马哈株式会社Audio data inputting apparatus and audio data outputting apparatus
US20170031862A1 (en)*2015-07-312017-02-02Seloco, Inc.Dual-bus semiconductor chip processor architecture
CN106911987A (en)*2017-02-212017-06-30珠海全志科技股份有限公司Main control end, equipment end, the method and system of transmission multichannel audb data
CN106936847A (en)*2017-04-112017-07-07深圳市米尔声学科技发展有限公司The processing method and processor of voice data
CN208707932U (en)*2018-08-242019-04-05北京猎户星空科技有限公司A kind of audio interface conversion circuit, audio collecting system and electronic equipment
CN110838298A (en)*2019-11-152020-02-25闻泰科技(无锡)有限公司Method, device and equipment for processing multi-channel audio data and storage medium
CN110837487A (en)*2019-09-242020-02-25福建星网智慧科技股份有限公司System and method for collecting and playing multichannel audio based on I2S bus
CN112136176A (en)*2018-05-232020-12-25索尼公司 Sending device, sending method, receiving device and receiving method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5815583A (en)*1996-06-281998-09-29Intel CorporationAudio serial digital interconnect
US5999220A (en)*1997-04-071999-12-07Washino; KinyaMulti-format audio/video production system with frame-rate conversion
KR20060008152A (en)*2004-07-232006-01-26주식회사 한네트디지털 Router using XTDM Transmit and Receive Module
US20100158043A1 (en)*2008-11-282010-06-24Bodo Martin JMethod and apparatus for reformatting and retiming digital telecommunications data for reliable retransmission via USB
CN102736999A (en)*2011-03-282012-10-17雅马哈株式会社Audio data inputting apparatus and audio data outputting apparatus
US20170031862A1 (en)*2015-07-312017-02-02Seloco, Inc.Dual-bus semiconductor chip processor architecture
CN106911987A (en)*2017-02-212017-06-30珠海全志科技股份有限公司Main control end, equipment end, the method and system of transmission multichannel audb data
CN106936847A (en)*2017-04-112017-07-07深圳市米尔声学科技发展有限公司The processing method and processor of voice data
CN112136176A (en)*2018-05-232020-12-25索尼公司 Sending device, sending method, receiving device and receiving method
CN208707932U (en)*2018-08-242019-04-05北京猎户星空科技有限公司A kind of audio interface conversion circuit, audio collecting system and electronic equipment
CN110837487A (en)*2019-09-242020-02-25福建星网智慧科技股份有限公司System and method for collecting and playing multichannel audio based on I2S bus
CN110838298A (en)*2019-11-152020-02-25闻泰科技(无锡)有限公司Method, device and equipment for processing multi-channel audio data and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
林嘉等: "基于I~2S接口的FPGA的音频数据传输", 《电气技术》*
王小稳: "多通道音频采集前端硬件设计", 《科技创新与应用》*
程炼等: "一种用DSP实现音频和视频信号处理的方法", 《应用科技》*

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116721678A (en)*2022-09-292023-09-08荣耀终端有限公司Audio data monitoring method, electronic equipment and medium
CN116721678B (en)*2022-09-292024-07-05荣耀终端有限公司Audio data monitoring method, electronic equipment and medium

Also Published As

Publication numberPublication date
CN114697817B (en)2023-06-02

Similar Documents

PublicationPublication DateTitle
CN111492648A (en)Audio device for HDMI
CN101178921B (en)Method and system for processing audio signal
US11514921B2 (en)Audio return channel data loopback
US11025406B2 (en)Audio return channel clock switching
WO2020182020A1 (en)Audio signal playback method and display device
JP6809470B2 (en) Transmitter, transmitter, receiver and receiver
CN114697817B (en) Audio data processing system and electronic equipment
US8514929B2 (en)Combined audio/video/USB device
TW510144B (en)Method and structure to output four-channel analog signal using two channel audio hardware
CN101521781A (en)Method for setting HDMI audio format
CN211509211U (en)Audio control device and audio playing system
CN111405356A (en) Audio control device, audio playback system and method
US8605564B2 (en)Audio mixing method and audio mixing apparatus capable of processing and/or mixing audio inputs individually
CN105812986A (en) Speaker and processing method for downmixing multi-channel into wireless two-channel
TWI887486B (en)Multimedia audio-video system and protocol converter therefor
CN114630065B (en)Audio conversion device and audio processing method for multimedia relay device
CN1953526B (en)Display device and video-audio playing system using same
JP2009033649A (en)Content data transmitting/receiving system, content data transmitting device, content data receiving device, content data transmission method, content data reception processing method
US11544032B2 (en)Audio connection and transmission device
CA2408802C (en)Generating separate analog audio programs from a digital link
CN221979087U (en) Audio data processing system and vehicle
CN113709630B (en) Audio and video processing device and audio and video processing method
KR100516733B1 (en)Dolby prologic audio apparatus
KR101046584B1 (en) Audio data processing device and control method thereof
KR100679429B1 (en) ILink high-definition multimedia interface

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp