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.

  1. Audio Route Concepts

  2. 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.

The figure shows types of Endpoint.

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:

  1. Configure ADC Gain for the device MIC.

  2. Configure the SPORT hardware parameters.

  3. Configure the Codec Mixing function.

  4. 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

  1. MIC ADC Gain can be adjusted using the Set ADC Gain button only if AMIC is selected.

  2. AUX ADC Gain can be adjusted by setting the Set ADC Gain button only when AUX is selected.

  3. DMIC Gain cannot be adjusted by the Set ADC Gain button.

  4. 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:

  1. SPORT 0/1/2/3: Enable the corresponding index’s SPORT by selecting this option.

  2. Role: Configure the role of the SPORT. The options are ‘master’ or ‘slave’.

  3. 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.

  4. RX/TX Mode: Configure the transfer mode in the RX and TX directions. The options are TDM2/4/6/8.

  5. 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.

  6. 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.

  7. RX/TX Channel Length: Configure the length of the channel in the RX and TX directions. The options are 16/20/24/32 bits.

  8. 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

  1. 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’.

  2. 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.

  3. 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

  1. RTL87x3E&RTL87x3EP: RX default TDM4, TX default TDM2.

  2. 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:

  1. 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.

  2. 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:

  1. Audio Primary SPK is used to set the Audio physical path of the Primary SPK.

  2. Audio Secondary SPK is used to set the Audio physical path of the Secondary SPK.

  3. Audio Primary Reference SPK is used to set the Audio physical AEC loopback path of the Primary SPK.

  4. Audio Secondary Reference SPK is used to set the Audio physical AEC loopback path of the Secondary SPK.

Note

  1. Audio Primary SPK must at least be selected and configured correctly.

  2. Both Audio Primary SPK and Audio Secondary SPK need to be selected and configured at the same time to achieve the stereo effect.

  3. 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:

  1. Voice Primary SPK is used to set the Voice physical path of the Primary SPK.

  2. Voice Secondary SPK is used to set the Voice physical path of the Secondary SPK.

  3. Voice Primary Reference SPK is used to set the Voice physical AEC loopback path of the Primary SPK.

  4. Voice Secondary Reference SPK is used to set the Voice physical AEC loopback path of the Secondary SPK.

  5. Voice Primary Reference MIC is used to set the Voice physical AEC loopback path of the Primary MIC.

  6. Voice Secondary Reference MIC is used to set the Voice physical AEC loopback path of the Secondary MIC.

  7. Voice Primary MIC is used to set the Voice physical path for the Primary MIC.

  8. Voice Secondary MIC is used to set the Voice physical path of the Secondary MIC.

  9. Voice Fusion MIC is used to set the Voice physical path for Fusion MIC.

  10. Voice Bone MIC is used to set the Voice physical path for the Bone Sensor MIC.

Note

  1. Voice Primary SPK and Voice Primary MIC must at least be selected and configured correctly.

  2. The Voice Secondary MIC can be configured only after Enable Voice Dual Mic is selected in the HW Feature tab.

  3. 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:

  1. Record Primary MIC is used to set the Record physical path of the Primary MIC.

  2. Record Secondary MIC is used to set the Record physical path of the Secondary MIC.

  3. Record Primary Reference MIC is used to set the Record physical AEC loopback path of the Primary MIC.

  4. Record Secondary Reference MIC is used to set the Record physical AEC loopback path of the Secondary MIC.

  5. Record Left AUX is used to set the Record physical path for the AUX Left channel.

  6. Record Right AUX is used to set the physical path of the Record AUX Right channel.

  7. Record Fusion MIC is used to set the Record physical path of Fusion MIC.

  8. Record Bone MIC is used to set the Record physical path of the Bone Sensor MIC.

Note

  1. Record Primary MIC or Record Left AUX must be selected and configured correctly.

  2. 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:

  1. Line Primary SPK is used to set the Line physical path of the Primary SPK.

  2. Line Secondary SPK is used to set the Line physical path of the Secondary SPK.

  3. Line Primary Reference SPK is used to set the Line physical AEC loopback path of the Primary SPK.

  4. Line Secondary Reference SPK is used to set the Line physical AEC loopback path of the Secondary SPK.

  5. Line Primary Reference MIC is used to set the Line physical AEC loopback path of the Primary MIC.

  6. Line Secondary Reference MIC is used to set the Line physical AEC loopback path of the Secondary MIC.

  7. Line Primary MIC is used to set the Line physical path of the Primary MIC.

  8. Line Secondary MIC is used to set the Line physical path of the Secondary MIC.

  9. Line Left AUX is used to set the Line physical path of the AUX Left channel.

  10. Line Right AUX is used to set the Line physical path of the AUX Right channel.

Note

  1. Line Primary SPK and Line Primary MIC must be selected and configured correctly.

  2. 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:

  1. Ringtone Primary SPK is used to set the ringtone physical path of the Primary SPK.

  2. Ringtone Secondary SPK is used to set the ringtone physical path of the Secondary SPK.

  3. Ringtone Primary Reference SPK is used to set the ringtone physical AEC loopback path of the Primary SPK.

  4. Ringtone Secondary Reference SPK is used to set the ringtone physical AEC loopback path of the Secondary SPK.

