I can't get the audio running. I don't hear anything and can not play anything.
Is there a solution to enable audio?
Sound does not work with an HDMI monitor
This is caused by some computer monitors which select DVI mode even if an HDMI cable is connected. This fix may be necessary even if other HDMI devices work perfectly on the same monitor (or TV)!
Edit the configuration file - see the instructions at Raspberry-Pi Configuration File.
Sound does not work at all, or in some applications
Sound is disabled by default because the ALSA sound driver is still "alpha" (not fully tested) on the R-Pi. To try out sound, from the command prompt before "startx", type
By default output will be automatic (hdmi if hdmi supports audio, otherwise analogue). You can force it with:
where n is 0=auto, 1=headphones, 2=hdmi. (source) If you are running Debian, try
to test analogue output. And to test HDMI.
Also note that you may have to add your user to the 'audio' group to get permission to access the sound card.
Making the changes permanent
I also ran into the same problem with my Raspberry Pi 2. I connected my Pi to my HD TV via an HDMI cable. My solution:
Set the audio output using the following command:
I tested the sound output using the following command, but no sound was heard:
To enable HDMI sound, I followed the directions found here
Reboot Pi using the following command:
I ran into a problem where sound did not work or static played instead of my recording. But it was a problem with my approach, not the Pi itself. I'm using Raspbian 3.6.11 (2013-02-09-wheezy-raspbian).
Primarily, I tried to play an MP3 file with
For more information on audio out commands, I found the following web site useful: http://blog.scphillips.com/2013/01/sound-configuration-on-raspberry-pi-with-alsa
For what it's worth, I was also experiencing a popping sound caused by a voltage jump when the audio starts and stops. That issue is now fixed in the Pi firmware.
I think I have a way for solving your problem, try to type
This is a common bug. I think what's breaking ALSA is PulseAudio. If you want to use ALSA (Default, recommend by Tux) use
For other fixes, try the wiki. It all depends. Try this first (as this is the most common)
On my Raspberry Pi the "speaker-test" worked without any extra hardware added. Then I added some webcams. The default device had changed and I found this question How to make Alsa pick a preferred sound device automatically? from which solution #1 worked for me.
If you want a simple answer there are 3 options:
If you want it playing though your monitor do
If you want both then do
If you have headphones and you want to plug it in your Raspberry do
and then add your file name and there you go; it's that easy