To get sound out the headphone jack type:

sudo modprobe snd_bcm2835
sudo amixer cset numid=3 1

To get sound out the HDMI

sudo modprobe snd_bcm2835
sudo amixer cset numid=3 0

Trouble with omxplayer?

set the -o output for 3.5 audio jack

omxplayer -o local

set the -o output for hdmi

omxplayer -o hdmi

from: http://www.raspians.com/Knowledgebase/no-analog-sound-out-the-headphone-jack/