But I want a software mixer. Pulseaudio to the rescue! Apart from the fact that the documentation of remap-sink leaves a bit to desire, this is fairly easy. First, our ~/.asoundrc reduces to
hint.description "ALSA Pulse output"
description "AC3 output"
Next, we copy /etc/pulse/default.pa to ~/.pulse/ and add the following to the .fail section:
load-module module-alsa-sink sink_name=Surround5.1 device=ac3 rate=48000 channels=6 mmap=0 channel_map=front-left,front-right,rear-left,rear-right,center,lfe
load-module module-remap-sink sink_name=Stereo2.1 master=Surround5.1 channels=3 channel_map=front-left,front-right,lfe master_channel_map=front-left,front-right,lfe remix=0
Surprisingly, the remap-sink module automatically seems to do the right thing to the mono channels (i.e., sum of left and right)
Not directly related to the upmix task, but useful as we're going to disable auto detection:
load-module module-alsa-sink sink_name=Headphones device=hw:0,0 rate=48000 channels=2 mmap=0
load-module module-alsa-source device=hw:0,0
Also, I'd like to have Stereo2.1 being my default like:
Hmm, while we're at it, 4.1 upmix may be nice as well:
load-module module-remap-sink sink_name=Stereo4.1 master=Surround5.1 channels=5 channel_map=front-left,front-right,lfe,front-left,front-right master_channel_map=front-left,front-right,lfe,rear-left,rear-right remix=0
Talking about disabling auto detection, comment out module-udev-detect:
# load-module module-udev-detect
We may also want to avoid unnecessary conversion from 48k to 44k1 and back to 48k, thus edit /etc/pulse/daemon.conf (or better copy it to ~/.pulse/ and edit it there) to set
default-sample-rate = 48000
And you know what I should have googled for to directly find the solution as outlined in this part of my little serial?