It turns out that sound under Ubuntu is bewilderingly complex, and no one understands it.
However, it does work on my system, for some arbitrarily complicated definition of 'work'.
Trying to play back an mp3 the other day, I noticed that my speakers were making a terrible hissing noise.
This turned out to be coming from the central speaker only, and I thought it was because only the front left and front right speakers were being driven at all. Others seemed to be floating and making horrible noises.
To check this:
$ speaker-test -Dplug:surround51 -c6 -twav
A nice young lady will speak over all 6 speakers. That will tell you which ones are working.
At first, I only had the front left and front right working.
To get some more working I used:
Which is an arrow-keys and cursor terminal program.
The crucial piece of information was that MM stands for mute. If you go to a thing marked MM and press the m key then it becomes unmuted/unmuted.
I just ran up and down all the controls, randomly increasing volumes and muting/unmuting things.
This was enough to get all the speakers working as witnessed by the young lady. Although at first when she said 'front left' I could hear that over both front left and front center, and there were other interactions too.
A second breakthrough was when I noticed 'press F5' to show input sources as well as outputs.
It turned out that 'SB Live', or as it says above 'SB Live Analog/Digital Output Jack' is what's producing most of the hiss. Mute that, and everything gets much clearer.
There are a vast number of volume controls and things to mute and unmute.
As far as the young lady's voice goes, it seems that:
'Surround' controls the two rear speakers.
'PCM' controls the front left and right but not the centre
Center controls the front centre
LFE makes 'rear centre' come out over the front centre speaker.
'3D control, and two associated volume sliders' appear to control whether 'rear centre' gets put out over the other speakers.
'Sigmatel Surround' seems to mix some of the channels in with some of the others. Presumably for a 4-speaker set-up?
When I'd finished playing, I had each of the young lady's sayings coming over one and only one speaker, and could verify that they were all working. Presumably that's how it should be set up?
But at that point, I noticed that I'd completely lost the ability to play music, either through mplayer or totem.
Christ knows why, but they seem to work through some other related but different system which interacts with the ALSA thing in unpredictable ways.
Logging in and out cured the 'no music' problem. Don't know why.
It also turns out that the main volume control on the desktop/taskbar buggers up the settings in alsamixer. If you turn it up too high, then all sorts of distortion effects start happening, but when you turn it back down, they don't go away!
If you then go back to alsamixer, you find that a lot of the volume controls there have been moved into the red. Put them back to sensible values and the horror stops.
Anyway, whatever. I don't understand it at all, and I really can't imagine that this is how it's supposed to work. But at the moment I'm listening to Vaughan Williams in what appears to be stereo, over all 5 speakers and the woofer, and the speaker test can control all the little ones individually.
The situation seems roughly the same in 10.10, but it all seems to work a bit better, with speaker tests built in to the volume control icon, better default settings, and turning the volume up too high doesn't seem to permanently derange the alsamixer settings. Maybe I'm just getting used to it.