-
Notifications
You must be signed in to change notification settings - Fork 0
/
.asoundrc
231 lines (217 loc) · 4.63 KB
/
.asoundrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# pcm.!default { # uses ALSAPCM env var to optionally set different alsa devices. for eg, run `ALSAPCM=voicechat firefox` to (hopefully) allow mic usage by default in browser.
# type plug
# slave.pcm {
# @func getenv
# vars [ ALSAPCM ]
# default "desktop"
# }
# }
# ctl.!default {
# type hw
# card Loopback
# }
pcm.desktop { # asym device, sets up capture and playback into one package
type asym
playback.pcm "plug:globalrouter"
capture.pcm "desktopsnooper"
hint {
show on
description "for loopback playback and capture."
}
}
pcm.voicechat {
type asym
playback.pcm "plug:globalrouter"
capture.pcm "micsnooper"
hint {
show on
description "for loopback playback and mic capture."
}
}
pcm.everything {
type asym
playback.pcm "globalrouter"
capture.pcm "capturemulti"
}
ctl.everything {
type hw
card PCH
}
pcm.capturemulti {
type multi
slaves.a.pcm "desktopsnooper"
slaves.a.channels 2
slaves.b.pcm "micsnooper"
slaves.b.channels 2
bindings.0 { slave a; channel 0; }
bindings.1 { slave a; channel 1; }
bindings.2 { slave b; channel 0; }
bindings.3 { slave b; channel 1; }
}
# duplicate audio between the 2 sets of 2 channels in globalquader
pcm.globalrouter {
type plug
route_policy "duplicate" # this is very clamplicated
slave.pcm "globalquader"
}
pcm.globalquader { # creates a multi device called globalquader that has 4 channels instead of 2. the first 2 channels use desktop audio (loopback in my case), and the other two use the speaker (hw:PCH in my case).
type multi
master 1 # set slave b as the master child, meaning all clock timing and other sound shenanigans are based on that instead of the fake loopback device.
slaves.a.pcm "desktopmixer"
slaves.a.channels 2
# slaves.b.pcm "globalfifo"
slaves.b.pcm "globalsoftvol"
slaves.b.channels 2
bindings.0 { slave a; channel 0; }
bindings.1 { slave a; channel 1; }
bindings.2 { slave b; channel 0; }
bindings.3 { slave b; channel 1; }
}
pcm.globalsoftvol { # softvol lets you add a software volume control to anything. maximum loudness is always dependent on hardware volume.
type softvol
slave {
pcm globalmute
}
control {
name "Global"
card Loopback
}
}
pcm.globalmute { # since softvol alone doesn't support it somehow
type softvol
slave {
pcm speakermixer
}
control {
name "GlobalMute"
card Loopback
}
resolution 2
}
pcm.speakermixer { # dmixer for my sound card, hw:PCH. does the same as desktopmixer, but affects the hardware sound output.
type dmix
ipc_key 1112
slave {
pcm "hw:PCH,0"
rate 48000
format S16_LE
channels 2
period_size 512
periods 4
}
}
# hw:Loopback,[0 = capture, 1 = playback],[subdevice 0-7]
pcm.desktopmixer { # dmixer for the loopback device. essentially mixes all playback streams going into the loopback together into this sub-device.
type dmix
ipc_key 1111
slave {
pcm "hw:Loopback,0,0"
rate 48000
format S16_LE
channels 2
period_size 512
periods 4
}
}
pcm.desktopsnooper { # dnsooper for the loopback. similar to dmixer, it allows multiple clients to capture sound from the same card input (microphone), so you can record your voice while calling your friends.
type dsnoop
ipc_key 2222
slave {
pcm "hw:Loopback,1,0"
rate 48000
format S16_LE
channels 2
period_size 512
periods 4
}
}
# web mic setup, uses dsnoop
pcm.micsnooper{
type dsnoop
ipc_key 2223
slave {
pcm "hw:BRIO"
rate 48000
format S16_LE
channels 1
period_size 512
periods 4
}
}
pcm.mpd {
type asym
playback.pcm "plug:mpdrouter"
capture.pcm "mpdsnooper"
hint {
show on
description "for playing from and recording MPD."
}
}
pcm.mpdrouter {
type plug
route_policy "duplicate"
slave.pcm "mpdquader"
}
pcm.mpdquader {
type multi
master 1
slaves.a.pcm "mpdmixer"
slaves.a.channels 2
slaves.b.pcm "mpdsoftvol"
slaves.b.channels 2
bindings.0 { slave a; channel 0; }
bindings.1 { slave a; channel 1; }
bindings.2 { slave b; channel 0; }
bindings.3 { slave b; channel 1; }
}
pcm.mpdsoftvol {
type softvol
slave {
pcm speakermixer
}
control {
name "MPD"
card Loopback
}
}
pcm.mpdmixer {
type plug
slave.pcm {
type dmix
ipc_key 1113
slave {
pcm "hw:Loopback,0,1"
rate 48000
format S16_LE
channels 2
period_size 512
periods 4
}
}
}
pcm.mpdsnooper {
type dsnoop
ipc_key 2224
slave {
pcm "hw:Loopback,1,1"
format S16_LE
channels 2
period_size 512
periods 4
}
}
pcm.jack {
type jack
playback_ports {
0 system:playback_1
1 system:playback_2
}
capture_ports {
0 system:capture_1
1 system:capture_2
}
}
ctl.mixer0 {
type hw
card 0
}