Testing!

OK now that you've configured ALSA depending on your OS...that's it! Now reboot with sudo reboot and log in again, you can test with speaker-test by running

speaker-test -c2

Which will play white noise through the left and right 'speakers' on the audio card. Once you've got something coming out, try to play an audio file with speaker-test (for WAV files, not MP3)

speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav

If you want to play a stream of music, you can try

sudo apt-get install mpg123
mpg123 http://ice1.somafm.com/u80s-128-mp3

If you want to play MP3's on command, check out this tutorial which covers how to set that up

Headphone vs Audio card

Don't forget, you still have the built in headphone jack on the Pi, if you edited alsa.conf it might be called card 1 now (not the default card 0)

You can run aplay -l to list the devices

If you want to aplay through a specific card, specify card 1 with -D plughw:1,0 or card 0 -D plughw:0,0 etc

speaker-test -c2 -D plughw:1,0

aplay --device=hw:1,0 test.wav

This guide was first published on Sep 17, 2013. It was last updated on Mar 08, 2024.

This page (Testing Audio) was last updated on Mar 08, 2024.

Text editor powered by tinymce.