Audio Testing

QuecPi Alpha single-board computer supports Audio external MIC recording, 3.5mm headphone recording, and 3.5mm headphone playback.

View Sound Card Information

  • Enter the following command in the terminal to check the mounting status of the sound card:
root@qcm6490-idp:/opt# cat /proc/asound/cards
 0 [qcm6490idpsndca]: qcm6490 - qcm6490-idp-snd-card
                      qcm6490-idp-snd-card
  • Enter the following command in the terminal to view the list of allocated PCM streams:
root@qcm6490-idp:/opt# cat /proc/asound/pcm
00-00: CODEC_DMA-LPAIF_RXTX-RX-0 multicodec-0 :  : playback 1
00-01: CODEC_DMA-LPAIF_RXTX-TX-3 multicodec-1 :  : capture 1
00-02: CODEC_DMA-LPAIF_VA-TX-0 va_macro_tx1-2 :  : capture 1

External MIC Recording

1.To record using an external MIC, please enter the following command

root@qcm6490-idp:/opt# systemctl stop pulseaudio
root@qcm6490-idp:/opt# tinymix set "VA DMIC MUX0" "DMIC0"
root@qcm6490-idp:/opt# tinymix set "VA_AIF1_CAP Mixer DEC0" "1"
root@qcm6490-idp:/opt# tinymix set "VA_DEC0 Volume" "100"
root@qcm6490-idp:/opt# agmcap test1.wav -D 100 -d 101 -c 1 -r 48000 -b 16 -i "CODEC_DMA-LPAIF_VA-TX-0"
pcm_plug_open: dlopen successful for libagm_pcm_plugin.so
Capturing sample: 1 ch, 48000 hz, 16 bit
diag: Diag_LSM_Init: invoked for pid: 1599 with init_count: 0
diag:successfully connected to socket 17
diag: Diag_LSM_Init: done for pid: 1599 with init_count: 1
diag: Successfully registered commands with the driver
  • PulseAudio may occupy audio devices, causing direct hardware access (such as agmcp) to fail. After stopping, exclusive access can be ensured.
  • -c 1 monaural recording
  • -r 48000 sampling rate 48 kHz
  • -b 16 sampling bit depth 16 bit
  • -i "CODEC_DMA-LPAIF_VA-TX-0" specifies the input device interface as sending (recording) channel 0

2.If you want to stop recording, please press Ctrl+C to generate an audio file named test1.wav in the current directory

root@qcm6490-idp:/opt# ls
cni  containerd  test1.wav

3.5mm Earphone Recording

1.Before recording with 3.5mm headphones, the levels of gpio8 and gpio68 need to be set high

root@qcm6490-idp:/opt# rgpiod &
root@qcm6490-idp:/opt# sleep 1
root@qcm6490-idp:/opt# rgs c 999 go 4
root@qcm6490-idp:/opt# rgs c 999 gso 0 8
root@qcm6490-idp:/opt# rgs c 999 gw 0 8 1
root@qcm6490-idp:/opt# rgs c 999 gso 0 68
root@qcm6490-idp:/opt# rgs c 999 gw 0 68 1
  • gpio8------------Headphone national/American standard switching control switch, set to 0: European standard, set to 1: American standard
  • gpio68-----------Headphone power supply enable switch, set 0: disable, set 1: enable

2.To record with 3.5mm headphones, please enter the following command

root@qcm6490-idp:/opt# systemctl stop pulseaudio
root@qcm6490-idp:/opt# tinymix set "TX DEC0 MUX" "SWR_MIC" 
root@qcm6490-idp:/opt# tinymix set "TX SMIC MUX0" "ADC1" 
root@qcm6490-idp:/opt# tinymix set "TX_AIF1_CAP Mixer DEC0" "1" 
root@qcm6490-idp:/opt# tinymix set "ADC2 MUX" "INP2" 
root@qcm6490-idp:/opt# tinymix set "ADC2 Switch" "1" 
root@qcm6490-idp:/opt# tinymix set "ADC2_MIXER Switch" "1" 
root@qcm6490-idp:/opt# tinymix set "TX_DEC0 Volume" "80" 
root@qcm6490-idp:/opt# tinymix set "ADC2 Volume" "20" 
root@qcm6490-idp:/opt# agmcap test2.wav -D 100 -d 101 -c 1 -r 48000 -b 16 -i "CODEC_DMA-LPAIF_RXTX-TX-3"
pcm_plug_open: dlopen successful for libagm_pcm_plugin.so
Capturing sample: 1 ch, 48000 hz, 16 bit
diag: Diag_LSM_Init: invoked for pid: 1384 with init_count: 0
diag:successfully connected to socket 17
diag: Diag_LSM_Init: done for pid: 1384 with init_count: 1
diag: Successfully registered commands with the driver

3.If you want to stop recording, please press Ctrl+C to generate an audio file named test2.wav in the current directory

root@qcm6490-idp:/opt# ls
cni  containerd  test2.wav

3.5mm Headphone Playback

1.Before recording with 3.5mm headphones, the levels of gpio8 and gpio68 need to be set high

root@qcm6490-idp:/opt# rgpiod &
root@qcm6490-idp:/opt# sleep 1
root@qcm6490-idp:/opt# rgs c 999 go 4
root@qcm6490-idp:/opt# rgs c 999 gso 0 8
root@qcm6490-idp:/opt# rgs c 999 gw 0 8 1
root@qcm6490-idp:/opt# rgs c 999 gso 0 68
root@qcm6490-idp:/opt# rgs c 999 gw 0 68 1
  • gpio8-------------Headphone national/American standard switching control switch, set to 0: European standard, set to 1: American standard
  • gpio68------------Headphone power supply enable switch, set 0: disable, set 1: enable

2.To play with 3.5mm headphones, please enter the following command

root@qcm6490-idp:/opt# systemctl stop pulseaudio
root@qcm6490-idp:/opt# tinymix set "RX_MACRO RX0 MUX" "AIF1_PB" 
root@qcm6490-idp:/opt# tinymix set "RX_MACRO RX1 MUX" "AIF1_PB" 
root@qcm6490-idp:/opt# tinymix set "RX INT0_1 MIX1 INP0" "RX0" 
root@qcm6490-idp:/opt# tinymix set "RX INT1_1 MIX1 INP0" "RX1" 
root@qcm6490-idp:/opt# tinymix set "RX INT0 DEM MUX" "CLSH_DSM_OUT" 
root@qcm6490-idp:/opt# tinymix set "RX INT1 DEM MUX" "CLSH_DSM_OUT" 
root@qcm6490-idp:/opt# tinymix set "RX_COMP1 Switch" "1" 
root@qcm6490-idp:/opt# tinymix set "RX_COMP2 Switch" "1"
root@qcm6490-idp:/opt# tinymix set "HPHL Switch" "1" 
root@qcm6490-idp:/opt# tinymix set "HPHR Switch" "1" 
root@qcm6490-idp:/opt# tinymix set "HPHL_RDAC Switch" "1" 
root@qcm6490-idp:/opt# tinymix set "HPHR_RDAC Switch" "1" 
root@qcm6490-idp:/opt# agmplay test.wav -D 100 -d 100 -i "CODEC_DMA-LPAIF_RXTX-RX-0"
  • The audio will automatically stop after playing. If you want to stop it early, you can press Ctrl+C key