Read
http://www.alsa-project.org/alsa-doc...&module=cs46xx
Do not use the ; when you compiling ALSA or any programs because the ; means do the command then do the next command without worrying about any errors. During compiling, you want to worry about errors because the program or module (driver) will not work as stable as it should. I suggest using && in place of ; because it does the first command and then continues to the next command only if the previous command does not have any errors.
To compile ALSA, you will need gcc and a matching kernel source code (aka kernel headers or kernel devel).
The only time you will get 5.1 sound output is when you are playing a DVD movie or a video/audio file has 5.1 encoded. Also make sure you adjusted the controls in alsamixer like surround, center, subwoofer.
Below is an example command line you can use to output 5.1 sound.
mplayer dvd://1 -channels 6 -ao alsa:device=surround51