Table of Contents
Check Available Soundcards #
root@imx8mq-trux-q01:~# cat /proc/asound/cards
output
0 [wm8904audio ]: wm8904-audio - wm8904-audio wm8904-audio 1 [imxaudiohdmi ]: imx-audio-hdmi - imx-audio-hdmi imx-audio-hdmi
Check the default Soundcard #
root@imx8mq-trux-q01:~# alsamixer
Now see if the default soundcard selected is “wm8904audio”. If not set default soundcard to “wm8904audio”. To set “wm8904audio” as default sound card
Check the card number for “wm8904audio”
root@imx8mq-trux-q01:~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: wm8904audio [wm8904-audio], device 0: HiFi wm8904-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: imxaudiohdmi [imx-audio-hdmi], device 0: imx8 hdmi i2s-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0
Here the “wm8904audio ” is on card 0.
Now edit /etc/asound.conf and set the below parameter card with card number in these case the card 0.
ctl.!default{ type hw card 0 } ctl.mixer0{ type hw card 0 }
Testing Sound #
Plugin 3.5mm earphones on J20 and run the following test command
root@imx8mq-trux-q01:~# speaker-test -t wav -c 6
Use the following command to play .wav file
root@imx8mq-trux-q01:~# aplay test_audio.wav
NOTE: The default soundcard is set to card0.