There are a few reasons why this could be happening.
Possible Problem #1: Wrong RasPi hardware audio output selected (auto vs. HDMI vs. headphone/pwm out)
Solution: Force selection of the correct hardware.
amixer cset numid=3 0 # automatic detection (not always reliable)
amixer cset numid=3 1 # force headphone (PWM) output
amixer cset numid=3 2 # force HDMI output
I like to put these as aliases in my .bashrc
file so I don't have to remember the commands:
alias use-audio-auto="amixer cset numid=3 0" # auto
alias use-audio-headphones="amixer cset numid=3 1" # headphones
alias use-audio-hdmi="amixer cset numid=3 2" # hdmi
Possible Problem #2: Misconfigured ALSA subsystem / misconfigured .asoundrc
Solution: Make sure ALSA is configured correctly with good defaults for the RasPi hardware. The /home/pi/.asoundrc
file should contain:
pcm.mmap0 {
type mmap_emul;
slave {
pcm "hw:0,0";
}
}
pcm.!default {
type hw;
card 0;
}
ctl.!default {
type hw;
card 0;
}
Possible Problem #3: Wrong hardware output device chosen by aplay
Solution: Check what devices are available using aplay -l
Run aplay -l
to list playback devices detected, you should see something like this that references bcm2835
:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
If you're trying to test the headphone out, you'd force usage of it with:
aplay -Dhw:0,0 test.wav # 'try playing test.wav using hardware card 0, subdevice 0 (headphones)
Then, if you'd like to change the default for your Raspberry Pi, adjust your .asoundrc
file to use the right hardware card index #.
Possible Problem 4: Your sound is simply muted/too low and you need to turn it up.
Solution: Make sure alsa-utils
is installed and run alsamixer
sudo apt-get install -y alsa-utils
alsamixer
Then use the F1-F6 keys and UI to push up the volume.

Use the arrow keys to jack up the volume and quit.
To save what you changed in alsamixer
as defaults, do:
sudo alsactl store 0
Hope that helps! Peace.