How to split 7.1 soundcard outputs to 4 stereo outs with ALSA

I have a Xonar DX (CMI8788 driver) 7.1 surround sound card installed on my Ubuntu 11.10 system.

I want to use the outputs of the card as 4 separate stereo outputs and I am struggling with ALSA to get it to work.

This is my asound.conf:

#/etc/asound.conf
pcm_slave.eightchannels {
        pcm "hw:0,0"            # or "hw:1,0" for the second card
        channels 8
}
pcm.stereo1 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 2 3 ]
        }
}
pcm.stereo2 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 4 5 ]
        }
}
pcm.stereo3 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 6 7 ]
        }
}
pcm.stereo4 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 0 1 ]
        }
}

This is my aplay -l output:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: DX [Xonar DX], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: DX [Xonar DX], device 1: Digital [Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This is my aplay -L output: http://pastebin.com/MYvxFvVr

The system seems to completely ignore my configuration. However, I am sure that the config is used, because when i insert a random string at the top, i get a parsing error.

Any help is greatly appreciated.


The solution for me was to change the eightchannels pcm definition to:

pcm_slave.eightchannels {
        pcm "surround71:DX,0" # use the string identifier instead of the card id
        channels 8
}