PipeWire: Difference between revisions
imported>Fufexan Rewrite alsa-monitor configuration in module-specific option |
imported>Fufexan Add advanced configuration |
||
| Line 41: | Line 41: | ||
}; | }; | ||
}; | }; | ||
</syntaxHighlight> | |||
==Advanced Configuration== | |||
PipeWire can be extensively configured to fit the users' needs. Should the user want to do some fancy routing with null sinks, these can be defined directly in the config as shown below. | |||
This is especially convenient if the user has a multi-channel (8+, or something "weird" like 2x2, 3x2) soundcard that keeps confusing applications with too many channels or a bad channel layout. | |||
<strong>Note</strong>: those cards can be set to the "Pro Audio" profile with <code>pavucontrol</code> so PipeWire doesn't try to guess a wrong channel layout for them. | |||
Arrays are <em>replaced</em> rather than merged with defaults, so in order to keep any default items needing to be kept here, they <strong>have to</strong> be listed (the dummy driver for JACK applications, if JACK support is enabled). | |||
<syntaxHighlight lang="nix"> | |||
services.pipewire = { | |||
config.pipewire = { | |||
"context.objects" = [ | |||
{ | |||
# A default dummy driver. This handles nodes marked with the "node.always-driver" | |||
# properyty when no other driver is currently active. JACK clients need this. | |||
factory = "spa-node-factory"; | |||
args = { | |||
"factory.name" = "support.node.driver"; | |||
"node.name" = "Dummy-Driver"; | |||
"priority.driver" = 8000; | |||
}; | |||
} | |||
{ | |||
factory = "adapter"; | |||
args = { | |||
"factory.name" = "support.null-audio-sink"; | |||
"node.name" = "Microphone-Proxy"; | |||
"node.description" = "Microphone"; | |||
"media.class" = "Audio/Source/Virtual"; | |||
"audio.position" = "MONO"; | |||
}; | |||
} | |||
{ | |||
factory = "adapter"; | |||
args = { | |||
"factory.name" = "support.null-audio-sink"; | |||
"node.name" = "Main-Output-Proxy"; | |||
"node.description" = "Main Output"; | |||
"media.class" = "Audio/Sink"; | |||
"audio.position" = "FL,FR"; | |||
}; | |||
} | |||
]; | |||
}; | |||
}; | |||
</syntaxHighlight> | |||
===Linking nodes=== | |||
The config does not currently cover linking nodes together, but this can be fixed with a script. Soundcard names and ports should be replaced with the ones from the user's configuration: | |||
<syntaxHighlight lang="bash"> | |||
#!/usr/bin/env bash | |||
## Names are found with | |||
# jack_lsp -c | |||
pw-link "Main Output Monitor:monitor_FL" "Komplete Audio 6 Pro:playback_1" | |||
pw-link "Main Output Monitor:monitor_FR" "Komplete Audio 6 Pro:playback_2" | |||
pw-link "M-Audio Fast Track MKII Pro:capture_1" "Microphone:input_MONO" | |||
</syntaxHighlight> | </syntaxHighlight> | ||