Audio Route
The purpose of this document is to describe how to use the Audio Route module in the MCUConfig Tool. The Audio Route capability of each IC can be demonstrated using the MCUConfig Tool. Customers can configure the routing relationship of each audio stream by using the MCUConfig Tool.
The following topics are included to help users to use the Audio Route module.
Audio Route Concepts
Audio Route Configurations
Audio Route Concepts
Audio Route indicates the static configuration of the physical data path. The Audio Route module consists of SPORT configuration, Endpoint configuration, and Logical IO configuration. The Audio Route module is classified according to the Audio Category.
The figure shows a simplified Audio Route path between the Codec and DSP.
As shown in the figure, the data collected by the microphone passes through an ADC channel of the Codec and flows to a SPORT RX channel to reach the DSP. After the data is processed by the DSP, it passes through a SPORT TX channel and then through the DAC channel of the Codec, finally playing out through the specific speaker.
The main function of the Audio Route module is to configure SPORT and Logical IO related parameters for an Audio Route path. The SPORT controls the inflow and outflow of multiple stream routing paths. These stream routing paths should have the same configurations, including sample rate, data length, channel length, and channel mode. The Logical IO defines the functional attributes of the stream routing path.
Audio Category
Audio Category is used to classify all streams transferred between the Host and the Controller. The Controller is isolated from the Physical Peripheral and requires Logical IO to obtain the stream routing context. The Host represents a physical component that is MCU or DSP. The streams have the same control flows, usage scenarios, and functionalities.
The table shows the types of Audio Category.
Category |
Description |
---|---|
AUDIO |
Audio playback |
VOICE |
Voice communication |
RECORD |
Record or capture |
LINE |
Analog or digital line-level loopback |
RINGTONE |
Ringtone |
VP |
Voice prompt |
APT |
Ambient pass-through |
LLAPT |
Low-latency ambient pass-through |
ANC |
Active Noise Cancellation |
VAD |
Voice activity detection |
KWS |
Keyword spotting |
PIPE |
Coder conversion pipe |
Endpoint
Endpoint consists of SPK, MIC and AUX physical entity input and output.
Logical IO
Logical IO refers to the logical input and output functions provided by the DSP. It encompasses Primary SPK, Secondary SPK, Primary MIC, Secondary MIC, Fusion MIC, Bone MIC, External MIC, Internal MIC, Primary AUX, Secondary AUX, Primary Reference MIC, Secondary Reference MIC, Primary Reference SPK, and Secondary Reference SPK. Logical IO is classified according to the Audio Category.
The figure shows types of Logical_IO.
Audio Route Path
An audio path is constructed from one or more Audio Route paths.
The figure shows the components of an Audio Route path.
The figure illustrates that an Audio Route path comprises several components, namely Logical IO type, Endpoint type, SPK and MIC parameters, SPORT index, and SPORT channel. The SPK parameter encompasses SPK type, SPK gain, and DAC channel. On the other hand, the MIC parameter consists of MIC index, MIC type, MIC gain, and ADC channel.
The table shows the parameter description of Audio Route path.
Parameter Name |
Parameter List |
---|---|
SPK ID |
Speaker1/2. |
SPK Type |
Single-End/Differential. |
DAC Channel |
DAC0/1/2/3. |
MIC ID |
AMIC1/2/3, DMIC1/2. |
MIC Type |
Single-End/Differential/Falling Edge/Rising Edge. |
ADC Channel |
ADC0/1/2/3. |
SPORT ID |
SPORT0/1/2/3. |
SPORT Channel |
TX Channel0/1/2/3, RX Channel0/1/2/3. |
Audio Route Configurations
The Audio Route module is mainly used to configure related parameters of SPORT and Logical IO parameters of the physical data path. The main configurable functions are as follows:
Configure ADC Gain for the device MIC.
Configure the SPORT hardware parameters.
Configure the Codec Mixing function.
Configure Logical IO parameters for the audio stream.
ADC Gain
ADC Gain is mainly used to configure the analog boost gain of the selected physical MIC or AUX.
The figure shows that Voice Primary MIC selects AMIC1.
The figure shows how to configure ADC Gain.
If the Voice Primary MIC is configured under the Voice Category and AMIC1 is selected, the ADC Gain value of AMIC1 needs to be configured.
When clicking the ‘Set ADC Gain’ button, a configuration box for ADC Gain will appear. From there, the Analog Boost Gain can be selected by using the drop-down box provided for AMIC1. It’s important to note that the analog boost gain for the physical MIC or AUX can be set to values of 0, 3, 6, 9, 12, 18, 24, or 30dB.
Note
MIC ADC Gain can be adjusted using the Set ADC Gain button only if AMIC is selected.
AUX ADC Gain can be adjusted by setting the Set ADC Gain button only when AUX is selected.
DMIC Gain cannot be adjusted by the Set ADC Gain button.
Configure ADC Gain for the AMIC index as required.
SPORT
The current SPORT hardware parameters are all configured by default. Unless there are specific requirements, there is no need to modify these settings. In the event that customers need to configure the SPORT parameters, it is recommended to involve a developer who can handle the configuration process and provide the necessary parameters to the customers. Please note that the default configuration for SPORT may differ depending on the specific IC being used.
The figure shows how to configure SPORT parameters.
Here is a description of the configuration parameters:
SPORT 0/1/2/3: Enable the corresponding index’s SPORT by selecting this option.
Role: Configure the role of the SPORT. The options are ‘master’ or ‘slave’.
RX/TX Bridge: Configure the SPORT to support single-direction TX and RX configurations. The options are ‘internal’ or ‘external’. If ‘external’ is selected, the corresponding pinmux can be configured in the HW Feature tab.
RX/TX Mode: Configure the transfer mode in the RX and TX directions. The options are TDM2/4/6/8.
RX/TX Format: Configure the format of the SPORT data in the RX and TX directions. The options are I2S/Left Justified/PCM_A/PCM_B.
RX/TX Data Length: Configure the data length in the RX and TX directions of the SPORT. The options are 8/16/20/24/32 bits.
RX/TX Channel Length: Configure the length of the channel in the RX and TX directions. The options are 16/20/24/32 bits.
RX/TX Sample Rate: Configure the sampling rate in the RX and TX directions of the SPORT. The options are 8/16/32/44.1/48/88.2/96/192/12/24/11.025/22.05 KHz.
External Device
The following two figures show how to configure external bridge.
To configure an external device, use the TX and RX drop-down boxes in the SPORT Bridge field to
specify the external device’s configuration in one direction. For instance, let’s say RX and TX need
to be configured in the Bridge field of SPORT0 as ‘External’. In this case, the corresponding
pinmux of SPORT0_LRC
, SPORT0_BCLK
, SPORT0_DACDAT
, and SPORT0_ADCDAT
will also need to be
configured in the HW Feature tab.
Note
When the Role field is set to Master, the Bridge field RX/TX allows users to freely select External/Internal. When Role is set to ‘Slave’, the RX/TX of the Bridge field can only be changed to the fixed value ‘External’.
RTL87x3E&RTL87x3EP: For SPORT0/SPORT1, you can configure the Bridge field based on the Role field. For SPORT2, the Rx/Tx of its Bridge field is a fixed value ‘External’, regardless of its Role.
RTL87x3D: For SPORT0/SPORT1/SPORT2, you can configure the Bridge field based on the Role field. For SPORT3, the Rx/Tx of its Bridge field is the fixed value ‘External’, regardless of its Role value.
SPORT Mode
SPORT Mode is configured by default. If you need to configure the Mode fields of TX and RX in SPORTs, the optional value is TDM2/4/6/8.
Note
RTL87x3E&RTL87x3EP: RX default TDM4, TX default TDM2.
RTL87x3D: RX default TDM6, TX default TDM2.
SPORT Data Length
The figure shows how to configure SPORT Data Length.
The SPORT Data Length is typically configured by default. However, if there is a special requirement, you may need to configure the Data Length fields for both the TX and RX in the SPORTs. Specifically, for RTL87x3E, RTL87x3EP, and RTL87x3D, it is recommended to set the Data Length to 24BIT.
SPORT Channel Length
By default, the SPORT Channel Length is configured automatically. However, if there is a special requirement, you may need to manually configure the Channel Length fields for both TX and RX in the SPORTs.
Note
For RTL87x3E, RTL87x3EP and RTL87x3D, it is recommended to set the Channel Length to 32BIT.
SPORT Sample Rate
The figure shows how to configure SPORT Sample Rate.
The default configuration sets the SPORT Sample Rate automatically. However, if there are specific requirements, it may be necessary to manually configure the TX and RX Sample Rate fields in the SPORTs. In the configuration, ‘Dynamic’ indicates that the physical data flow uses its own sample rate, which can vary. On the other hand, other fields indicate that the physical data flow uses a fixed sample rate.
Codec Mixing Function
Codec provides two mix data nodes, which can ignore the influence of sample rate and simultaneously play mixed data of two or three channels.
The figure shows a sample of Codec Mixing function.
In the depicted scenario shown in the figure, where Audio or Voice and Voice Prompt are mixed and played on DAC0, the UI configuration allows configuring Codec Mixing. With Codec Mixing, selection of the mix path for DAC0 and DAC1 can be done according to requirements. Please note that the default configuration of the Codec Mixing field is already set, but there is the flexibility to modify it based on specific needs.
The figure shows how to configure Codec Mixing.
If there are special requirements, the following checkboxes can be configured:
If the ‘Point1’ checkbox is checked in ‘DAC0 mix point’, data from DAC_R can be mixed to DAC_L. In this scenario, DAC_L corresponds to DAC0, and DAC_R corresponds to DAC1.
If the ‘Point2’ checkbox is checked in ‘DAC1 mix point’, data from DAC_L can be mixed to DAC_R. In this case, DAC_R corresponds to DAC1.
Audio Logical Device
The Audio Logical Device supports the configuration of Logic IO parameters for data streams such as Audio, Voice, Record, Line, Ringtone, Voice Prompt, APT, LLAPT, ANC and VAD.
Audio Category
The figure shows how to configure Audio Route path for Audio Category.
The Audio Category supports the following Logical IO parameters:
Audio Primary SPK is used to set the Audio physical path of the Primary SPK.
Audio Secondary SPK is used to set the Audio physical path of the Secondary SPK.
Audio Primary Reference SPK is used to set the Audio physical AEC loopback path of the Primary SPK.
Audio Secondary Reference SPK is used to set the Audio physical AEC loopback path of the Secondary SPK.
Note
Audio Primary SPK must at least be selected and configured correctly.
Both Audio Primary SPK and Audio Secondary SPK need to be selected and configured at the same time to achieve the stereo effect.
When the Record Primary Reference MIC and Record Secondary Reference MIC corresponding to the Record Category are also configured, the AEC loopback path of Audio and Record can be really connected. AEC means the linear removal of echo signal mixing in microphone input without affecting the quality of the desired speech signal.
Voice Category
The figure shows how to configure the Audio Route path for the Voice Category.
The Voice Category supports the following Logical IO parameters:
Voice Primary SPK is used to set the Voice physical path of the Primary SPK.
Voice Secondary SPK is used to set the Voice physical path of the Secondary SPK.
Voice Primary Reference SPK is used to set the Voice physical AEC loopback path of the Primary SPK.
Voice Secondary Reference SPK is used to set the Voice physical AEC loopback path of the Secondary SPK.
Voice Primary Reference MIC is used to set the Voice physical AEC loopback path of the Primary MIC.
Voice Secondary Reference MIC is used to set the Voice physical AEC loopback path of the Secondary MIC.
Voice Primary MIC is used to set the Voice physical path for the Primary MIC.
Voice Secondary MIC is used to set the Voice physical path of the Secondary MIC.
Voice Fusion MIC is used to set the Voice physical path for Fusion MIC.
Voice Bone MIC is used to set the Voice physical path for the Bone Sensor MIC.
Note
Voice Primary SPK and Voice Primary MIC must at least be selected and configured correctly.
The Voice Secondary MIC can be configured only after Enable Voice Dual Mic is selected in the HW Feature tab.
When the Voice Primary Reference SPK and Voice Primary Reference MIC corresponding to the Voice Category, or when the Voice Secondary Reference SPK and Voice Secondary Reference MIC are configured, the AEC loopback path is actually connected.
Record Category
The figure shows how to configure the Audio Route path for the Record Category.
The Record Category supports the following Logical IO parameters:
Record Primary MIC is used to set the Record physical path of the Primary MIC.
Record Secondary MIC is used to set the Record physical path of the Secondary MIC.
Record Primary Reference MIC is used to set the Record physical AEC loopback path of the Primary MIC.
Record Secondary Reference MIC is used to set the Record physical AEC loopback path of the Secondary MIC.
Record Left AUX is used to set the Record physical path for the AUX Left channel.
Record Right AUX is used to set the physical path of the Record AUX Right channel.
Record Fusion MIC is used to set the Record physical path of Fusion MIC.
Record Bone MIC is used to set the Record physical path of the Bone Sensor MIC.
Note
Record Primary MIC or Record Left AUX must be selected and configured correctly.
When the Primary Reference SPK and Secondary Reference SPK corresponding to Audio Category, Ringtone Category, or Voice Prompt Category are configured, the AEC loopback path for Audio and Record, Ringtone and Record, or Voice Prompt and Record is open.
Line Category
The figure shows how to configure the Audio Route path for the Line Category.
The Line Category supports the following Logical IO parameters:
Line Primary SPK is used to set the Line physical path of the Primary SPK.
Line Secondary SPK is used to set the Line physical path of the Secondary SPK.
Line Primary Reference SPK is used to set the Line physical AEC loopback path of the Primary SPK.
Line Secondary Reference SPK is used to set the Line physical AEC loopback path of the Secondary SPK.
Line Primary Reference MIC is used to set the Line physical AEC loopback path of the Primary MIC.
Line Secondary Reference MIC is used to set the Line physical AEC loopback path of the Secondary MIC.
Line Primary MIC is used to set the Line physical path of the Primary MIC.
Line Secondary MIC is used to set the Line physical path of the Secondary MIC.
Line Left AUX is used to set the Line physical path of the AUX Left channel.
Line Right AUX is used to set the Line physical path of the AUX Right channel.
Note
Line Primary SPK and Line Primary MIC must be selected and configured correctly.
When the Line Primary Reference SPK and Line Primary Reference MIC correspond to the Line Category, or when the Line Secondary Reference SPK and Line Secondary Reference MIC are configured, the loopback path of the AEC is actually connected.
Ringtone Category
The figure shows how to configure the Audio Route path for the Ringtone Category.
The Ringtone Category supports the following Logical IO parameters:
Ringtone Primary SPK is used to set the ringtone physical path of the Primary SPK.
Ringtone Secondary SPK is used to set the ringtone physical path of the Secondary SPK.
Ringtone Primary Reference SPK is used to set the ringtone physical AEC loopback path of the Primary SPK.
Ringtone Secondary Reference SPK is used to set the ringtone physical AEC loopback path of the Secondary SPK.
Note
Ringtone Primary SPK must at least be selected and configured correctly.
When the Record Primary Reference MIC and Record Secondary Reference MIC corresponding to the Record Category are also configured, the AEC loopback path of Ringtone and Record is really open.
Voice Prompt Category
The figure shows how to configure the Audio Route path for Voice Prompt Category.
The Voice Prompt Category supports the following Logical IO parameters:
Voice Prompt Primary SPK is used to set the Voice Prompt physical path of the Primary SPK.
Voice Prompt Secondary SPK is used to set the Voice Prompt physical path of the Secondary SPK.
Voice Prompt Primary Reference SPK is used to set the physical AEC loopback path of the Voice Prompt in the Primary SPK.
Voice Prompt Secondary Reference SPK is used to set the physical AEC loopback path of the Voice Prompt in the Secondary SPK.
Note
Voice Prompt Primary SPK must at least be selected and configured correctly.
When the Record Primary Reference MIC and Record Secondary Reference MIC corresponding to the Record Category are also configured, the AEC loopback path of the Voice Prompt and the Record is really open.
APT Category
The figure shows how to configure the Audio Route path for APT Category.
The APT Category supports the following Logical IO parameters:
APT Primary SPK is used to set the APT physical path of the Primary SPK.
APT Secondary SPK is used to set the APT physical path of the Secondary SPK.
APT Primary Reference SPK is used to set the APT physical AEC loopback path of the Primary SPK.
APT Secondary Reference SPK is used to set the APT physical AEC loopback path of the Secondary SPK.
APT Primary Reference MIC is used to set the APT physical AEC loopback channel of the Primary MIC.
APT Secondary Reference MIC is used to set the APT physical AEC loopback channel of the Secondary MIC.
APT Primary Left MIC is used to set the APT physical path of the Primary Left MIC.
APT Primary Right MIC is used to set the APT physical path of the Primary Right MIC.
APT Secondary Left MIC is used to set the APT physical path of the Secondary Left MIC.
APT Secondary Right MIC is used to set the APT physical path of the Secondary Right MIC.
Note
APT Primary SPK and APT Primary Left MIC must at least be selected and configured correctly.
APT Primary Left MIC can be configured only after Enable Normal APT is checked in the HW Feature tab.
When APT Primary Reference SPK and APT Primary Reference MIC correspond to APT Category, or when APT Secondary Reference SPK and APT Secondary Reference MIC are configured, the AEC loopback path can be really opened.
LLAPT Category
The figure shows how to configure the Audio Route path for the LLAPT Category.
The LL-APT Category supports the following Logical IO parameters:
LL-APT Primary SPK is used to set the LL-APT physical path of the Primary SPK.
LL-APT Secondary SPK is used to set the LL-APT physical path of the Secondary SPK.
LL-APT Primary Reference SPK is used to set the LL-APT physical AEC loopback path of the Primary SPK.
LL-APT Secondary Reference SPK is used to set the LL-APT physical AEC loopback path of the Secondary SPK.
LL-APT Primary Reference MIC is used to set the LL-APT physical AEC loopback path of the Primary MIC.
LL-APT Secondary Reference MIC is used to set the LL-APT physical AEC loopback path of the Secondary MIC.
LL-APT Left MIC is used to set the LL-APT physical path of the Left MIC.
LL-APT Right MIC is used to set the LL-APT physical path of the Right MIC.
Note
LL-APT Primary SPK and LL-APT Left MIC must at least be selected and configured correctly.
LL-APT Left MIC and LL-APT Right MIC can be configured only after Enable Low Latency APT is selected in the HW Feature tab.
When the LL-APT Primary Reference SPK and LL-APT Primary Reference MIC correspond to the LL-APT Category, or when the LL-APT Secondary Reference SPK and LL-APT Secondary Reference MIC are configured, the AEC loopback path can be really connected.
ANC Category
The figure shows how to configure the Audio Route path for the ANC Category. The ANC Category supports the following Logical IO parameters:
ANC Primary SPK is used to set the ANC physical path of the Primary SPK.
ANC Secondary SPK is used to set the ANC physical path of the Secondary SPK.
ANC Primary Reference SPK is used to set the ANC physical AEC loopback path of the Primary SPK.
ANC Secondary Reference SPK is used to set the ANC physical AEC loopback path of the Secondary SPK.
ANC Primary Reference MIC is used to set the ANC physical AEC loopback path of the Primary MIC.
ANC Secondary Reference MIC is used to set the ANC physical AEC loopback path of the Secondary MIC.
ANC FF Left MIC is used to set the ANC physical path with the Feedforward Left MIC.
ANC FF Right MIC is used to set the ANC physical path with the Feedforward Right MIC.
ANC FB Left MIC is used to set the ANC physical path of the Feedback Left MIC.
ANC FB Right MIC is used to set the ANC physical path of the Feedback Right MIC.
Note
ANC Primary SPK and ANC FF Left MIC must at least be selected and configured correctly.
ANC FF MIC can be configured only when ANC Type in HW Feature tab is set to ANC FF Only.
ANC FB MIC can be configured only when ANC FB Only is set to ANC Hybrid.
ANC FF MIC and ANC FB MIC can be configured simultaneously.When ANC Primary Reference SPK and ANC Primary Reference MIC corresponding to ANC Category, or when the ANC Secondary Reference SPK and ANC Secondary Reference MIC are well configured, the AEC loopback path can be really opened.
VAD Category
The figure shows how to configure the Audio Route path for the VAD Category.
The VAD Category supports the following Logical IO parameters:
VAD Reference MIC is used to set the loopback path of the VAD physical AEC for the MIC.
VAD Secondary Reference MIC is used to set the VAD physical AEC loopback path of the Secondary MIC.
VAD Primary MIC is used to set the VAD physical path of the Primary MIC.
VAD Secondary MIC is used to set the VAD physical path of the Secondary MIC.
Note
VAD Primary MIC must at least be selected and configured correctly.
AEC Reference Function
The figure shows the working principle of the AEC Reference function.
AEC Reference function: Linear removal of echo signal mixing in microphone input without affecting the quality of the desired speech signal. For UI configuration, when you need to configure the AEC Reference function, select Primary Reference SPK and Primary Reference MIC of Audio Category. The AEC Reference configuration can be performed in the following two cases:
The figure shows two types of AEC Reference functions.
Case 1: Reference signal from HW Codec DAC[5M]=>ADC[5M]=>SPORT RX=>DSP
In this case, select Primary Reference SPK and Primary Reference MIC and set them as Reference Speaker and Reference Mic for UI configuration. There are two existing requirements as follows:Audio Primary Reference SPK + Record Primary Reference MIC: DAC1->ADC3. The figure shows the UI configuration of AEC Reference function between Audio and Record.
Voice Primary Reference SPK + Voice Primary Reference MIC: DAC1->ADC3. The figure shows the UI configuration of AEC Reference function of Voice.
APT Primary Reference SPK + APT Primary Reference MIC: DAC0->ADC2. The figure shows the UI configuration of AEC Reference function of APT.
Case 2: Reference signal from External Codec DAC=> ADC=>SPORT RX=>DSP.
In this case, for UI configuration, select Primary Reference SPK and configure Primary Reference MIC as External Speaker and External Mic. The figure shows the UI configuration of AEC Reference function for the second case.
Note
On RTL87x3E&RTL87x3EP, DAC0 can loopback to ADCn(n = 0, 2, 4), DAC1 can loopback to ADCm(m = 1, 3, 5).
On RTL87x3D, DAC0 can loopback to ADCn(n = 0, 2, 4), DAC1 can loopback to ADCm(m = 1, 3, 5).