Posted on 5 Comments

Raspberry Pi: Test Sound Output

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.

Enter:

cat /proc/asound/modules

Output:

0 snd_bcm2835
1 snd_usb_audio

Then use 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.

Using omxplayer to test mp3 or wav sound file

omxplayer example.mp3

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

 

 

5 thoughts on “Raspberry Pi: Test Sound Output

  1. Hola! Gracias por el artículo. Una pregunta, sabes cómo podría subir y bajar el volumen de un video al vivo utilizando omxplayer y comandos de alsa?

  2. Hello there! Ran the test (trying default audio… analog ‘headphone’ port on RPi4. No audio. Worked fine before today… what changed? Added a BT headphone… but i have subsequently unpaired AND disabled BT AND selected analog audio as my ouput on the RPi4. Somehow along the way the BT process killed my analog output (?). Any thoughts? I ran raspi-config and forced it to analog (no joy). Strange.

  3. Thank you ! What is the sound is going out only from 1 side ?

    Only front right …

    0 – Front Left
    1 – Front Right
    Time per period = 2.412105
    0 – Front Left
    1 – Front Right
    Time per period = 3.082382
    0 – Front Left
    1 – Front Right
    Time per period = 2.897609
    0 – Front Left
    1 – Front Right
    Time per period = 3.069843
    0 – Front Left
    1 – Front Right
    Time per period = 3.068916
    0 – Front Left
    1 – Front Right
    Time per period = 2.910872
    0 – Front Left
    1 – Front Right

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.