There are a lot of HOWTOs which describe how to setup your 5.1 speakers/card, but none of them met my needs, nor they explained what they really did. So here is my little how to.
For this HOWTO to work:
1. your sound card should be working and it has to have analog output,
2. you have to have 5.1 speakers,3. you have to use ALSA.
1. First problem: When listening to stereo music there are 3 situations I encourted:
1. only two front speakers work (center, woofer and rear don't work), or
2. two front speakers, center and woofer work, or
3. all six speakers work, but then it's not true stereo because the center speaker works, too.
Solution:
Create a .asoundrc in your home directory, type this in your console:
in Ubuntu:
in Kubuntu:
and paste this text in it:
Code:
pcm.!default {
type route
slave.pcm surround51
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.5 0.5
ttable.1.5 0.5
}
save it and close it.
Explanation:
Whit this we replaced the default alsa device with our own. This basically copies:
front-left -> rear-left,
front-right -> rear right,
0.5*front-left -> LFE (woofer)
0.5*front-right -> LFE (woofer). The center speaker isn't used, because when you play stereo, you don't need it.
If anyone is interested here is a more detailed explanation:
#0=Front-left
#1=Front-right
#2=Rear-left
#3=Rear-right
#4=Center
#5=LFE (woofer)
ttable.0.0 1 (copy from front-left to front-left 100% of volume)
ttable.1.1 1 (copy from front-right to front-right 100% of volume)
ttable.0.2 1 (copy from front-left to rear-left 100% of volume)
ttable.1.3 1 (copy from front-right to rear-right 100% of volume)
ttable.0.5 0.5 (copy from front-left to LFE 50% of volume)
ttable.1.5 0.5 (copy from front-right to LFE 50% of volume)
Start your mp3 player and start playing a stereo mp3 file. You should here music on all speakers except the center one. You don't have to configure anything, because all the players will use alsa default device, which we modified. If you previously selected another device in your player (like for instance "surround51" or "plug:surround51"), just select default (in alsa plugin).
-----------------
2. Second problem: While playing AC3/DTS 5.1 movies, only 2 front speakers are working.
Solution:
For this to work, you just have to configure your video player.
Here are some of the player's configurations:
Mplayer (Updated)
Mplayer will automatically select the best output if you select driver default in the alsa plugin:
Preferences->Audio, Select alsa, Configure driver;
for Device select driver default.
Xine and derivates
I recommend Xine player and other players that use xine engine (Kaffeine), because xine can use different alsa devices for different audio files.
Open Xine Settings->Setup (or in Kaffeine Settings->xine engine parameters), go to audio and configure these parameters:
driver: alsa
Speaker arrangement: 5.1 surround
device used for mono output: default
device used for stereo output: default
device used for 5.1-channel output: plug:surround51:0
Push OK, and everything is setup.
VLC
In VLC Settings->Preferences, Audio->Output modules (enable Advanced otpions), for Audio output module select ALSA audio output; then in Output modules select go to ALSA, and make sure that for Default is selected fo ALSA Device Name.
When playing a stereo file, you don't have to do anything, because VLC automatically selects stereo output, but when playing a 5.1 surround movie, while the movie is playing you have to select: Audio->Audio Device->5.1 (every time you stop and start the playback, you have to do this again).
Other mp3 players(XMMS, Audacious)
Just select the ALSA output plugin and make sure that the alsa device selected is default.
That's the end of this HOWTO, I hope it helps someone out there 
Changelog:
15.08.2008. Changed configuration of Mplayer
Bookmarks