Testing Audio

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 confit 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

Last updated on 2016-09-12 at 09.42.30 PM Published on 2013-09-17 at 04.07.49 PM