To set the audio output to HDMI you need to to
amixer cset numid=3 2
2 Stands for HDMI, 1 would be analog, 0 would be auto, what ever this means.
Try it.
aplay /usr/share/sounds/alsa/Front_Center.wav
Now lets pump up the volume to 0 dB.
amixer cset numid=1 0
Try it again.
aplay /usr/share/sounds/alsa/Front_Center.wav
Done. Isn’t it?