Pulse
From Jon's Wiki
If you have spent days and days fucking around trying to get sound to work with your NVidia 220GT HDMI, you have to use hw:0,7 not hw:0,3 which is the first thing pulse sees, and you need to unmute it in ALSA.
sudo apt-get install alsamixergui
Run alsamixergui and UNMUTE ALL FOUR FUCKING SPDIF CHANNELS.
Surround sound
Since I have a surround HDMI amplifier, I use this in /etc/pulse/default.pa after the autodetect phase (which you might still want when you plug in USB devices for instance):
load-module module-alsa-sink device=hw:0,7 channels=6 \ channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe
and in /etc/pulse/daemon.conf you need:
default-sample-channels = 6 default-channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
Support for 24 bit 96 kHz audio
Make Pulse use 32 bit samples in /etc/pulse/daemon.conf and bump up the sample rate:
default-sample-format = s32le default-sample-rate = 96000