... | ... | @@ -625,6 +625,133 @@ context.modules = [ |
|
|
]
|
|
|
```
|
|
|
|
|
|
# Combine streams
|
|
|
|
|
|
These are virtual devices that can combine multiple sinks or sources into one new virtual sink or source.
|
|
|
|
|
|
The streams to merge into one are selected with [match rules](Config-PipeWire#rules).
|
|
|
|
|
|
The features are implemented with the `libpipewire-module-combine-stream` module. Please refer to the
|
|
|
[documentation](https://docs.pipewire.org/page_module_combine_stream.html) For more information.
|
|
|
|
|
|
## Combine sink (all sinks)
|
|
|
|
|
|
The following example loads a new virtual sink that sends the output to all other sinks.
|
|
|
|
|
|
This is also the default behaviour when stream.rules is not defined.
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-combine-stream
|
|
|
args = {
|
|
|
combine.mode = sink
|
|
|
node.name = "combine_sink"
|
|
|
node.description = "My Combine Sink"
|
|
|
combine.props = {
|
|
|
audio.position = [ FL FR ]
|
|
|
}
|
|
|
stream.props = {
|
|
|
}
|
|
|
stream.rules = [
|
|
|
{
|
|
|
matches = [ { media.class = "Audio/Sink" } ]
|
|
|
actions = { create-stream = { } }
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
## Combine sink (selected channels and sinks)
|
|
|
|
|
|
The following example merges 3 stereo sinks into a 5.1 virtual device:
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-combine-stream
|
|
|
args = {
|
|
|
combine.mode = sink
|
|
|
node.name = "combine_sink_5_1"
|
|
|
node.description = "My 5.1 Combine Sink"
|
|
|
combine.props = {
|
|
|
audio.position = [ FL FR FC LFE SL SR ]
|
|
|
}
|
|
|
stream.props = {
|
|
|
stream.dont-remix = true # link matching channels without remixing
|
|
|
}
|
|
|
stream.rules = [
|
|
|
{ matches = [
|
|
|
{ media.class = "Audio/Sink"
|
|
|
node.name = "alsa_output.usb-Topping_E30-00.analog-stereo"
|
|
|
} ]
|
|
|
actions = { create-stream = {
|
|
|
combine.audio.position = [ FL FR ]
|
|
|
audio.position = [ FL FR ]
|
|
|
} } }
|
|
|
{ matches = [
|
|
|
{ media.class = "Audio/Sink"
|
|
|
node.name = "alsa_output.usb-BEHRINGER_UMC404HD_192k-00.pro-output-0"
|
|
|
} ]
|
|
|
actions = { create-stream = {
|
|
|
combine.audio.position = [ FC LFE ]
|
|
|
audio.position = [ AUX0 AUX1 ]
|
|
|
} } }
|
|
|
{ matches = [
|
|
|
{ media.class = "Audio/Sink"
|
|
|
node.name = "alsa_output.pci-0000_00_1b.0.analog-stereo"
|
|
|
} ]
|
|
|
actions = { create-stream = {
|
|
|
combine.audio.position = [ SL SR ]
|
|
|
audio.position = [ FL FR ]
|
|
|
} } }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
## Combine source (selected channels and sources)
|
|
|
|
|
|
Below is an example configuration that makes a 4.0 virtual audio source
|
|
|
from 2 separate stereo sources.
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-combine-stream
|
|
|
args = {
|
|
|
combine.mode = source
|
|
|
node.name = "combine_source_4_0"
|
|
|
node.description = "My 4.0 Combine Source"
|
|
|
combine.props = {
|
|
|
audio.position = [ FL FR SL SR ]
|
|
|
}
|
|
|
stream.props = {
|
|
|
stream.dont-remix = true
|
|
|
}
|
|
|
stream.rules = [
|
|
|
{ matches = [
|
|
|
{ media.class = "Audio/Source"
|
|
|
node.name = "alsa_input.usb-046d_HD_Pro_Webcam_C920_09D53E1F-02.analog-stereo"
|
|
|
} ]
|
|
|
actions = { create-stream = {
|
|
|
audio.position = [ FL FR ]
|
|
|
combine.audio.position = [ FL FR ]
|
|
|
} } }
|
|
|
{ matches = [
|
|
|
{ media.class = "Audio/Source"
|
|
|
node.name = "alsa_input.usb-046d_0821_9534DE90-00.analog-stereo"
|
|
|
} ]
|
|
|
actions = { create-stream = {
|
|
|
audio.position = [ FL FR ]
|
|
|
combine.audio.position = [ SL SR ]
|
|
|
} } }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
# Other virtual devices
|
|
|
|
|
|
Other virtual devices can be created, depending on the source of the data:
|
... | ... | |