If you’re wondering how to test the left and right audio channel of your Raspberry Pi whether using an external USB sound device or the builtin audio you’ve come to the right place.
Connect to your Raspberry Pi via SSH or open the Terminal application. The simplest way to test the sound is to use the
speaker-test command. Enter the following to test sound from your default configured audio device.
speaker-test -c2 -twav -l7
You should hear an alternating sound coming from your left and right speakers.
If you’re using a USB sound device you first need to check its device id/number.
0 snd_bcm2835 1 snd_usb_audio
speaker-test -c2 -twav -l7 -D plughw:N,0 replacing N with the number before
snd_usb_audio. Like this:
speaker-test -c2 -twav -l7 -D plughw:1,0
Output should the same as the picture above and alternating sound from left and right audio from your speakers.
omxplayer to test mp3 or wav sound file
The above command will auto-detect or use any default configured audio device. Otherwise, if you want to test your USB Sound device enter the following command with 1 as the device number:
omxplayer example.mp3 -o alsa:hw:1,0