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.

../../../_images/AudioRoute.png

Audio Route Path

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.

Audio Category Type

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 Passthrough

LLAPT

Low-Latency Ambient Passthrough

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.

../../../_images/Endpoint.png

Endpoint Type

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.

../../../_images/Logical.png

Logical IO Type

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.

../../../_images/Audio_Route_Path.png

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.

Audio Route Path Parameter

Name

List

SPK Index

Speaker1/2

SPK Type

Single-End/Differential

DAC Channel

DAC0/1/2/3

MIC Index

Amic1/2/3 Dmic1/2

MIC Type

Single-End/Differential/Falling Edge/Rising Edge

ADC Channel

ADC0/1/2/3

SPORT Index

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

ADC Gain

Set 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 Differential.

../../../_images/Voice_Amic1.png

Voice Primary MIC

The figure shows how to configure ADC Gain.

../../../_images/ADC_GAIN.png

ADC Gain

If the Voice Primary MIC is configured under the Voice Category and Amic1 Differential is selected, the ADC Gain value of Amic1 Differential 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 Differential. 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\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.

  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.

../../../_images/Gateway.png

SPORT Parameters

Note

  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 TX and RX directions. The options are TDM2/4/6/8.

  5. RX/TX Format: Configure the format of the SPORT data in the TX and RX directions. The options are I2S/Left Justified/PCM_A/PCM_B.

  6. RX/TX Data Length: Configure the data length in the TX and RX 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 TX and RX directions. The options are 16/20/24/32 bits.

  8. RX/TX Sample Rate: Configure the sample rate in the TX and RX 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 Bridge.

../../../_images/External_Bridge.png

External Bridge

../../../_images/pinmux.png

External Bridge PINMUX

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 TX and RX 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 TX and RX Bridge field allows users to freely select External/Internal. When Role is set to Slave, the TX and RX of the Bridge field can only be changed to the fixed value External.

  2. RTL87x3E and RTL87x3EP: For SPORT0/1, you can configure the Bridge field based on the Role field. For SPORT2, the TX and RX of its Bridge field is a fixed value External, regardless of its Role value.

  3. RTL87x3D: For SPORT0/1/2, you can configure the Bridge field based on the Role field. For SPORT3, the TX and RX 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 and RTL87x3EP: RX SPORT Mode default TDM4, TX SPORT Mode default TDM2.

  2. RTL87x3D: RX SPORT Mode default TDM6, TX SPORT Mode default TDM2.

SPORT Data Length

The figure shows how to configure SPORT Data Length.

../../../_images/Data_Channel_Length.png

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.

Note

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.

../../../_images/Gateway_Sample_Rate.png

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.

../../../_images/CodecMix.png

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 tool configuration allows configuring Codec Mixing function. 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.

../../../_images/Codec_Mix_UI.png

Codec Mixing

Note

  1. If the Point1 checkbox is checked in DAC0 mix point, data from DAC1 can be mixed to DAC0.

  2. If the Point2 checkbox is checked in DAC1 mix point, data from DAC0 can be mixed 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.

../../../_images/Audio_Physical_Path.png

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.

../../../_images/Voice_Physical_Path.png

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.

../../../_images/Voice_Dual_Mic.png

Voice Dual MIC

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

../../../_images/Record_Physical_Path.png

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.

../../../_images/Audio_Line_Physical_Path.png

Line Category

The Line Category supports the following Logical IO parameters:

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

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

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

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

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

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

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

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

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

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

Note

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

  2. When the Line-in Primary Reference SPK and Line-in Primary Reference MIC correspond to the Line Category, or when the Line-in Secondary Reference SPK and Line-in 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.

../../../_images/Ringtone_Physical_Path.png

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.

../../../_images/Voice_Prompt_Physical_Path.png

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.

../../../_images/APT_Physical_Path.png

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.

../../../_images/Enable_APT.png

Enable Normal APT

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

../../../_images/LLAPT_Physical_Path.png

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.

../../../_images/Enable_LLAPT.png

Enable Low Latency APT

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

../../../_images/ANC_Physical_Path.png

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. when ANC Type is set to ANC Hybrid, ANC FF MIC and ANC FB MIC can be configured simultaneously.

../../../_images/Enable_ANC.png

Enable ANC

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

../../../_images/VAD_Physical_Path.png

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.

../../../_images/AECREF.png

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 tool 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 Function.

../../../_images/AECCASES.png

AEC Reference Function Cases

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 tool configuration.

Note

  1. The figure shows the tool configuration of AEC Reference Function between Audio and Record.

../../../_images/Audio_Record_AEC.png

Audio Record AEC

  1. The figure shows the tool configuration of AEC Reference Function of Voice.

../../../_images/Voice_AEC.png

Voice AEC

  1. The figure shows the tool configuration of AEC Reference Function of APT.

../../../_images/APT_AEC.png

APT AEC

2. Case 2: Reference signal from External Codec DAC=>ADC=>SPORT RX=>DSP. In this case, for tool configuration, select Primary Reference SPK and configure Primary Reference MIC as External Speaker and External Mic.

Note

The figure shows the tool configuration of AEC Reference Function for the external case.

../../../_images/Third_AEC.png

External AEC

Note

  1. On RTL87x3E and RTL87x3EP, DAC0 can loopback to ADC0\2\4, DAC1 can loopback to ADC1\3\5.

  2. On RTL87x3D, DAC0 can loopback to ADC0\2\4, DAC1 can loopback to ADC1\3\5.