ALSA: send audio to two audio devices
Here's one way to do it from ~/.asoundrc ; example shows an on-board and soundblaster live card united under the default PCM.
# duplicate audio to both devices
pcm.!default plug:both
ctl.!default {
type hw
card SB
}
pcm.both {
type route;
slave.pcm {
type multi;
slaves.a.pcm "sblive";
slaves.b.pcm "onboard";
slaves.a.channels 2;
slaves.b.channels 4;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
bindings.4.slave b;
bindings.4.channel 2;
bindings.5.slave b;
bindings.5.channel 3;
}
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1; # front left
ttable.1.3 1; # front right
ttable.0.4 1; # copy front left to rear left
ttable.1.5 1; # copy front right to rear right
}
ctl.both {
type hw;
card Live;
}
pcm.onboard {
type dmix
ipc_key 1024
slave {
pcm "hw:0,1"
period_time 0
period_size 2048
buffer_size 65536
buffer_time 0
periods 128
rate 48000
channels 4
}
bindings {
0 0
1 1
2 2
3 3
}
}
pcm.sblive {
type dmix
ipc_key 2048
slave {
pcm "hw:1,0"
period_time 0
period_size 2048
buffer_size 65536
buffer_time 0
periods 128
rate 48000
channels 2
}
bindings {
0 0
1 1
}
}
ctl.onboard {
type hw
card "SB"
}
ctl.sblive {
type hw
card "Live"
}
(Source)
You want to use the multi
-plugin.
Several well documented examples of its use exist:
From the alsa people: https://alsa.opensrc.org/TwoCardsAsOne
From somebody with a similar question here: https://unix.stackexchange.com/a/194631/127903