Open sfjuocekr opened 1 month ago
Add audio.channels = 1
in the properties
Thanks @dimtpap - I had a similar problem using the loopback module with a virtual source.
In my example, I was forwarding the front-left channel from my audio interface to a mono virtual source. Without audio.channels=1
, the virtual source would not work in the obs plugin.
The output before I set audio.channels=1
was:
# select the virtual (microphone) source in OBS...
debug: [pipewire] Stream 0x12345678abcd state: "paused" (error: none)
debug: [pipewire] Stream 0x12345678abcd state: "unconnected" (error: none)
So there was no attempt to connect to the device. Once it was working, I would see:
# select the virtual (microphone) source in OBS...
debug: [pipewire] Stream 0x12345678abcd state: "paused" (error: none)
debug: [pipewire] Stream 0x12345678abcd state: "unconnected" (error: none)
debug: [pipewire] Stream 0x12345678abcd state: "connecting" (error: none)
info: [pipewire] 0x12345678abcd streaming from 46
debug: [pipewire] Stream 0x12345678abcd state: "paused" (error: none)
info: [pipewire] 0x12345678abcd Got format: rate 48000 - channels 1 - format 8
debug: [pipewire] Stream 0x12345678abcd state: "streaming" (error: none)
Here is a functional virtual source configuration ~/.config/pipewire/virtual-umc-mono-microphone.conf
:
context.modules = [
{ name = libpipewire-module-loopback
args = {
node.description = "Virtual UMC202HD mono microphone"
capture.props = {
audio.position = [ FR ]
stream.dont-remix = true
target.object = "alsa_input.usb-BEHRINGER_UMC202HD_192k_12345678-00.analog-stereo"
node.passive = true
}
playback.props = {
node.name = "virtual_input.BEHRINGER_UMC202HD_192k_12345678-00.mono"
media.class = "Audio/Source"
node.nick = "Virtual UMC202HD 192k MONO microphone"
audio.position = [ MONO ]
audio.channels = 1
}
}
}
]
Should the number of channels be inferred from audio.position
if channels isn't supplied?
This would require some change near: https://github.com/dimtpap/obs-pipewire-audio-capture/blob/d5d51d483065a7bf02ac9367683e5033ed837025/src/pipewire-audio-capture-device.c#L81
When using a virtual sink, pipewire.conf.d/virtualsink.conf:
Virtual sinks are shown, but when I try to select one and press the OK button it reverts back to the "Default".