Commit: f12c65ad08ecfb452ca65bb4f6085ed89c174646
Parent: a2a578e0cc101b0a0c5e0c0d8df40a6bbd3a127f
Author: Randy Palamar
Date: Sat, 4 Sep 2021 14:47:11 -0600
allow desktop audio to be recorded
this duplicates the output to an alsa loopback device which can be
recorded from.
Diffstat:
1 file changed, 47 insertions(+), 4 deletions(-)
diff --git a/.config/alsa/asoundrc b/.config/alsa/asoundrc
@@ -10,6 +10,12 @@ pcm.!default {
}
}
+pcm.dup {
+ type plug
+ slave.pcm pcm.mdev
+ route_policy "duplicate"
+}
+
pcm.output {
type dmix
ipc_key 1024
@@ -23,6 +29,43 @@ pcm.output {
}
}
+pcm.loop {
+ type dmix
+ ipc_key 1025
+ slave {
+ pcm "hw:Loopback,0,0"
+ buffer_size 8192
+ format S16_LE
+ period_size 1024
+ period_time 0
+ rate 48000
+ }
+}
+
+pcm.loopgain{
+ type softvol
+ slave.pcm pcm.loop
+ control.name "LoopGain"
+ min_dB -3.0
+ max_dB 30.0
+}
+
+pcm.mdev {
+ type multi
+ slaves.a.pcm pcm.output
+ slaves.a.channels 2
+ slaves.b.pcm pcm.loopgain
+ slaves.b.channels 2
+ 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
+}
+
# alias actual mic card to mic
pcm.mic {
type hw
@@ -45,7 +88,7 @@ pcm.dsnooper {
# give mic output a volume control
pcm.micvol {
type softvol
- slave.pcm pcm.output
+ slave.pcm pcm.dup
control.name "MicVol"
}
ctl.MicVol {
@@ -56,20 +99,20 @@ ctl.MicVol {
# software volume
pcm.softvol {
type softvol
- slave.pcm pcm.output
+ slave.pcm pcm.dup
control.name "SoftVol"
}
# mpd volume control
pcm.mpd {
type softvol
- slave.pcm pcm.output
+ slave.pcm pcm.dup
control.name "MPD"
}
# mpv volume control
pcm.mpv {
type softvol
- slave.pcm pcm.output
+ slave.pcm pcm.dup
control.name "MPV"
}