... | ... | @@ -6,10 +6,57 @@ These are devices that do not correspond to real hardware devices but are handle |
|
|
|
|
|
There are two types of virtual devices:
|
|
|
|
|
|
1) [Single nodes](#single-nodes) in the graph. They are usually implemented with null-sink and have input/output ports that need to be linked manually (with pw-link) after creation. They can be used, for example, to create inputs/outputs for processing chains.
|
|
|
1) [Single nodes](#single-nodes) in the graph. They are usually implemented with null-sink and have input/output ports that need to be linked manually (with pw-link or link-factory) after creation. They can be used, for example, to create inputs/outputs for processing chains.
|
|
|
|
|
|
2) [Coupled streams](#coupled-streams). This is internally implemented as a capture and playback stream that can implement some processing such as channel mixing or remapping. They automatically connect to default/specified source/sinks and can be moved with tools like pavucontrol.
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
Virtual devices are configured by adding their definitions to `~/.config/pipewire/pipewire.conf.d/` or `/etc/pipewire/pipewire.conf.d/`. For example, add a single file called `10-null-sink.conf` to the config directory with this content:
|
|
|
|
|
|
```
|
|
|
context.objects = [
|
|
|
{ factory = adapter
|
|
|
args = {
|
|
|
factory.name = support.null-audio-sink
|
|
|
node.name = "my-sink"
|
|
|
media.class = Audio/Sink
|
|
|
audio.position = [ FL FR FC LFE RL RR ]
|
|
|
adapter.auto-port-config = {
|
|
|
mode = dsp
|
|
|
monitor = true
|
|
|
position = preserve
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
Restart pipewire and you will see a new my-sink audio sink. It will be unlinked. You can link it to a
|
|
|
node called `system` by adding a file `20-link-null-sink.conf` to the config directory with this
|
|
|
content:
|
|
|
|
|
|
```
|
|
|
context.objects = [
|
|
|
{ factory = link-factory
|
|
|
args = {
|
|
|
link.output.node = my-sink
|
|
|
link.output.port = output_FL
|
|
|
link.input.node = system
|
|
|
link.input.port = playback_1
|
|
|
link.passive = true
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
Creating links from the config file is difficult because most sinks and ports are dynamically
|
|
|
created and might not be available when the config file is processed. It is really only
|
|
|
possible to link between completely static node definitions.
|
|
|
|
|
|
It is recommended to use [Coupled streams](#coupled-streams) to make virtual sinks because they
|
|
|
will automatically be linked by the session manager.
|
|
|
|
|
|
|
|
|
## Single Nodes
|
|
|
|
|
|
Single nodes are the smallest building block and are often used to create the input/output for effect chains.
|
... | ... | |