I recently upgraded my PC from Ubuntu 8.04 to 10.04. It works great, except the sound. Stereo is doing well, but when I change it to 5.1 surround it starts stuttering, hicking are whatever you might call it; It just doesn't work...

Luckely I found a solution (or is it a workarround?) by disabling pulse-audio, setup alsa for surround and using xine (for displaying video with 5.1 surround).
Here's what I did (all cursive commands should be run in terminal).

First, disable pulse-audio
touch ~/.pulse-a11y-nostart
echo autospawn = no|tee -a ~/.pulse/client.conf
killall pulseaudio

btw, you can undo above with:

rm ~/.pulse-a11y-nostart
rm ~/.pulse/client.conf

Second, setup Alsa

Edit or create .asoundrc in your home directory

sudo gedit ~/.asoundrc

and add this:

pcm.dsp {
type plug
slave.pcm "dmixer"
}
pcm.!default {
type plug
slave.pcm "surround51"
slave.channels 6
route_policy duplicate
}
ctl.!default {
type hw
card 0
}
pcm.ch51dup {
slave.pcm surround51
slave.channels 6
type route
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
pcm.dmixer  {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
#   period_time 84000
#   period_size 2048
#   buffer_time 340000
rate 44100
#   rate 48000
period_size 1024
#    buffer_size 2052
buffer_size 4096 # this is the size of buffer I use
#   buffer_size 8192
#   buffer_size 16384
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}

Third, install and configure Xine (manually)
sudo apt-get install xine-ui
sudo gedit ~/.xine/config

uncomment and change these lines 
(you can also do this in xine itself, but when I want to select a speaker-arrangement xine stops responding)

audio.driver:alsa
audio.output.speaker_arrangement:Surround 5.1

Finally, restart and test

Restart your PC and test your speakers with:

speaker-test -Dplug:surround51 -c6 -l1 -twav

and finally start xine, open a movie with 5.1 surround and see if it works!

Joomla templates by a4joomla