... | ... | @@ -32,7 +32,7 @@ context.objects = [ |
|
|
]
|
|
|
```
|
|
|
|
|
|
Restart pipewire and you will see a new my-sink audio sink. It will be unlinked. You can link it to a
|
|
|
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:
|
|
|
|
... | ... | @@ -133,7 +133,7 @@ Create a new node that can be selected as source and sink in PulseAudio applicat |
|
|
```
|
|
|
pactl load-module module-null-sink media.class=Audio/Duplex sink_name=my-tunnel audio.position=FL,FR,RL,RR
|
|
|
```
|
|
|
You can use this to send data from one pulseaudio application to another directly.
|
|
|
You can use this to send data from one PulseAudio application to another directly.
|
|
|
|
|
|
### Create a Combined Sink/Source
|
|
|
|
... | ... | @@ -320,7 +320,7 @@ See [JConvolver](Simple-audio-post-processing) example. |
|
|
|
|
|
# Echo Cancellation
|
|
|
|
|
|
There is a native echo-cancel module available in pipewire. it can be loaded as a pulseaudio module
|
|
|
There is a native echo-cancel module available in PipeWire. it can be loaded as a PulseAudio module
|
|
|
or as a native [module-echo-cancel](https://docs.pipewire.org/page_module_echo_cancel.html) module.
|
|
|
|
|
|
You can then use pavucontrol to redirect the echo canceled recording and playback
|
... | ... | @@ -490,3 +490,140 @@ context.modules = [ |
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
# Pipe devices
|
|
|
|
|
|
These are virtual devices that can be used to bring data into the graph (pipe source) or
|
|
|
read data from a graph (pipe sink).
|
|
|
|
|
|
You can use pactl to load the equivalent PulseAudio module.
|
|
|
|
|
|
You can also use the native pipe tunnel module. For this the following example snippets need to be placed in `pipewire.conf` or `pipewire-pulse.conf` in the `context.modules` section or can be copy and pasted into a new file in the `pipewire.conf.d` or `pipewire-pulse.conf.d` directories.
|
|
|
|
|
|
Check out [module-pipe-tunnel](https://docs.pipewire.org/page_module_pipe_tunnel.html) for more info.
|
|
|
|
|
|
## Pipe source
|
|
|
|
|
|
You can use the PulseAudio module to load a pipe source like this:
|
|
|
|
|
|
```
|
|
|
pactl load-module module-pipe-source source_name=VirtualMic file=/tmp/virtualdevice format=s16le rate=44100 channels=2
|
|
|
```
|
|
|
|
|
|
When you write samples to `/tmp/virtualdevice` they will appear as samples on the source in the
|
|
|
PipeWire graph.
|
|
|
|
|
|
This snippet is the equivalent of the above:
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-pipe-tunnel
|
|
|
args = {
|
|
|
tunnel.mode = source
|
|
|
pipe.filename = "/tmp/virtualdevice"
|
|
|
audio.format = S16LE
|
|
|
audio.rate = 44100
|
|
|
audio.channels = 2
|
|
|
audio.position = [ FL FR ]
|
|
|
stream.props = {
|
|
|
node.name = VirtualMic
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
## Pipe sink
|
|
|
|
|
|
You can use the PulseAudio module to load a pipe sink like this:
|
|
|
|
|
|
```
|
|
|
pactl load-module module-pipe-sink source_name=VirtualSpeaker file=/tmp/virtualdevice format=s16le rate=44100 channels=2
|
|
|
```
|
|
|
|
|
|
Samples sent to the PipeWire virtual sink will be available on `/tmp/virtualdevice` for reading.
|
|
|
|
|
|
This snippet is the equivalent of the above:
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-pipe-tunnel
|
|
|
args = {
|
|
|
tunnel.mode = sink
|
|
|
pipe.filename = "/tmp/virtualdevice"
|
|
|
audio.format = S16LE
|
|
|
audio.rate = 44100
|
|
|
audio.channels = 2
|
|
|
audio.position = [ FL FR ]
|
|
|
stream.props = {
|
|
|
node.name = VirtualSpeaker
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
## Pipe playback
|
|
|
|
|
|
This will create a playback stream linked to the configured sink.
|
|
|
|
|
|
When you write samples to `/tmp/virtualdevice` they will be played on the sink.
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-pipe-tunnel
|
|
|
args = {
|
|
|
tunnel.mode = playback
|
|
|
pipe.filename = "/tmp/virtualdevice"
|
|
|
audio.format = S16LE
|
|
|
audio.rate = 44100
|
|
|
audio.channels = 2
|
|
|
audio.position = [ FL FR ]
|
|
|
stream.props = {
|
|
|
node.name = VirtualOut
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
|
|
|
## Pipe capture
|
|
|
|
|
|
This will create a capture stream linked to the configured source.
|
|
|
|
|
|
Samples captured by the source will appear on `/tmp/virtualdevice` for reading by the
|
|
|
application.
|
|
|
|
|
|
```json
|
|
|
context.modules = [
|
|
|
{ name = libpipewire-module-pipe-tunnel
|
|
|
args = {
|
|
|
tunnel.mode = capture
|
|
|
pipe.filename = "/tmp/virtualdevice"
|
|
|
audio.format = S16LE
|
|
|
audio.rate = 44100
|
|
|
audio.channels = 2
|
|
|
audio.position = [ FL FR ]
|
|
|
stream.props = {
|
|
|
node.name = VirtualIn
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
# Other virtual devices
|
|
|
|
|
|
Other virtual devices can be created, depending on the source of the data:
|
|
|
|
|
|
* [module-protocol-simple](https://docs.pipewire.org/page_module_protocol_simple.html) for reading/writing
|
|
|
from a TCP socket.
|
|
|
* [module-pulse-tunnel](https://docs.pipewire.org/page_module_pulse_tunnel.html) for reading/writing
|
|
|
from/to a PulseAudio server.
|
|
|
* [module-roc-sink](https://docs.pipewire.org/page_module_roc_sink.html) for sending to a
|
|
|
ROC receiver.
|
|
|
* [module-roc-source](https://docs.pipewire.org/page_module_roc_source.html) for receiving from a
|
|
|
ROC sender.
|
|
|
* [module-raop-sink](https://docs.pipewire.org/page_module_raop_sink.html) for sending to an
|
|
|
Airplay receiver. |