.. include:: /keyword.rst ========== |i350-EVK| ========== .. contents:: Sections :local: :depth: 1 Overview -------- On i350-EVK, there are 3 playback hardware and 3 capture hardware. - Playback - Line-Out Jack - Headset-Out Jack - HDMI Audio Out - Capture - Headset-In Jack - AMIC In - DMIC In One line-out jack is used for the external amplifier. One headset jack can be connected to the earphone which has both playback and capture functions. AMIC is a mono analog microphone on the board. DMIC is a stereo digital microphone on the board. .. figure:: /_asset/sw_rity_app-dev_audio_hardware.png :align: center :scale: 50% Audio hardware position The default routing is shown below. There are 2 playback nodes and 2 capture nodes. .. figure:: /_asset/sw_rity_app-dev_audio_route.png :align: center :scale: 50% The route between hardware and device node - ``pcmC0D0p`` plays the sound to either ``Line-Out Jack`` or ``Headset-Out Jack``. - ``pcmC0D1p`` plays the sound to ``HDMI Audio Out``. - ``pcmC0D2c`` records the voice from either ``Headset-In Jack`` or ``AMIC``. - ``pcmC0D3c`` records the voice from ``2-ch DMIC``. .. _playback-i350: Playback -------- Headset Jack Speaker ^^^^^^^^^^^^^^^^^^^^ By default, the i350-EVK board plays the audio to the first jack connector (headset) and the second jack (line-out) is disabled. To play the music through the jack, you can use either ``gst-play-1.0`` or ``aplay``. ``gst-play-1.0`` is a tool used to test basic playback using the GStreamer element ``playbin``. For more details about ``gst-play-1.0``, please refer to `gst-play-1.0 `_. .. prompt:: bash # auto # gst-play-1.0 sample.mp3 ``aplay`` is a command-line sound file player for the ALSA sound card driver. For more details about ``aplay``, please refer to `aplay `_. .. prompt:: bash # auto # aplay -D jack_speaker sample.wav It is possible to switch to the second line. To do that, you will need to change some ALSA settings by using the following commands: - To disable the headset-out jack and enable the line-out jack: .. prompt:: bash # auto # amixer cset -c mtsndcard name='Audio_Amp_L_Switch' 0 # amixer cset -c mtsndcard name='Audio_Amp_R_Switch' 0 # amixer cset -c mtsndcard name='Speaker_Amp_Switch' 1 - To switch back to the headset-out jack: .. prompt:: bash # auto # amixer cset -c mtsndcard name='Audio_Amp_L_Switch' 1 # amixer cset -c mtsndcard name='Audio_Amp_R_Switch' 1 # amixer cset -c mtsndcard name='Speaker_Amp_Switch' 0 There are gain controls for the audio outputs. You can use these controls to adjust the volume: - To control the gain of the headset-out jack: .. prompt:: bash # auto # # Max volume # amixer cset -c mtsndcard name='Headset_PGAL_GAIN' 0 numid=131,iface=MIXER,name='Headset_PGAL_GAIN' ; type=ENUMERATED,access=rw------,values=1,items=32 ; Item #0 '8Db' ; Item #1 '7Db' ... ; Item #30 '-22Db' ; Item #31 '-40Db' : values=0 .. prompt:: bash # auto # # Min volume # amixer cset -c mtsndcard name='Headset_PGAL_GAIN' 31 numid=131,iface=MIXER,name='Headset_PGAL_GAIN' ; type=ENUMERATED,access=rw------,values=1,items=32 ; Item #0 '8Db' ; Item #1 '7Db' ... ; Item #30 '-22Db' ; Item #31 '-40Db' : values=31 - To control the gain of the line-out jack: .. prompt:: bash # auto # amixer cset -c mtsndcard name='Lineout_PGAL_GAIN' 0 numid=135,iface=MIXER,name='Lineout_PGAL_GAIN' ; type=ENUMERATED,access=rw------,values=1,items=20 ; Item #0 '8Db' ; Item #1 '7Db' ... ; Item #18 '-10Db' ; Item #19 '-40Db' : values=0 .. prompt:: bash # auto amixer cset -c mtsndcard name='Lineout_PGAL_GAIN' 19 numid=135,iface=MIXER,name='Lineout_PGAL_GAIN' ; type=ENUMERATED,access=rw------,values=1,items=20 ; Item #0 '8Db' ; Item #1 '7Db' ... ; Item #18 '-10Db' ; Item #19 '-40Db' : values=19 HDMI Speaker ^^^^^^^^^^^^ To play the audio through HDMI, use the following command: .. prompt:: bash # auto # aplay -D hdmi_out sample.wav .. _capture-i350: Capture ------- Headset Jack Microphone ^^^^^^^^^^^^^^^^^^^^^^^ By default, the i350-EVK board records the voice from the headset jack microphone. The following command is an example that will start a mono record with 48KHz sampling rate and signed 32bits bit format: .. prompt:: bash # auto # arecord -D jack_mic -r 48000 -f S32_LE sample.wav Digital Microphone ^^^^^^^^^^^^^^^^^^ You can record the voice from the 2 PDM mics on the board. In this case, the device will need to be specified explicitly as follows: .. prompt:: bash # auto # arecord -D dmic -r 48000 -f S32_LE -c 2 sample.wav Analog Microphone ^^^^^^^^^^^^^^^^^ You can record the voice from the analog mic on the board. In that case, you will need to switch from the jack mic to the analog mic by using the following command: .. prompt:: bash # auto # # Switch microphone to AMIC # amixer cset -c mtsndcard name='Audio_MicSource1_Setting' 0 numid=161,iface=MIXER,name='Audio_MicSource1_Setting' ; type=ENUMERATED,access=rw------,values=1,items=4 ; Item #0 'ADC1' ; Item #1 'ADC2' ; Item #2 'ADC3' ; Item #3 'ADC4' : values=0 # arecord -D jack_mic -r 48000 -f S32_LE sample.wav To switch back to the jack mic, use the following command: .. prompt:: bash # auto # # Switch microphone to headset-in jack # amixer cset -c mtsndcard name='Audio_MicSource1_Setting' 1 numid=161,iface=MIXER,name='Audio_MicSource1_Setting' ; type=ENUMERATED,access=rw------,values=1,items=4 ; Item #0 'ADC1' ; Item #1 'ADC2' ; Item #2 'ADC3' ; Item #3 'ADC4' : values=1 # arecord -D jack_mic -r 48000 -f S32_LE sample.wav Loopback Test ------------- There's a loopback audio test that directly transfers the input voice to the output audio. For example: To transfer DMIC to headset-out jack: .. prompt:: bash # auto # # Enable headset-out jack and disable line-out jack # amixer cset -c mtsndcard name='Audio_Amp_L_Switch' 1 # amixer cset -c mtsndcard name='Audio_Amp_R_Switch' 1 # amixer cset -c mtsndcard name='Speaker_Amp_Switch' 0 # # Transfer DMIC to headset-out jack # arecord -D dmic -r 48000 -f S32_LE -c 2 | aplay -D jack_speaker -r 48000 -f S32_LE -c 2 To transfer AMIC to line-out jack: .. prompt:: bash # auto # # Enable line-out jack and disable headset-out jack # amixer cset -c mtsndcard name='Audio_Amp_L_Switch' 0 # amixer cset -c mtsndcard name='Audio_Amp_R_Switch' 0 # amixer cset -c mtsndcard name='Speaker_Amp_Switch' 1 # # Select AMIC # amixer cset -c mtsndcard name='Audio_MicSource1_Setting' 0 # # Transfer AMIC to line-out jack # arecord -D jack_mic -r 48000 -f S32_LE | aplay -D jack_speaker -r 48000 -f S32_LE To transfer headset-in jack to headset-out jack: .. prompt:: bash # auto # # Enable headset-out jack and disable line-out jack # amixer cset -c mtsndcard name='Audio_Amp_L_Switch' 1 # amixer cset -c mtsndcard name='Audio_Amp_R_Switch' 1 # amixer cset -c mtsndcard name='Speaker_Amp_Switch' 0 # # Select headset-in jack # amixer cset -c mtsndcard name='Audio_MicSource1_Setting' 1 # # Transfer headset-in jack to headset-out jack # arecord -D jack_mic -r 48000 -f S32_LE | aplay -D jack_speaker -r 48000 -f S32_LE To transfer headset-in jack to HDMI audio out: .. prompt:: bash # auto # # Enable headset-out jack and disable line-out jack # amixer cset -c mtsndcard name='Audio_Amp_L_Switch' 1 # amixer cset -c mtsndcard name='Audio_Amp_R_Switch' 1 # amixer cset -c mtsndcard name='Speaker_Amp_Switch' 0 # # Select headset-in jack # amixer cset -c mtsndcard name='Audio_MicSource1_Setting' 1 # # Transfer headset-in jack to headset-out jack # arecord -D jack_mic -r 48000 -f S32_LE | aplay -D hdmi_out -r 48000 -f S32_LE