I am having trouble with my Raspberry Pi audio. I have the same problem with two different Pis, using two different TVs, two different HDMI cables, and one set of analogue speakers. To test sound, I have been using the pocket minecraft app that comes installed with the OS which I am hoping is a viable test. I have also been switching between HDMI and analogue audio outputs when the settings have been changed accordingly (I hope).
I get no sound from either of my Pis. I have researched and tried the common solutions for this problem and all except one failed me and the one that didn't will only play one audio file. I have tried following the steps listed in the accepted answer here.
Specifically, changing the config.txt to uncomment hdmi_drive=2
does not get me sound. Neither does changing the config file raspi-config nor using the relevant command sudo amixer -c 0 cset numid=3
with n=2.
What did work was the following three commands:
sudo apt-get install alsa-utils
sudo modprobe snd_bcm2835
sudo aplay /usr/share/sounds/alsa/Front_Center.wav
this audio file played just fine. I get no sound from any other source on either Pi. Please help.