Audio data transmission method, device and system
By using the pulse signals generated by BCLK and LRCLK in the I2S device to reset the word counter and delay sending the audio frame bits, the problem of strict channel delay time requirements in the I2S protocol is solved, and the compatibility and performance of the I2S device in high-speed application scenarios are improved. Circuit implementation flexibility.
Patent Information
- Application Number
- CN202310175498.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-27
AI Technical Summary
In the existing I2S protocol, the channel delay time of audio data transmission is strict, which limits the compatibility and complexity of I2S devices in high-speed application scenarios, resulting in increased circuit implementation complexity and limiting the use of high-speed application scenarios.
By using the bit clock BCLK generated by the master device and the characterizing channel information signal LRCLK in the slave device to generate the left and right channel pulse lr_pulse signals, the initial count value of the word counter is reset, and the count value is updated according to the BCLK cycle to delay the transmission of the audio frame. Bit by bit, data transmission is advanced or delayed to meet latency requirements.
It reduces the path delay time requirements of circuit layout and wiring, relaxes the delay time limit of I2S clock path, expands the compatibility of I2S devices in high-speed application scenarios, and reduces circuit implementation complexity.
Smart Images

Figure CN118550865A
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio circuit technology, and in particular to an audio data transmission method, device and system. Background Art
[0002] In the I2S (Inter-IC Sound) protocol, the master device must use the clock signal to build the I2S frame structure, and the slave device must use the clock signal provided by the master device to rebuild the I2S frame structure.
[0003] The I2S protocol requires that the serial data DATA (TX_DO) generated by the transmitting device TX changes on the falling edge of the bit clock BCLK, while the serial data (RX_DI) received by the receiving device RX from TX should be stable before the rising edge of BCLK and can be correctly collected on the rising edge.
[0004] In the existing ultra-large-scale circuit system, the serial data generated by I2S TX is sent to the port PAD of the integrated circuit IC through various combinations, and then externally connected to the port of other integrated circuits and input to the DI port of I2S RX. Therefore, the delay of these two parts is required to be less than 0.5 BCLK cycle T to ensure that the I2S RX device can correctly parse the corresponding data sent by I2S TX.
[0005] However, if I2S RX is the master device and I2S TX is the slave device, it means that the clock signal of I2S RX must increase the delay of the above two parts relative to the clock signal of I2S TX. Therefore, the layout and routing of the circuit implementation is particularly strict to ensure that the superimposed delay of all paths is less than half of the BCLK period, which will greatly increase the complexity of the circuit implementation.
[0006] In addition, the PAD-to-PAD connection between two ICs also has a delay time. Therefore, if the physical connection is required to fully meet the I2S protocol requirements, there must be many strict requirements for the connection within the IC and between ICs. This will limit the high-speed application scenarios of I2S. Either the sum of the delays of various paths must meet the requirements, or the I2S device cannot work in extremely high-speed scenarios. Therefore, a method is urgently needed to solve the problem of long path delay time and apply it in high-speed scenarios to increase the compatibility of application scenarios. Summary of the invention
[0007] The purpose of the present application is to provide an audio data transmission method, device and system, which are used to solve the problem that the sum of delays of various existing I2S paths must meet the requirements, which will greatly increase the complexity of circuit implementation and limit the high-speed application scenarios of I2S.
[0008] In a first aspect, an embodiment of the present application provides an audio data transmission method, which is applied to a slave device, and the method includes:
[0009] Based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information, a left and right channel pulse lr_pulse signal is generated for triggering the sending of the audio frame;
[0010] Reset the initial count value of the word counter by using the lr_pulse signal, wherein the initial count value corresponds to the bit order value of the kth bit in the bit order of the audio frame, where k is greater than 1;
[0011] According to the BCLK cycle, the current count value of the word counter is changed to the count value corresponding to the bit position sort value of the next bit in the sending sort;
[0012] When it is determined that the current count value of the word counter changes, the corresponding bit in the audio frame is sent according to the bit sorting value corresponding to the current count value.
[0013] In one or more possible embodiments, based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information, a left and right channel pulse lr_pulse signal for triggering the sending of an audio frame is generated, including:
[0014] Obtaining a BCLK generated by a master device and a signal LRCLK representing channel information, and delaying the BCLK and LRCLK generated by the master device by 0.5 BCLK in time;
[0015] Based on the time-delayed BCLK and LRCLK, the left and right channel pulse lr_pulse signals for triggering the sending of the audio frame are generated.
[0016] In one or more possible embodiments, the value of k is determined in the following manner:
[0017] Estimate the delay time t1 from the slave device generating data to the sending port, the delay time t2 from the master device port to the processing chip, the delay time t3 from the master device generating BCLK to the port, the delay time t4 from the slave device port to the processing chip, and the time t5 for data to be transmitted from the slave device port to the master device port;
[0018] The value of k is determined according to the value of (t1+t2+t3+t4) / T or the value of (t1+t2+t3+t4+t5) / T, where T is the period of BCLK.
[0019] In one or more possible embodiments, the BCLK generated by the master device and the signal LRCLK representing the channel information are delayed by 0.5 BCLK in time, including:
[0020] When it is determined that the rising edge of the acquired BCLK generated by the master device coincides with the falling edge of the BCLK used by the master device itself, the acquired BCLK generated by the master device and the signal LRCLK representing the channel information are delayed in time by 0.5 BCLK.
[0021] In one or more possible embodiments, an lr_pulse signal of a BCLK cycle is generated based on the changing edge of LRCLK; the initial count value of the word counter is reset at the falling edge of the lr_pulse signal; and data is sent when the falling edge of BCLK is captured within a BCLK cycle in which the count value of the word counter changes.
[0022] In one or more possible embodiments, resetting the initial count value of the word counter includes:
[0023] Determine the bit order for sending the audio frame in a bit order from high to low;
[0024] The initial count value of the word counter is reset to nk, where nk is the n-k+1th bit in the bit order in the audio frame.
[0025] In one or more possible embodiments, the initial count value of the word counter is reset to the bit order value corresponding to the second bit in the bit transmission order of the audio frame.
[0026] In a second aspect, an embodiment of the present application provides an audio data transmission device, including:
[0027] The signal trigger module uses the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information to generate the left and right channel pulse lr_pulse signals for triggering the sending of the audio frame;
[0028] A counter reset module, used to reset an initial count value of a word counter using the lr_pulse signal, wherein the initial count value corresponds to a bit order value of a kth bit in a bit order of an audio frame, where k is greater than 1;
[0029] A count value updating module, used for changing the current count value of the word counter to the count value corresponding to the bit position sorting value of the next bit in the sending sorting according to the BCLK cycle;
[0030] The data sending module is used to send the corresponding bit in the audio frame according to the bit sorting value corresponding to the current count value when determining the current count value of the word counter changes.
[0031] In the third aspect, another embodiment of the present application also provides an audio data transmission device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the audio data transmission method provided in the first aspect above.
[0032] In a fourth aspect, another embodiment of the present application further provides an audio data transmission system, including:
[0033] A master device, configured to generate a bit clock BCLK and a signal LRCLK representing channel information, and transmit the BCLK and LRCLK to a slave device, determine a BCLK cycle for sending an audio frame from the slave device based on the BCLK, and receive the audio frame sent by the slave device before a rising edge of the BCLK;
[0034] A slave device is used to generate a left and right channel pulse lr_pulse signal for triggering the sending of an audio frame based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information; using the lr_pulse signal, resetting the initial count value of the word counter, the initial count value corresponds to the bit ranking value of the kth bit in the bit sending sequence of the audio frame, and k is greater than 1; according to the BCLK cycle, changing the current count value of the word counter to the count value corresponding to the bit ranking value of the next bit in the sending sequence; when determining that the current count value of the word counter has changed, sending the corresponding bit in the audio frame according to the bit ranking value corresponding to the current count value.
[0035] In a fifth aspect, another embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to enable a computer to execute the audio data transmission method provided in the first aspect of the embodiment of the present application.
[0036] The embodiments of the present application greatly reduce the requirements of the circuit on the path delay time caused by layout and routing, and also greatly reduce the strict requirements of I2STX on the clock path delay time of I2SRX as the master in slave mode, which will completely offset the limitations of the I2STX device in high-speed application scenarios and increase the compatibility of its application scenarios.
[0037] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 It is a frame structure diagram of I2S in the related art;
[0040] Figure 2 Generate a timing diagram for serial data of I2STX in the related art;
[0041] Figure 3 A timing diagram for generating I2STX serial data using a reset signal in the related art;
[0042] Figure 4 A flow chart of the audio data transmission method provided in an embodiment of the present application;
[0043] Figure 5 This is a timing diagram of I2STX serial data generation using a reset signal in an embodiment of the present application;
[0044] Figure 6 This is a timing diagram of the embodiment of the present application where the I2STX serial data is advanced by 0.5BCLK;
[0045] Figure 7 A schematic diagram of the structure of an audio data transmission device provided in an embodiment of the present application;
[0046] Figure 8 A structural diagram of another audio data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method can be executed in the order of the method shown in the embodiment or drawings or in parallel during the actual processing process or when the control device is executed.
[0048] In the I2S protocol, the master device must use the bit clock BCLK and the signal LRCLK representing the channel information to build the I2S frame structure, and the slave device must use the BCLK and LRCLK provided by the master device to rebuild the I2S frame structure; then after the frame structure has been clarified, according to the configured frame type and length, TX sends serial data after obtaining parallel data from the system (such as tx fifo), and sends serial data in the order of high bits first and low bits later, as shown below: Figure 1 shown.
[0049] The I2S protocol requires that LRCLK changes at the falling edge of BCLK, the serial DATA (TX_DO) generated by TX changes at the falling edge of BCLK, and the serial DATA (RX_DI) received by RX from TX should be stable before the rising edge of BCLK and can be correctly collected at the rising edge. Therefore, taking the change of LRCLK from high level to low level at the falling edge of BCLK as an example, the relevant waveform relationship diagram of the correct timing is as follows: Figure 2 shown.
[0050] In the actual ultra-large-scale circuit system, the serial data generated by I2S TX is sent to the PAD of IC through various combinations, and then externally connected to the PAD of other ICs and input to the DI port of I2S RX. The transmission delay time from the falling edge of BCLK that generates data change to PAD of the master device is defined as t1, and the transmission delay time from the input PAD of the slave device to the DI of I2S RX is t2. Assuming that the cycle of BCLK is T, according to the I2S protocol, t1+t2<0.5*T must be satisfied to ensure that I2S RX can correctly parse the data sent by the corresponding I2S TX (serial data is generated at the falling edge of BCLK, and the data is captured at the rising edge of BCLK).
[0051] However, if I2S RX is the master device and I2S TX is the slave device, it means that the BCLK and LRCLK of I2S RX must be advanced by (t3+t4) relative to the BCLK and LRCLK of I2S TX. t3 refers to the delay time of the master device transmitting BCLK and LRCLK to the output PAD of the IC, and t4 refers to the delay time of the slave device transmitting BCLK and LRCLK from the input PAD to the processing chip. In this way, to ensure that the I2S protocol correctly implements data transmission, (t1+t2+t3+t4)<0.5*T must be satisfied. If I2S can support at least 32bits*2ch@192KHz working scenario, or 32bits*8ch@48KHz, then the maximum BCLK frequency requirement is not less than 12.288MHz, that is, (t1+t2+t3+t4)<0.5*81.4ns=40.7ns. In the current VLSI system, the sum of the two delay times t3+t4 from the master device outputting the clock signal to the PAD and then inputting it to the slave TX input interface, plus the sum of the two delay times t1+t2 from the slave TX data outputting to the PAD and then inputting it to the master RX input interface, is very likely to exceed 40.7ns. Requiring the circuit implementation to be particularly strict in layout and routing to ensure that the superimposed delay of all paths is less than half of the BCLK cycle will greatly increase the complexity of circuit implementation.
[0052] In addition, the PAD-to-PAD connection between two ICs also has a delay time. Therefore, if the physical connection is required to fully meet the I2S protocol requirements, there must be many strict requirements for the connection within the IC and between ICs, which will limit the high-speed application scenarios of I2S. Either the sum of the delays of various paths must meet the requirements, or the I2S device cannot work in extremely high-speed scenarios.
[0053] In view of the fact that the sum of delays of various I2S paths in the related art must meet the requirements, which will greatly increase the complexity of circuit implementation and limit the high-speed application scenarios of I2S, the present application proposes an audio data transmission method, device and system.
[0054] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0055] The audio data transmission method, device and system in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0056] According to an application scenario of an audio data transmission method according to an embodiment of the present application, a master device and a slave device are included. The master device is used to generate a bit clock BCLK and a signal LRCLK representing channel information. The master device transmits BCLK and LRCLK to the slave device; the slave device receives the BCLK and LRCLK transmitted by the master device, converts parallel data into serial data, and generates left and right channel pulse lr_pulse signals for triggering the sending of audio frames based on the bit clocks BCLK and LRCLK obtained from the master device. According to the I2S protocol content, LRCLK changes on the falling edge of BCLK, and the lr_pulse signal can be generated based on the changing edge of LRCLK to reset the word counter (8 bits) of I2STX. The above-mentioned changing edge can be a rising edge or a falling edge. If the changing edge is a falling edge, that is, LRCLK changes from a high level to a low level at the falling edge of BCLK to trigger a new audio frame cycle, then the lr_pulse signal is generated based on the falling edge of LRCLK. If the changing edge is a rising edge, that is, LRCLK changes from a low level to a high level at the falling edge of BCLK to trigger a new audio frame cycle, then the lr_pulse signal is generated based on the rising edge of LRCLK. The solution in the related art is to reset the word counter to the highest bit Bn-1 of the audio frame, and then the word counter is reduced by 1 at each rising edge of BCLK, namely Bn-2, Bn-3, Bn-4 to B0, and the corresponding data sent by TX is Dn-1, Dn-2, Dn-3 to D0. Taking the generation of the lr_pulse signal based on the falling edge of LRCLK as an example, the specific example is Figure 3 shown.
[0057] In order to solve the problem that the sum of the delays of various paths of the existing I2S must meet the requirements, which will greatly increase the complexity of circuit implementation and limit the high-speed application scenarios of I2S, the embodiment of the present application provides an audio data transmission method, such as Figure 4 As shown, including:
[0058] Step 401, based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information, a left and right channel pulse lr_pulse signal for triggering the sending of the audio frame is generated;
[0059] The left and right channel pulse lr_pulse signals used to trigger the sending of the audio frame are generated at least once in each audio frame period. The audio frame period includes multiple BCLK periods. The left channel data can be sent in the first half of the audio frame period and the right channel data can be sent in the second half of the audio frame period. Alternatively, the right channel data can be sent in the first half of the audio frame period and the left channel data can be sent in the second half of the audio frame period.
[0060] One audio frame period may include one or more channels. When multiple channels are included, data of the multiple channels are transmitted serially. The number of BCLKs required for one audio frame period is determined based on the number of BCLK cycles required for each channel.
[0061] Step 402: Reset the initial count value of the word counter by using the lr_pulse signal, wherein the initial count value corresponds to the bit order value of the kth bit in the bit order of the audio frame, where k is an integer greater than 1.
[0062] The count value of the word counter corresponds to the bit order value in the audio frame. The bit order value minus 1 can be used as the word count value. The count value range of the word counter is 0 to n-1, where n is the total number of bits in the audio frame. The count value of the word counter is the same as the bit order value in the audio frame minus 1 sent in the current cycle. The count value of the word counter changes by one value every BCLK cycle. It can change in a decreasing manner of minus 1 or an increasing manner of plus 1. It returns to the highest value when it decreases to 0, and returns to 0 when it increases to the highest value.
[0063] Step 403, according to the BCLK cycle, changing the current count value of the word counter to the count value corresponding to the bit position ranking value of the next bit in the transmission ranking;
[0064] That is, every other BCLK cycle, the count value of the word counter corresponds to the bit order value of the next bit in the transmission order, and is decremented or incremented according to the bit order value corresponding to the transmission order. If the data is sent in the order of the bit order value from high to low, the current count value of the word counter is reduced by 1 for each BCLK cycle. If the data is sent in the order of the bit order value from low to high, the current count value of the word counter is increased by 1 for each BCLK cycle.
[0065] Step 404: When it is determined that the current count value of the word counter changes, the corresponding bit in the audio frame is sent according to the bit sorting value corresponding to the current count value.
[0066] Since the embodiment of the present application utilizes the lr_pulse signal to reset the initial count value of the word counter to the value corresponding to the bit order value of the kth bit in the audio frame in the bit order of the audio frame, in this way, in the new audio frame period, data will be sent k-1 BCLK cycles in advance, and the I2S RX receiving the TX data as the master device uses the data from TX according to the original timing. Then the sum of all delay times required by the original timing is no more than half of the BCLK cycle (because the original timing has only a margin of half a BCLK cycle) and is extended to the sum of all delay times no more than (k-1)*5 times of the BCLK cycle (because a margin of k-1 BCLK cycles is added on the basis of the original timing). In this way, the circuit has great flexibility in the layout and wiring requirements in the specific implementation, and has greatly relaxed the stringent requirements on the corresponding signal transmission delay of the connected device, thereby enhancing the compatibility of its actual application scenarios.
[0067] In the embodiment of the present application, the value range of k-1 will not be too large, because if such a large delay tolerance is required, it means that the system in which the circuit is located cannot operate at an extremely high frequency speed, and the operating speed of the equipment must be reduced, that is, the BCLK cycle will increase accordingly, and the number of BCLK cycles that require redundancy will decrease accordingly. In the embodiment of the present application, k-1 is not greater than N / 2, N is the number of bits for each word corresponding to the word counter, where the number of bits of the word counter is determined according to the total number of BCLK cycles required for the audio frame.
[0068] As an optional implementation, the initial count value of the word counter is reset to the value of the bit position ranking value of the second bit in the audio frame in the bit position transmission ranking of the audio frame minus 1. In this way, the sum of all delay times required by the original timing is no more than half of the BCLK cycle (because the original timing has only a margin of half a BCLK cycle) and is extended to the sum of all delay times no more than 1.5 times of the BCLK cycle.
[0069] As an optional implementation, an lr_pulse signal of a BCLK cycle is generated based on the changing edge of LRCLK, and the changing edge can be a rising edge or a falling edge, and the rising edge of the lr_pulse signal is aligned with the rising edge of BCLK; the initial count value of the word counter is reset at the falling edge of the lr_pulse signal; within a BCLK cycle when the count value of the word counter changes, data is sent when the falling edge of BCLK is captured, so as to ensure that the master device captures the audio frame sent by the slave device at the rising edge.
[0070] As an optional implementation, resetting the initial count value of the word counter includes:
[0071] Determine the bit order for sending the audio frame in a bit order from high to low;
[0072] The initial count value of the word counter is reset to nk, where nk is the n-k+1th bit in the bit order in the audio frame.
[0073] In this embodiment, when k is 2, the initial count value of the word counter is reset to n-2, expressed as Bn-2, and the corresponding BCLK cycle sends Dn-2, where Dn-1 is the most significant bit.
[0074] There are 8 channels preset, each channel requires 32 BCLK cycles, a total of 256 BCLK cycles are required, and the word of the word counter is 8 bits. The audio data transmission process of an embodiment of the present application is given as an example below.
[0075] In the case where the lr_pulse generation mechanism remains unchanged, the embodiment of the present application makes the reset value of the 8-bit word counter of I2STX configurable by the lr_pulse signal, for example Figure 5 As shown, based on the falling edge of LRCLK, a lr_pulse signal of a BCLK cycle is generated; at the falling edge of the lr_pulse signal, the initial count value of the word counter is reset to Bn-2; after each BCLK cycle, the count value changes in a decreasing manner until the next reset, and within a BCLK cycle when the count value of the word counter changes, the falling edge of BCLK is captured and the data is sent. The traditional word-based highest bit Bn-1 is modified to the word-based second highest bit Bn-2, which will change the data sent by TX to Figure 3 One BCLK cycle earlier. The I2S RX that receives TX data as the master device uses the data from TX according to the timing of the previous figure. Therefore, the sum of all delay times required by the original timing is no more than half of the BCLK cycle (because the original timing only has a margin of half a BCLK cycle) and is extended to the sum of all delay times no more than 1.5 times the BCLK cycle (because a margin of one BCLK cycle is added on the basis of the original timing).
[0076] As an optional implementation, the value of k is determined in the following manner:
[0077] Estimate the delay time t1 from the slave device generating data to the sending port, the delay time t2 from the master device port to the processing chip, the delay time t3 from the master device generating BCLK to the port, the delay time t4 from the slave device port to the processing chip, and the time t5 for data to be transmitted from the slave device port to the master device port; determine the value of k based on the value of (t1+t2+t3+t4) / T or (t1+t2+t3+t4+t5) / T, where T is the period of BCLK. In this way, it can be ensured that the audio frame data sent by TX can be correctly collected before the rising edge of BCLK arrives and at the rising edge.
[0078] In addition, when the I2S RX device as the master device receives the serial data generated by the I2S TX device as the slave device, it is possible that the BCLK valid edge used by the I2S RX will coincide with the serial time change edge input from the TX. In this case, it is not safe to directly use the BCLK rising edge to capture the serial data. The serial data change edge must be staggered with the BCLK rising edge of the master device.
[0079] In a possible implementation, based on the bit clock BCLK generated by the master device, generating left and right channel pulse lr_pulse signals for triggering the sending of an audio frame includes:
[0080] Obtaining the BCLK generated by the master device, and delaying the BCLK generated by the master device by 0.5 BCLK in time;
[0081] Based on the time-delayed BCLK and the signal LRCLK representing the channel information, a left and right channel pulse lr_pulse signal for triggering the sending of an audio frame is generated.
[0082] The embodiment of the present application can make the I2S TX as a slave device send serial data with a delay of 0.5 BCLK, that is, the I2S TX needs to receive the BCLK and LRCLK sent by the master and perform 0.5BCLK processing, specifically, the BCLK is reversely processed to generate BCLK1 to replace the BCLK sent by the master, and the LRCLK uses the signal LRCLK1 generated after the BCLK valid edge is captured to replace the LRCLK sent by the master. Figure 6 Because the two input signals BCLK and LRCLK of I2STX are relatively delayed by 0.5 BCLK, and the TX_DO terminal is relatively advanced by k-1 BCLK according to the above implementation, the final overall effect is that the serial data is relatively advanced by (k-1-0.5)*BCLK.
[0083] Specifically, when it is determined that the rising edge of the acquired BCLK generated by the master device coincides with the falling edge of the BCLK used by the master device itself, the acquired BCLK generated by the master device is delayed in time by 0.5 BCLK.
[0084] Based on the same inventive concept, the present application also provides an audio data transmission device, such as Figure 7 As shown, the device comprises:
[0085] The signal trigger module 701 generates a left and right channel pulse lr_pulse signal for triggering the sending of an audio frame using a bit clock BCLK generated by a master device and a signal LRCLK representing channel information;
[0086] A counter reset module 702, configured to use the lr_pulse signal to reset an initial count value of a word counter, wherein the initial count value corresponds to a bit order value of a kth bit in a bit order of an audio frame, where k is greater than 1;
[0087] The count value updating module 703 is used to change the current count value of the word counter to the count value corresponding to the bit position sorting value of the next bit in the sending sorting according to the BCLK cycle;
[0088] The data sending module 704 is used to send the corresponding bit in the audio frame according to the bit sorting value corresponding to the current count value when determining that the current count value of the word counter changes.
[0089] As a possible implementation, the signal trigger module uses the bit clock BCLK generated by the master device to generate left and right channel pulse lr_pulse signals for triggering the sending of the audio frame, including:
[0090] Obtaining a BCLK generated by a master device and a signal LRCLK representing channel information, and delaying the BCLK and LRCLK generated by the master device by 0.5 BCLK in time;
[0091] Based on the time-delayed BCLK and the channel signal LRCLK, left and right channel pulse lr_pulse signals for triggering the sending of audio frames are generated.
[0092] As a possible implementation manner, the counter reset module determines the value of k in the following manner:
[0093] Estimate the delay time t1 from the slave device generating data to the sending port, the delay time t2 from the master device port to the processing chip, the delay time t3 from the master device generating BCLK to the port, the delay time t4 from the slave device port to the processing chip, and the time t5 for data to be transmitted from the slave device port to the master device port;
[0094] The value of k is determined according to the value of (t1+t2+t3+t4) / T or the value of (t1+t2+t3+t4+t5) / T, where T is the period of BCLK.
[0095] As a possible implementation manner, the signal trigger module delays the BCLK and LRCLK generated by the master device by 0.5 BCLK in time, including:
[0096] When it is determined that the rising edge of the acquired BCLK generated by the master device coincides with the falling edge of the BCLK used by the master device itself, the acquired BCLK and LRCLK generated by the master device are delayed in time by 0.5 BCLK.
[0097] As a possible implementation, the signal trigger module is used to generate an lr_pulse signal of a BCLK cycle based on the changing edge of LRCLK; the counter reset module is used to reset the initial count value of the word counter at the falling edge of the lr_pulse signal; and the data sending module is used to send data when the falling edge of BCLK is captured within a BCLK cycle when the count value of the word counter changes.
[0098] As a possible implementation mode, the counter resetting module resets the initial count value of the word counter, including:
[0099] Determine the bit order for sending the audio frame in a bit order from high to low;
[0100] The initial count value of the word counter is reset to nk, where nk is the n-k+1th bit in the bit order in the audio frame.
[0101] As a possible implementation manner, the counter resetting module resets the initial count value of the word counter to the bit order value corresponding to the second bit in the bit transmission order of the audio frame.
[0102] Based on the same inventive concept, the embodiment of the present application provides an audio data transmission device, such as Figure 8 As shown, it includes at least one processor 802 and at least one memory 801. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps in the audio data transmission method according to various exemplary embodiments of the present application described above in this specification. For example, the processor can execute the steps in the search method for monitoring nodes.
[0103] The audio data transmission device is in the form of a general electronic device, and the memory may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory, and may further include a read-only memory (ROM).
[0104] The memory may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0105] In some possible implementations, various aspects of an audio data transmission method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of an audio data transmission method according to various exemplary implementations of the present application described above in this specification.
[0106] The present application also provides an audio data transmission system, including:
[0107] A master device, configured to generate a bit clock BCLK and a signal LRCLK representing channel information, and transmit the BCLK and LRCLK to a slave device, determine a BCLK cycle for sending an audio frame from the slave device based on the BCLK and LRCLK, and receive the audio frame sent by the slave device before a rising edge of the BCLK;
[0108] A slave device is used to generate a left and right channel pulse lr_pulse signal for triggering the sending of an audio frame based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information; using the lr_pulse signal, resetting the initial count value of the word counter, the initial count value corresponds to the bit ranking value of the kth bit in the bit sending sequence of the audio frame, and k is greater than 1; according to the BCLK cycle, changing the current count value of the word counter to the count value corresponding to the bit ranking value of the next bit in the sending sequence; when determining that the current count value of the word counter has changed, sending the corresponding bit in the audio frame according to the bit ranking value corresponding to the current count value.
[0109] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0110] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for transmitting audio data, the method being applied to a slave device, characterized in that: The method comprises: Based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information, it generates the left and right channel pulse lr_pulse signals for triggering the transmission of the audio frame; Resetting an initial count value of a word counter using the lr_pulse signal, wherein the initial count value corresponds to a bit order value of a k-th bit in a bit order of transmission of an audio frame, where k is greater than 1; According to the BCLK cycle, the current count value of the word counter is changed to the count value corresponding to the bit order value of the next bit in the transmission order; When it is determined that the current count value of the word counter changes, the corresponding bit in the audio frame is sent according to the bit sorting value corresponding to the current count value.
2. The method according to claim 1, characterized in that Based on the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information, the left and right channel pulse lr_pulse signals for triggering the transmission of the audio frame are generated, including: Obtaining a BCLK generated by a master device and a signal LRCLK representing channel information, and delaying the BCLK and LRCLK generated by the master device by 0.5 BCLK in time; Based on the time-delayed BCLK and LRCLK, the left and right channel pulse lr_pulse signals are generated to trigger the sending of the audio frame.
3. The method according to claim 1 or 2, characterized in that The value of k is determined as follows: Estimate the delay time t1 from the slave device generating data to the sending port, the delay time t2 from the master device's port to the processing chip, the delay time t3 from the master device generating BCLK to the port, the delay time t4 from the BCLK from the slave device's port to the processing chip, and the time t5 for data to be transmitted from the slave device's port to the master device's port; The value of k is determined according to the value of (t1+t2+t3+t4) / T or the value of (t1+t2+t3+t4+t5) / T, where T is the period of BCLK.
4. The method according to claim 3, characterized in that Delaying the BCLK and LRCLK generated by the master device by 0.5 BCLK in time includes: When it is determined that the rising edge of the acquired BCLK generated by the master device coincides with the falling edge of the BCLK used by the master device itself, the acquired BCLK and LRCLK generated by the master device are delayed in time by 0.5 BCLK.
5. The method according to claim 1, characterized in that Generate a BCLK cycle of lr_pulse signal based on the change edge of LRCLK; Reset the initial count value of the word counter at the falling edge of the lr_pulse signal; In a BCLK cycle in which the count value of the word counter changes, data is sent when a falling edge of BCLK is captured.
6. The method according to claim 1 or 2, characterized in that Reset the initial count value of the word counter, including: Determine the bit order for sending the audio frame in descending order of bit order; The initial count value of the word counter is reset to nk, where nk is the n-k+1th bit in the bit order in the audio frame.
7. The method according to claim 1 or 2, characterized in that The initial count value of the word counter is reset to the bit order value corresponding to the second bit in the bit transmission order of the audio frame.
8. An audio data transmission device, characterized in that: include: The signal trigger module uses the bit clock BCLK generated by the master device and the signal LRCLK representing the channel information to generate the left and right channel pulse lr_pulse signals for triggering the transmission of the audio frame; a counter reset module, configured to reset an initial count value of a word counter using the lr_pulse signal, wherein the initial count value corresponds to a bit order value of the kth bit in the bit order of the audio frame, where k is greater than 1; A count value updating module, configured to change the current count value of the word counter to the count value corresponding to the bit order value of the next bit in the sending order according to the BCLK cycle; The data sending module is used to send the corresponding bit in the audio frame according to the bit sorting value corresponding to the current count value when determining the change of the current count value of the word counter.
9. An audio data transmission device, characterized in that: The invention comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1 to 7.
10. An audio data transmission system, characterized in that: include: The master device is configured to generate a bit clock BCLK and a signal LRCLK representing channel information, transmit the BCLK and LRCLK to the slave device, determine a BCLK period for transmitting an audio frame from the slave device based on the BCLK and LRCLK, and receive the audio frame transmitted from the slave device before a rising edge of the BCLK; The slave device is used to generate left and right channel pulse lr_pulse signals for triggering audio frame transmission based on the bit clock BCLK generated by the master device and the signal LRCLK representing channel information; Resetting an initial count value of a word counter using the lr_pulse signal, the initial count value corresponding to the bit ranking value of the kth bit in the bit transmission sequence of the audio frame, where k is greater than 1; and changing a current count value of the word counter to a count value corresponding to the bit ranking value of the next bit in the transmission sequence according to a BCLK cycle; When it is determined that the current count value of the word counter changes, the corresponding bit in the audio frame is sent according to the bit sorting value corresponding to the current count value.