Note

  1. Ringtone Primary SPK must at least be selected and configured correctly.

  2. 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:

  1. Voice Prompt Primary SPK is used to set the Voice Prompt physical path of the Primary SPK.

  2. Voice Prompt Secondary SPK is used to set the Voice Prompt physical path of the Secondary SPK.

  3. Voice Prompt Primary Reference SPK is used to set the physical AEC loopback path of the Voice Prompt in the Primary SPK.

  4. Voice Prompt Secondary Reference SPK is used to set the physical AEC loopback path of the Voice Prompt in the Secondary SPK.

Note

  1. Voice Prompt Primary SPK must at least be selected and configured correctly.

  2. 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:

  1. APT Primary SPK is used to set the APT physical path of the Primary SPK.

  2. APT Secondary SPK is used to set the APT physical path of the Secondary SPK.

  3. APT Primary Reference SPK is used to set the APT physical AEC loopback path of the Primary SPK.

  4. APT Secondary Reference SPK is used to set the APT physical AEC loopback path of the Secondary SPK.

  5. APT Primary Reference MIC is used to set the APT physical AEC loopback channel of the Primary MIC.

  6. APT Secondary Reference MIC is used to set the APT physical AEC loopback channel of the Secondary MIC.

  7. APT Primary Left MIC is used to set the APT physical path of the Primary Left MIC.

  8. APT Primary Right MIC is used to set the APT physical path of the Primary Right MIC.

  9. APT Secondary Left MIC is used to set the APT physical path of the Secondary Left MIC.

  10. APT Secondary Right MIC is used to set the APT physical path of the Secondary Right MIC.

Note

  1. APT Primary SPK and APT Primary Left MIC must at least be selected and configured correctly.

  2. APT Primary Left MIC can be configured only after Enable Normal APT is checked in the HW Feature tab.

  3. 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:

  1. LL-APT Primary SPK is used to set the LL-APT physical path of the Primary SPK.

  2. LL-APT Secondary SPK is used to set the LL-APT physical path of the Secondary SPK.

  3. LL-APT Primary Reference SPK is used to set the LL-APT physical AEC loopback path of the Primary SPK.

  4. LL-APT Secondary Reference SPK is used to set the LL-APT physical AEC loopback path of the Secondary SPK.

  5. LL-APT Primary Reference MIC is used to set the LL-APT physical AEC loopback path of the Primary MIC.

  6. LL-APT Secondary Reference MIC is used to set the LL-APT physical AEC loopback path of the Secondary MIC.

  7. LL-APT Left MIC is used to set the LL-APT physical path of the Left MIC.

  8. LL-APT Right MIC is used to set the LL-APT physical path of the Right MIC.

Note

  1. LL-APT Primary SPK and LL-APT Left MIC must at least be selected and configured correctly.

  2. 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:

  1. ANC Primary SPK is used to set the ANC physical path of the Primary SPK.

  2. ANC Secondary SPK is used to set the ANC physical path of the Secondary SPK.

  3. ANC Primary Reference SPK is used to set the ANC physical AEC loopback path of the Primary SPK.

  4. ANC Secondary Reference SPK is used to set the ANC physical AEC loopback path of the Secondary SPK.

  5. ANC Primary Reference MIC is used to set the ANC physical AEC loopback path of the Primary MIC.

  6. ANC Secondary Reference MIC is used to set the ANC physical AEC loopback path of the Secondary MIC.

  7. ANC FF Left MIC is used to set the ANC physical path with the Feedforward Left MIC.

  8. ANC FF Right MIC is used to set the ANC physical path with the Feedforward Right MIC.

  9. ANC FB Left MIC is used to set the ANC physical path of the Feedback Left MIC.

  10. ANC FB Right MIC is used to set the ANC physical path of the Feedback Right MIC.

Note

  1. ANC Primary SPK and ANC FF Left MIC must at least be selected and configured correctly.

  2. 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.

  3. 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:

  1. VAD Reference MIC is used to set the loopback path of the VAD physical AEC for the MIC.

  2. VAD Secondary Reference MIC is used to set the VAD physical AEC loopback path of the Secondary MIC.

  3. VAD Primary MIC is used to set the VAD physical path of the Primary MIC.

  4. 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.

  1. 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:

    1. Audio Primary Reference SPK + Record Primary Reference MIC: DAC1->ADC3. The figure shows the UI configuration of AEC Reference function between Audio and Record.

    2. Voice Primary Reference SPK + Voice Primary Reference MIC: DAC1->ADC3. The figure shows the UI configuration of AEC Reference function of Voice.

    3. APT Primary Reference SPK + APT Primary Reference MIC: DAC0->ADC2. The figure shows the UI configuration of AEC Reference function of APT.

  2. 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

  1. On RTL87x3E&RTL87x3EP, DAC0 can loopback to ADCn(n = 0, 2, 4), DAC1 can loopback to ADCm(m = 1, 3, 5).

  2. On RTL87x3D, DAC0 can loopback to ADCn(n = 0, 2, 4), DAC1 can loopback to ADCm(m = 1, 3, 5).