【BIGTREETECH PI development board】+08. Audio test (zmj)
The BIGTREETECH Pi development board has a 3.5mm audio interface that can be used to play music and record. In theory, you can listen to music while playing with the development board (●''●)
1. Program Installation
The BIGTREETECH Pi development board system supports various common audio player software. You can choose according to your own preferences. I have installed a lot of them...
//------播放器及依赖安装(可选)
sudo apt install zoom-player wordplay wdisplays \
vdr-plugin-mplayer smplayer sidplay qtav-players \
playmidi playerctl multimedia-players node-react-audio-player \
mplayer* media-player-info madplay gbsplay alsaplayer*
2. Audio test
For detailed information about each test item, refer to the Log record.
2.1 Sound card detection
The sound card detection can be checked through "aplay -l" or "aplay -L". From the log information, you can see that there are three sound cards: card-0/card-1/card-2.
Functional division: card-0 is used to process multimedia, system and companion streams; card-1 is the audio stream of the HDMI interface; card-2 is the audio codec of the CPU. Here we mainly test card-0.
The specific principle of dividing the sound card in the system of BIGTREETECH Pi development board has not been studied in depth. It should be related to the device tree and driver.
2.2 Audio Playback
Audio playback I tested "gst-play-1.0 (plays mp3/wav files)" and "aplay (plays wav files)".
2.3 Recording function
The recording function includes the test of recording and playing recording. The recording uses "arecord" and the playing recording uses "gst-play-1.0".
//------声卡检测
biqu@BTT-CB1:~/zmj_ws/music$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndahub [sndahub], device 0: Media Stream sunxi-ahub-aif1-0 [Media Stream sunxi-ahub-aif1-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sndahub [sndahub], device 1: System Stream sunxi-ahub-aif2-1 [System Stream sunxi-ahub-aif2-1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sndahub [sndahub], device 2: Accompany Stream sunxi-ahub-aif2-2 [Accompany Stream sunxi-ahub-aif2-2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: allwinnerhdmi [allwinner-hdmi], device 0: hdmi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Codec [H616 Audio Codec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
//------音频播放(mp3和wav)
biqu@BTT-CB1:~/zmj_ws/music$ find / -name *.mp3
./Born a Stranger.mp3
./The promise.mp3
biqu@BTT-CB1:~/zmj_ws/music$ gst-play-1.0 ./
Press 'k' to see a list of keyboard shortcuts.
Now playing /usr/share/myir/Music/Born a Stranger.mp3
Redistribute latency...
0:01:41.7 / 0:01:41.7
Now playing /usr/share/myir/Music/The promise.mp3
Redistribute latency...
0:03:15.8 / 0:03:15.8
Reached end of play list.
biqu@BTT-CB1:~/zmj_ws/music$ ll /usr/share/sounds/alsa/
total 5076
-rw-rw-r-- 1 root root 1982048 Mar 3 09:10 audio.wav
-rw-r--r-- 1 root root 137134 Dec 7 2020 Front_Center.wav
-rw-r--r-- 1 root root 142128 Dec 7 2020 Front_Left.wav
-rw-r--r-- 1 root root 146990 Dec 7 2020 Front_Right.wav
-rw-rw-r-- 1 root root 1972332 Mar 3 09:10 mute.wav
-rw-r--r-- 1 root root 135202 Dec 7 2020 Noise.wav
-rw-r--r-- 1 root root 130096 Dec 7 2020 Rear_Center.wav
-rw-r--r-- 1 root root 126064 Dec 7 2020 Rear_Left.wav
-rw-r--r-- 1 root root 146480 Dec 7 2020 Rear_Right.wav
-rw-r--r-- 1 root root 134868 Dec 7 2020 Side_Left.wav
-rw-r--r-- 1 root root 129966 Dec 7 2020 Side_Right.wav
biqu@BTT-CB1:~/zmj_ws/music$ aplay /usr/share/sounds/alsa/audio.wav
Playing WAVE '/usr/share/sounds/alsa/audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
biqu@BTT-CB1:~/zmj_ws/music$ aplay /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
//------录音功能(包括录音和播放录音)
biqu@BTT-CB1:~/zmj_ws/music$ arecord -f cd audio_test.wav
Recording WAVE 'audio_test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stere
o ^
CAborted by signal Interrupt..
biqu@BTT-CB1:~/zmj_ws/music$ gst-play-1.0 audio_test.wav
Press 'k' to see a list of keyboard shortcuts.
Now playing audio_test.wav
Redistribute latency...
0:00:18.6 / 0:00:18.6
//------声卡设置(包括音量调节)
biqu@BTT-CB1:~/zmj_ws/music$ alsamixer
2.4 Sound Card Settings
Each sound card can be configured using "alsamixer", which is a graphical configuration tool used to configure various audio parameters. The command can be used to set the volume of the headphone output.
//------alsamixer comprehensive interface:
//------alsamixer view help F1:
//------end