FAQ055
From the ALSA wiki
Of course the single modular approaches are combinable:
- You can upmix 2.0 to 5.1 sound, then put that into a 5.1 dmix and the dmix to the soundcard. And then set the 2.0->5.1 as default.
- You can then additionally use the 5.1 dmix for mixing in just rear speaker sounds.
After installing below .asoundrc you should be able to access following pcms with your applications, eg. xmms:
default, duplex - record and play sound (2.0->5.1) at the same time with multiple apps. ch51dup - upmix 2.0 to 5.1) ch31dup - upmix 2.0 to 3.1 dmix2 - don't upmix, just dmix fr - front speakers only rr - rear speakers only lfe - center, subwoofer only (left, right channel)
and of course all of the above at the same time by different applications without a hardware mixing sound card.
All you might have to adjust is in: snd_card and dmix6
Have a look at my .asoundrc (for a intel-8x0):
# Set default sound card
# Useful so that all settings can be changed to a different card here.
pcm.snd_card {
type hw
# card nForce2
card 0
}
pcm.dmix6 {
type dmix
ipc_key 1024
ipc_key_add_uid false # let multiple users share
ipc_perm 0660 # IPC permissions (octal, default 0600)
slave {
pcm snd_card # see below
rate 48000
channels 6
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}
#route for stereo only
pcm.dmix20 {
type route
slave.pcm "dmix6"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
}
#route for stereo sound+center+subwoofer
pcm.ch31dup {
type route
slave.pcm "dmix6"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
pcm.ch51dup {
type route
slave.pcm dmix6
slave.channels 6
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.duplex {
type asym
playback.pcm "ch51dup"
# playback.pcm "dmix2"
# capture.pcm "mydsnoop"
capture.pcm "snd_card"
}
###################
# CONVERSION PLUG #
###################
# Setting the default pcm device allows the conversion
# rate to be selected on the fly.
# duplex mode allows any alsa enabled app to read/write
# to the dmix plug (Fixes a problem with wine).
pcm.!default {
type plug
slave.pcm "duplex"
}
pcm.dsp "duplex"
pcm.dsp1 "duplex"
pcm.fr {
type route
slave.pcm "dmix6"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
}
pcm.rr {
type route
slave.pcm "dmix6"
slave.channels 6
ttable.0.2 1
ttable.1.3 1
}
pcm.lfe {
type route
slave.pcm "dmix6"
slave.channels 6
ttable.0.4 1
ttable.1.5 1
}
Good luck !