Skip to content

Commit 4471734

Browse files
committed
mono downmix
1 parent 9671a6b commit 4471734

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

desktop/configuration/services.nix

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,62 @@
7676
pipewire = {
7777
extraConfig = {
7878
pipewire = {
79+
"99-mono-downmix" = {
80+
"context.modules" = [
81+
{
82+
name = "libpipewire-module-filter-chain";
83+
args = {
84+
"node.description" = "FiiO KA3 Mono Downmix";
85+
"media.name" = "FiiO KA3 Mono Downmix";
86+
"filter.graph" = {
87+
nodes = [
88+
# 1. Mix Left+Right into a single Mono signal
89+
{
90+
type = "builtin";
91+
name = "mix_mono";
92+
label = "mixer";
93+
control = { "Gain 1" = 0.5; "Gain 2" = 0.5; };
94+
}
95+
# 2. Create a dedicated node for the Left Output
96+
{
97+
type = "builtin";
98+
name = "copy_L";
99+
label = "copy";
100+
}
101+
# 3. Create a dedicated node for the Right Output
102+
{
103+
type = "builtin";
104+
name = "copy_R";
105+
label = "copy";
106+
}
107+
];
108+
# Map System Inputs -> Mixer Inputs
109+
inputs = [ "mix_mono:In 1" "mix_mono:In 2" ];
110+
111+
# Map Copy Nodes -> System Outputs (Each output gets its own unique node)
112+
outputs = [ "copy_L:Out" "copy_R:Out" ];
113+
114+
# Internal Wiring: Send the Mono Mix to BOTH Copy nodes
115+
links = [
116+
{ output = "mix_mono:Out"; input = "copy_L:In"; }
117+
{ output = "mix_mono:Out"; input = "copy_R:In"; }
118+
];
119+
};
120+
"capture.props" = {
121+
"node.name" = "mono_input";
122+
"media.class" = "Audio/Sink";
123+
"audio.position" = [ "FL" "FR" ];
124+
};
125+
"playback.props" = {
126+
"node.name" = "mono_output";
127+
"node.passive" = true;
128+
"audio.position" = [ "FL" "FR" ];
129+
"node.target" = "alsa_output.usb-FiiO_FiiO_KA3_FiiO_KA3-00.analog-stereo";
130+
};
131+
};
132+
}
133+
];
134+
};
79135
"99-simgot-music-eq" = {
80136
"context.modules" = [
81137
{

0 commit comments

Comments
 (0)