Difference between revisions of "ROM-6881 Audio"

From ESS-WIKI
Jump to: navigation, search
 
Line 4: Line 4:
 
Before the test, you need to prepare an audio card (ROM-EG57), a microphone and a pair of headphones. The test and jumper setup environment is as shown in the following picture.[[File:ROM-6881 Audio.png|RTENOTITLE]]
 
Before the test, you need to prepare an audio card (ROM-EG57), a microphone and a pair of headphones. The test and jumper setup environment is as shown in the following picture.[[File:ROM-6881 Audio.png|RTENOTITLE]]
  
'''1、Get Audio board ID'''
+
'''1、Record<br/> Take Card ID 0 as an example:<br/> Change CARD_ID=0 according "Get the Audio board ID".'''
<pre>cat /proc/asound/cards
+
<pre># cat /proc/asound/cards
 +
0 [rockchiprt5640c]: rockchip_rt5640 - rockchip,rt5640-codec
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rockchip,rt5640-codec
 +
1 [rockchiphdmi0 &nbsp;]: rockchip-hdmi0 - rockchip-hdmi0
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rockchip-hdmi0
 +
 
 +
# CARD_ID=0
 +
# amixer -c $CARD_ID cset name='DAI select' '1:1|2:2' &nbsp; &nbsp; && \
 +
&nbsp; amixer -c $CARD_ID cset name='RECMIXL BST1 Switch' 1 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='RECMIXR BST1 Switch' 1 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='RECMIXL BST2 Switch' 0 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='RECMIXR BST2 Switch' 0 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='Stereo ADC1 Mux' 'ADC' &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='Stereo ADC MIXL ADC1 Switch' 1 && \
 +
&nbsp; amixer -c $CARD_ID cset name='Stereo ADC MIXR ADC1 Switch' 1 && \
 +
&nbsp; amixer -c $CARD_ID cset name='Stereo ADC MIXL ADC2 Switch' 0 && \
 +
&nbsp; amixer -c $CARD_ID cset name='Stereo ADC MIXR ADC2 Switch' 0 && \
 +
&nbsp; amixer -c $CARD_ID cset name='ADC Capture Switch' 1 1 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='ADC Capture Volume' 50% &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='ADC Boost Gain' 1 1 &nbsp; &nbsp; &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='IN Capture Volume' 17 17 &nbsp; && \
 +
&nbsp; amixer -c $CARD_ID cset name='IN1 Boost' 3 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='IN2 Boost' 3 &nbsp; &nbsp;&& \
 +
&nbsp; amixer -c $CARD_ID cset name='IN3 Boost' 3
 
</pre>
 
</pre>
<pre>0 [rockchiprt5640c]: rockchip_rt5640 - rockchip,rt5640-codec rockchip,rt5640-codec
 
1 [rockchiphdmi0 ]: rockchip-hdmi0 - rockchip-hdmi0 rockchip-hdmi0
 
2 [rockchipdp0 ]: rockchip-dp0 - rockchip-dp0 rockchip-dp0s</pre>
 
  
 
'''2、Record'''
 
'''2、Record'''
  
 
&nbsp; &nbsp; &nbsp; &nbsp;Take Card ID 0 for example:
 
&nbsp; &nbsp; &nbsp; &nbsp;Take Card ID 0 for example:
<pre>arecord -Dplughw:0,0 -f S16_LE -r 16000 -d 10 -t wav test.wav
+
<pre># arecord -Dplughw:$CARD_ID,0 -f S16_LE -r 16000 -d 10 -t wav test.wav
 
</pre>
 
</pre>
  
 
'''3、Playback'''
 
'''3、Playback'''
  
&nbsp; &nbsp; &nbsp;&nbsp;Take Card ID 0 for example:
+
&nbsp; &nbsp; &nbsp;Take Card ID 0 as an example:<br/> &nbsp; &nbsp; &nbsp; Change CARD_ID=0 according "Get the Audio board ID".
<pre>aplay -Dplughw:0,0 -t wav test.wav
+
<pre># CARD_ID=0
 +
# aplay -Dplughw:$CARD_ID,0 -t wav test.wav
 
</pre>
 
</pre>
  

Latest revision as of 10:28, 25 July 2025

Audio Test

Before the test, you need to prepare an audio card (ROM-EG57), a microphone and a pair of headphones. The test and jumper setup environment is as shown in the following picture.RTENOTITLE

1、Record
Take Card ID 0 as an example:
Change CARD_ID=0 according "Get the Audio board ID".

# cat /proc/asound/cards
0 [rockchiprt5640c]: rockchip_rt5640 - rockchip,rt5640-codec
                      rockchip,rt5640-codec
1 [rockchiphdmi0  ]: rockchip-hdmi0 - rockchip-hdmi0
                      rockchip-hdmi0

# CARD_ID=0
# amixer -c $CARD_ID cset name='DAI select' '1:1|2:2'     && \
  amixer -c $CARD_ID cset name='RECMIXL BST1 Switch' 1    && \
  amixer -c $CARD_ID cset name='RECMIXR BST1 Switch' 1    && \
  amixer -c $CARD_ID cset name='RECMIXL BST2 Switch' 0    && \
  amixer -c $CARD_ID cset name='RECMIXR BST2 Switch' 0    && \
  amixer -c $CARD_ID cset name='Stereo ADC1 Mux' 'ADC'    && \
  amixer -c $CARD_ID cset name='Stereo ADC MIXL ADC1 Switch' 1 && \
  amixer -c $CARD_ID cset name='Stereo ADC MIXR ADC1 Switch' 1 && \
  amixer -c $CARD_ID cset name='Stereo ADC MIXL ADC2 Switch' 0 && \
  amixer -c $CARD_ID cset name='Stereo ADC MIXR ADC2 Switch' 0 && \
  amixer -c $CARD_ID cset name='ADC Capture Switch' 1 1    && \
  amixer -c $CARD_ID cset name='ADC Capture Volume' 50%    && \
  amixer -c $CARD_ID cset name='ADC Boost Gain' 1 1        && \
  amixer -c $CARD_ID cset name='IN Capture Volume' 17 17   && \
  amixer -c $CARD_ID cset name='IN1 Boost' 3    && \
  amixer -c $CARD_ID cset name='IN2 Boost' 3    && \
  amixer -c $CARD_ID cset name='IN3 Boost' 3

2、Record

       Take Card ID 0 for example:

# arecord -Dplughw:$CARD_ID,0 -f S16_LE -r 16000 -d 10 -t wav test.wav

3、Playback

     Take Card ID 0 as an example:
      Change CARD_ID=0 according "Get the Audio board ID".

# CARD_ID=0
# aplay -Dplughw:$CARD_ID,0 -t wav test.wav

RK Tool  Function:

/tools/test/adv/audio/audio_record_test.sh 0
/tools/test/adv/audio/audio_play_test.sh 0