mirror of
https://github.com/tiyn/wiki.git
synced 2026-03-31 10:24:47 +02:00
Pipewire: added a guide on virtual microphone
This commit is contained in:
@@ -97,11 +97,11 @@ This mostly is based upon standard configuration.
|
|||||||
Most importantly stream devices may have problems as explained in the
|
Most importantly stream devices may have problems as explained in the
|
||||||
[corresponding section](#problems-with-input-an-output-of-loopback-devices).
|
[corresponding section](#problems-with-input-an-output-of-loopback-devices).
|
||||||
|
|
||||||
#### Creating a Null Device
|
#### Creating a Virtual Sinks
|
||||||
|
|
||||||
This section will focus on the creation of a dummy device.
|
This section will focus on the creation of a virtual sink.
|
||||||
That is a virtual device that can be selected as output but is not used by default.
|
That is a virtual device that can be selected as output but is not used by default.
|
||||||
This can be useful to record applications as their sound can cleanly be passed to the dummy device
|
This can be useful to record applications as their sound can cleanly be passed to the virtual sink
|
||||||
which will eliminate other applications sounds.
|
which will eliminate other applications sounds.
|
||||||
If the goal is to record and listen to an application at the same time navigate to
|
If the goal is to record and listen to an application at the same time navigate to
|
||||||
[the application loopback section](#creating-an-application-loopback)
|
[the application loopback section](#creating-an-application-loopback)
|
||||||
@@ -109,7 +109,7 @@ If the goal is to record and listen to an application at the same time navigate
|
|||||||
The source for this section of the entry is derived by
|
The source for this section of the entry is derived by
|
||||||
[Pipewire Gitlab site](https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Virtual-Devices#single-nodes).
|
[Pipewire Gitlab site](https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Virtual-Devices#single-nodes).
|
||||||
|
|
||||||
A dummy device, or null sink, can be created permanently by creating a `.conf` file inside the
|
A virtual sink can be created permanently by creating a `.conf` file inside the
|
||||||
`~/.config/pipewire/pipewire.conf.d` directory with the following lines.
|
`~/.config/pipewire/pipewire.conf.d` directory with the following lines.
|
||||||
|
|
||||||
|
|
||||||
@@ -118,8 +118,8 @@ context.objects = [
|
|||||||
{ factory = adapter
|
{ factory = adapter
|
||||||
args = {
|
args = {
|
||||||
factory.name = support.null-audio-sink
|
factory.name = support.null-audio-sink
|
||||||
node.name = "null-sink-0"
|
node.name = "virtual-sink-0"
|
||||||
node.description = "Null Sink 0"
|
node.description = "Virtual Sink 0"
|
||||||
media.class = Audio/Sink
|
media.class = Audio/Sink
|
||||||
audio.position = [ FL FR ]
|
audio.position = [ FL FR ]
|
||||||
monitor.channel-volumes = true
|
monitor.channel-volumes = true
|
||||||
@@ -138,13 +138,15 @@ Multiple devices can be created by creating different files in the directory.
|
|||||||
|
|
||||||
If the null sink is only needed temporarily (until the next restart) the following line can be used
|
If the null sink is only needed temporarily (until the next restart) the following line can be used
|
||||||
to create it.
|
to create it.
|
||||||
Use different `sink_name`s to create multiple dummy devices.
|
To create multiple virtual sinks different values for the name of the sink have to be used.
|
||||||
|
In the following example `<sink-name>` is a placeholder for the name of the sink.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pactl load-module module-null-sink media.class=Audio/Sink sink_name=null-sink-0 channel_map=stereo
|
pactl load-module module-null-sink media.class=Audio/Sink sink_name=<sink-name> channel_map=stereo
|
||||||
```
|
```
|
||||||
|
|
||||||
This will return an id that can be used to remove the sink with the following command.
|
This will return an ID that can be used to remove the sink with the following command.
|
||||||
|
`<id>` is the placeholder for the ID.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pactl unload-module <id>
|
pactl unload-module <id>
|
||||||
@@ -172,12 +174,12 @@ context.modules = [
|
|||||||
capture.props = {
|
capture.props = {
|
||||||
media.class = "Stream/Input/Audio"
|
media.class = "Stream/Input/Audio"
|
||||||
node.name = "device-loopback-1-recording"
|
node.name = "device-loopback-1-recording"
|
||||||
node.description = "Device-Loopback 1 Recording"
|
node.description = "Device Loopback 1 Recording"
|
||||||
}
|
}
|
||||||
playback.props = {
|
playback.props = {
|
||||||
media.class = "Stream/Output/Audio"
|
media.class = "Stream/Output/Audio"
|
||||||
node.name = "device-loopback-1-playback"
|
node.name = "device-loopback-1-playback"
|
||||||
node.description = "Device-Loopback 1 Playback"
|
node.description = "Device Loopback 1 Playback"
|
||||||
}
|
}
|
||||||
audio.volume = 0.5
|
audio.volume = 0.5
|
||||||
audio.mute = true
|
audio.mute = true
|
||||||
@@ -192,7 +194,7 @@ The part called `Device-Loopback 1 Recording` in the example config can be found
|
|||||||
tab.
|
tab.
|
||||||
There the device to loopback can be selected.
|
There the device to loopback can be selected.
|
||||||
The second part called `Device-Loopback 1 Playback` is available under the `Playback` tab and
|
The second part called `Device-Loopback 1 Playback` is available under the `Playback` tab and
|
||||||
allows to switch the selection of the output device.
|
allows switching the selection of the output device.
|
||||||
|
|
||||||
#### Creating an Application Loopback
|
#### Creating an Application Loopback
|
||||||
|
|
||||||
@@ -201,7 +203,7 @@ In this section an application loopback is defined as a loopback that takes an a
|
|||||||
This can be useful to record applications as their sound can cleanly be passed to the sink sink of
|
This can be useful to record applications as their sound can cleanly be passed to the sink sink of
|
||||||
the applicatino loopback which will eliminate other applications sounds.
|
the applicatino loopback which will eliminate other applications sounds.
|
||||||
If the goal is to record and not listen to the application at the same time navigate to
|
If the goal is to record and not listen to the application at the same time navigate to
|
||||||
[the null device section](#creating-a-null-device).
|
[the null device section](#creating-a-virtual-sinks).
|
||||||
Alternatively the null device can also be selected as a output device for the playback part of the
|
Alternatively the null device can also be selected as a output device for the playback part of the
|
||||||
application loopback which makes it easily and seemlessly possible to switch between listening in
|
application loopback which makes it easily and seemlessly possible to switch between listening in
|
||||||
and not listening without changing the device that is recorded by the capturing program.
|
and not listening without changing the device that is recorded by the capturing program.
|
||||||
@@ -221,12 +223,12 @@ context.modules = [{
|
|||||||
capture.props = {
|
capture.props = {
|
||||||
media.class = "Audio/Sink"
|
media.class = "Audio/Sink"
|
||||||
node.name = "application-loopback-1-sink"
|
node.name = "application-loopback-1-sink"
|
||||||
node.description = "Application-Loopback 1 Sink"
|
node.description = "Application Loopback 1 Sink"
|
||||||
}
|
}
|
||||||
playback.props = {
|
playback.props = {
|
||||||
media.class = "Stream/Output/Audio"
|
media.class = "Stream/Output/Audio"
|
||||||
node.name = "application-loopback-1-playback"
|
node.name = "application-loopback-1-playback"
|
||||||
node.description = "Application-Loopback 1 Playback"
|
node.description = "Application Loopback 1 Playback"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
@@ -237,10 +239,55 @@ mixer like [pavucontrol](#volume-control).
|
|||||||
The part called `Application-Loopback 1 Sink` in the example config can be found in the `Output
|
The part called `Application-Loopback 1 Sink` in the example config can be found in the `Output
|
||||||
Devices` tab.
|
Devices` tab.
|
||||||
The second part called `Application-Loopback 1 Playback` is available under the `Playback` tab and
|
The second part called `Application-Loopback 1 Playback` is available under the `Playback` tab and
|
||||||
allows to switch the selection of the output device.
|
allows switching the selection of the output device.
|
||||||
Also in the `Playback` tab `Application-Loopback 1 Sink` can be selected as an output for currently
|
Also in the `Playback` tab `Application-Loopback 1 Sink` can be selected as an output for currently
|
||||||
running applications which will loopback the sound to the selected output device.
|
running applications which will loopback the sound to the selected output device.
|
||||||
|
|
||||||
|
#### Creating Virtual Sources
|
||||||
|
|
||||||
|
This section will focus on the creation of a virtual source.
|
||||||
|
That is a virtual device that can be selected as input but is not used by default.
|
||||||
|
This can be useful to pass sound to a program that only accepts microphones by default.
|
||||||
|
If different sources have to be bundled first an application loopback can be used.
|
||||||
|
A guide on the creation of it is in
|
||||||
|
[the application loopback section](#creating-an-application-loopback).
|
||||||
|
|
||||||
|
A virtual source can be created permanently by creating a `.conf` file inside the
|
||||||
|
`~/.config/pipewire/pipewire.conf.d` directory with the following lines.
|
||||||
|
|
||||||
|
|
||||||
|
```txt
|
||||||
|
context.modules = [
|
||||||
|
{
|
||||||
|
name = libpipewire-module-loopback
|
||||||
|
args = {
|
||||||
|
audio.position = [ FL FR ]
|
||||||
|
|
||||||
|
capture.props = {
|
||||||
|
media.class = "Stream/Input/Audio"
|
||||||
|
node.name = "virtual-source-1-recording"
|
||||||
|
node.description = "Virtual Source 1 Recording"
|
||||||
|
}
|
||||||
|
|
||||||
|
playback.props = {
|
||||||
|
media.class = "Audio/Source"
|
||||||
|
node.name = "virtual-source-1-source"
|
||||||
|
node.description = "Virtual Source 1 Source"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Multiple devices can be created by creating different files in the directory.
|
||||||
|
|
||||||
|
The created virtual source is made up by two parts that can be found in different places inside a
|
||||||
|
mixer like [pavucontrol](#volume-control).
|
||||||
|
The part called `Virtual Source 1 Source` in the example config can be found in the `Input Devices`
|
||||||
|
tab.
|
||||||
|
The second part called `Virtual Source 1 Recording` is available under the `Recording` tab and
|
||||||
|
allows switching the selection of the output or input to feed into the virtual microphone.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
This section will focus on errors and the fixing of errors of Pipewire.
|
This section will focus on errors and the fixing of errors of Pipewire.
|
||||||
|
|||||||
Reference in New Issue
Block a user