.. include:: /keyword.rst =============== |G520-G720-EVK| =============== .. contents:: Sections :local: :depth: 2 Overview ======== On |G520-G720-EVK|, there are 5 playback devices and 6 capture devices. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-afe.svg :width: 100% :align: center |G520-G720-EVK| audio route diagram .. table:: Channels supported of the data pin ================= ======== Data Pin Name Channels ================= ======== PCM_DO 2 PCM_DI 2 I2SOUT0_DO 2 I2SIN0_DI 2 I2SIN1_DI 2 DMIC0_DAT 2 AUD_DAT_MOSI[0-1] 1 AUD_DAT_MISO[0-1] 1 DPTX 2 AU_HPL 1 AU_HPR 1 AU_LOL 1 AU_VIN1 1 AU_VIN0 1 AU_VIN2 1 ================= ======== - Playback - Earphone - Lineout Speaker - I2S0 Out - PCM Out - DPTX Audio - Capture - Digital Microphone - I2S0 In - Earphone Microphone - Analog Microphone - I2S1 In - PCM In The |G520-G720-EVK| board has a 3.5mm earphone jack for playback and recording, and a separate 3.5mm jack for lineout speaker. Regarding capture, the |G520-G720-EVK| board also has two AMIC components and two DMIC components. For digital audio interfaces, the |G520-G720-EVK| features one I2S Out, two I2S In, and both PCM Out and PCM In, each with physical pins for signal measurement. For the physical locations of each component and pin on the board, please refer to :ref:`Board Top View `. Audio Interfaces ================ The following table defines the mapping between the physical audio interfaces and their corresponding ALSA PCM device names on the |G520-G720-EVK|. This mapping is essential for routing audio streams to the correct hardware path using standard ALSA utilities such as aplay and arecord. The **Channels** column specifies the maximum supported hardware channels for each interface. * DL (Downlink): Refers to playback paths (output). * UL (Uplink): Refers to capture paths (input). .. csv-table:: Genio 720/520-EVK Audio PCM Device Mapping :file: /_asset/tables/audio-g720-pcm-device-mapping.csv :header-rows: 1 :widths: auto :align: left When specifying a device in your commands or configuration files, use the **PCM Device Name** (e.g., -D hw:0,0) to target the specific interface. Example Usage: 1. To play audio via the **Earphone**: .. code-block:: bash aplay -D hw:0,0 sample.wav 2. To record sound via the **Digital Microphone**: .. code-block:: bash arecord -D hw:0,2 -c 2 -f S16_LE -r 48000 test.wav Playback Usage ============== .. contents:: Playback Devices :local: :depth: 1 The following section provides detailed instructions on how to configure and utilize the various playback devices available on the |G520-G720-EVK|. To achieve successful audio output, the system must establish a valid data path within the SoC's **Audio Front End** (AFE). This routing process is managed via ALSA Mixer Controls (kcontrols), which are used to enable specific data paths, connect internal components (such as DL0 to Earphone), and adjust gain stages. Before proceeding, ensure that the audio routing is configured correctly for your target interface to avoid silent output or resource conflicts. Earphone -------- The Earphone interface outputs analog audio through the onboard 3.5mm audio jack (Earphone). It is driven by the MT6365 PMIC's internal codec. The following diagram illustrates the audio signal path from **DL0** to the **Earphone** output. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-earphone.svg :width: 100% :align: center Audio route for Earphone Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route DL0 to PMIC DL .. code-block:: bash amixer -c 0 cset name='ADDA_DL_CH1 DL0_CH1' 1 amixer -c 0 cset name='ADDA_DL_CH2 DL0_CH2' 1 - Configure MT6365 PMIC Muxes To use the earphone, please ensure the signal is routed to HPL/HPR Mux and disconnected from LOL Mux. .. code-block:: bash amixer -c 0 cset name='HP Mux' 'Audio Playback' amixer -c 0 cset name='LOL Mux' 'Open' - Set Volume .. code-block:: bash amixer -c 0 cset name='Headset Volume' 5 Playback Command ~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D hw:0,0 sample.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The system includes pre-defined ALSA plugin in **/etc/asound.conf**. These plugins automatically handle the necessary kcontrol configurations (routing, mux, and volume settings) when the device is opened. This eliminated the need for manual **amixer** setup. .. code-block:: bash aplay -D earphone_speaker sample.wav .. note:: **Device conflict: Earphone vs. Lineout Speaker** Earphone and Lineout Speaker share the same memory interface (DL0) and PMIC DAC resources. Therefore, they cannot be used simultaneously. Lineout Speaker --------------- The Lineout Speaker interface provides a line-level analog output through the onboard 3.5mm audio jack (Speaker). The diagram below shows the signal path from **DL0** to the **Speaker Lineout** output. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-lineout.svg :width: 100% :align: center Audio route for Lineout Speaker Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route DL0 to PMIC DL .. code-block:: bash amixer -c 0 cset name='ADDA_DL_CH1 DL0_CH1' 1 - Configure MT6365 PMIC Muxes .. code-block:: bash amixer -c 0 cset name='HP Mux' 'Open' amixer -c 0 cset name='LOL Mux' 'Playback_L_DAC' - Set Volume .. code-block:: bash amixer -c 0 cset name='Lineout Volume' 5 Playback Command ~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D hw:0,0 sample.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D lineout_speaker sample.wav I2S0 Out -------- I2S0 is a digital audio interface exposed on the expansion header (RPi connector), allowing connection to external I2S DACs or Codecs. The diagram below shows the signal path from **DL1** to the **eTDM output** module. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-i2sout0.svg :width: 100% :align: center Audio route for I2S0 Out Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route DL1 to I2S0 .. code-block:: bash amixer -c 0 cset name='I2SOUT0_CH1 DL1_CH1' 1 amixer -c 0 cset name='I2SOUT0_CH2 DL1_CH2' 1 - Enable Signal Output to RPi connector .. code-block:: bash amixer -c 0 cset name='I2S_OUT0_Mux' 1 Playback Command ~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D hw:0,1 sample.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D i2s_out0 sample.wav PCM Out ------- The PCM interface provides a standard digital output on the expansion header, suitable for connecting Bluetooth or Telephony modules. The diagram below shows the signal path from **DL2** to the **PCM0** interface. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-pcm-out.svg :width: 100% :align: center Audio route for PCM Out Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route DL2 to PCM0 .. code-block:: bash amixer -c 0 cset name='PCM_0_PB_CH1 DL2_CH1' 1 amixer -c 0 cset name='PCM_0_PB_CH2 DL2_CH2' 1 Playback Command ~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D hw:0,6 sample.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D pcm_out sample.wav DPTX Audio ---------- The DPTX Audio interface transmits digital audio over the DisplayPort connector to an external monitor or TV. The diagram below shows the signal path from the **HDMI** memory interface to the **DPTX out**. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-dptx.svg :width: 100% :align: center Audio route for DPTX audio Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route HDMI to DPTX out .. code-block:: bash amixer -c 0 cset name='HDMI_CH0_MUX' 'CH0' amixer -c 0 cset name='HDMI_CH1_MUX' 'CH1' - Enable DPTX Mux .. code-block:: bash amixer -c 0 cset name='DPTX_OUT_MUX' 'Connect' Playback Command ~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D hw:0,5 sample.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash aplay -D dptx_out sample.wav Capture Usage ============= .. contents:: Capture Devices :local: :depth: 1 The following section details how to configure and use the recording interfaces (Uplink/UL) on the |G520-G720-EVK|. Digital Microphone ------------------ The |G520-G720-EVK| features two onboard Digital Microphones (DMIC) connected to the DMIC0 interface. These are typically used for high-quality voice recording or far-field audio applications. The signal travels from the onboard microphones to the **DMIC0** backend and then to the **UL0** memory interface. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-dmic.svg :width: 100% :align: center Audio route for Digital Microphone Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route DMIC0 to UL0 .. code-block:: bash amixer -c 0 cset name='UL0_CH1 AP_DMIC_UL_CH1' 1 amixer -c 0 cset name='UL0_CH2 AP_DMIC_UL_CH2' 1 Capture Command ~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D hw:0,2 -c 2 -f S16_LE -r 48000 test.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The **dmic** plugin configures the DMIC path automatically. .. code-block:: bash arecord -D dmic -c 2 -f S16_LE -r 48000 test.wav I2S0 In ------- I2SIN0 is a digital audio input interface and is accessible via the expansion header. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-i2sin0.svg :width: 100% :align: center Audio route for I2S0 In Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route eTDM in0 to UL1 .. code-block:: bash amixer -c 0 cset name='UL1_CH1 I2SIN0_CH1' 1 amixer -c 0 cset name='UL1_CH2 I2SIN0_CH2' 1 - Enable I2SIN0 Input Mux .. code-block:: bash amixer -c 0 cset name='I2S_IN0_Mux' 1 Capture Command ~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D hw:0,3 -c 2 -f S16_LE -r 48000 test.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D i2s_in0 -c 2 -f S16_LE -r 48000 test.wav Earphone Microphone ------------------- The Earphone Microphone supports headsets connected to the onboard 3.5mm audio jack. It utilizes the MT6365 PMIC to achieve headset detection, volume control and analog-to-digital signal conversion functions. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-earphone-mic.svg :width: 100% :align: center Audio route for Earphone Microphone Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route PMIC UL to UL2 .. code-block:: bash amixer -c0 cset name='UL2_CH1 ADDA_UL_CH1' 1 amixer -c0 cset name='MISO0_MUX' 'UL1_CH1' - Configure MT6365 PMIC Muxes .. code-block:: bash amixer -c0 cset name='ADC_L_Mux' 'Left Preamplifier' amixer -c0 cset name='ADC_R_Mux' 'Idle' amixer -c0 cset name='PGA_L_Mux' 'AIN1' - Set Volume .. code-block:: bash amixer -c0 cset name='PGA1 Volume' 4 Capture Command ~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D hw:0,4 -c 2 -f S16_LE -r 48000 test.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The **earphone_mic** plugin handles the mux switching automatically. .. code-block:: bash arecord -D earphone_mic -c 2 -f S16_LE -r 48000 test.wav .. note:: **Device conflict: Earphone Microphone vs. Analog Microphone** The Earphone Microphone and the Analog Microphones share the same AFE interface (UL2) and PMIC ADC/PGA resources. They cannot be used simultaneously. Analog Microphone ----------------- |G520-G720-EVK| includes two onboard Analog Microphones (AMIC). These share the UL2 path with the Earphone Microphone. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-amic.svg :width: 100% :align: center Audio route for Analog Microphone Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route PMIC UL to UL2 .. code-block:: bash amixer -c0 cset name='UL2_CH1 ADDA_UL_CH1' 1 amixer -c0 cset name='UL2_CH2 ADDA_UL_CH2' 1 amixer -c0 cset name='MISO0_MUX' 'UL1_CH1' amixer -c0 cset name='MISO1_MUX' 'UL1_CH2' - Configure MT6365 PMIC Muxes .. code-block:: bash amixer -c0 cset name='ADC_L_Mux' 'Left Preamplifier' amixer -c0 cset name='ADC_R_Mux' 'Right Preamplifier' amixer -c0 cset name='PGA_L_Mux' 'AIN0' amixer -c0 cset name='PGA_R_Mux' 'AIN2' - Set Volume .. code-block:: bash amixer -c0 cset name='PGA1 Volume' 4 amixer -c0 cset name='PGA2 Volume' 4 Capture Command ~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D hw:0,4 -c 2 -f S16_LE -r 48000 test.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The **amic** plugin handles the mux switching automatically. .. code-block:: bash arecord -D amic -c 2 -f S16_LE -r 48000 test.wav I2S1 In ------- I2SIN1 is a digital audio input interface available on the expansion pins. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-i2sin1.svg :width: 100% :align: center Audio route for I2S1 In Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route eTDM in1 to UL3 .. code-block:: bash amixer -c 0 cset name='UL3_CH1 I2SIN1_CH1' 1 amixer -c 0 cset name='UL3_CH2 I2SIN1_CH2' 1 - Enable I2SIN1 Input Mux .. code-block:: bash amixer -c 0 cset name='I2S_IN1_Mux' 1 Capture Command ~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D hw:0,18 -c 2 -f S16_LE -r 48000 test.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D i2s_in1 -c 2 -f S16_LE -r 48000 test.wav PCM In ------ The PCM In interface provides a standard PCM input on the expansion header (RPi connector), suitable for recording from Bluetooth or Telephony modules. .. figure:: /_asset/sw_yocto_app-dev_audio_g720-pcm-in.svg :width: 100% :align: center Audio route for PCM In Required Configurations ~~~~~~~~~~~~~~~~~~~~~~~ - Route PCM0 to UL4 .. code-block:: bash amixer -c 0 cset name='UL4_CH1 PCM_0_CAP_CH1' 1 amixer -c 0 cset name='UL4_CH2 PCM_0_CAP_CH2' 1 Capture Command ~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D hw:0,20 -c 2 -f S16_LE -r 48000 test.wav Simplified Usage via ALSA Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash arecord -D pcm_in -c 2 -f S16_LE -r 48000 test.wav