The method of using commands to play audio
1.Headphone interface playback audio test
1) First insert the earphone into the earphone jack of the development board
2) Then you can use the aplay -l command to view the sound card devices supported by the linux system. From the output below, we can see that card 2 is the sound card device of es8388, that is, the sound card device of the headset
orangepi@orangepi:~$ aplay -l **** List of PLAYBACK Hardware Devices ****
card 1: rockchiphdmi0 [rockchip-hdmi0], device 0: rockchip-hdmi0 i2s-hifi-0 [rockchip-hdmi0 i2s-hifi-0]
card 2: rockchipes8388 [rockchip-es8388], device 0: dailink-multicodecs ES8323.6-0010-0 [dailink-multicodecs ES8323.6-0010-0]
|
3) Then use the aplay command to play the audio file that comes with the system. If the earphone can hear the sound, it means that the hardware can be used normally.
rangepi@orangepi:~$ aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo |
2.HDMI audio playback test
1) First use the HDMI to HDMI cable to connect the Orange Pi development board to the TV (other HDMI monitors need to ensure that they can play audio)
2) Then check the serial number of the HDMI sound card. From the output below, you can know that the HDMI sound card is card 1
orangepi@orangepi:~$ aplay -l **** List of PLAYBACK Hardware Devices ****
card 1: rockchiphdmi0 [rockchip-hdmi0], device 0: rockchip-hdmi0 i2s-hifi-0 [rockchip-hdmi0 i2s-hifi-0]
card 2: rockchipes8388 [rockchip-es8388], device 0: dailink-multicodecs ES8323.6-0010-0 [dailink-multicodecs ES8323.6-0010-0]
|
3) Then use the aplay command to play the audio file that comes with the system. If the HDMI monitor or TV can hear the sound, it means that the hardware can be used normally
orangepi@orangepi:~$ aplay -D hw:1,0 /usr/share/sounds/alsa/audio.wav |