Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual sinks are not working #74

Open
sfjuocekr opened this issue Sep 27, 2024 · 3 comments
Open

Virtual sinks are not working #74

sfjuocekr opened this issue Sep 27, 2024 · 3 comments

Comments

@sfjuocekr
Copy link

When using a virtual sink, pipewire.conf.d/virtualsink.conf:

context.modules = [
   { name = libpipewire-module-loopback
     args = {
        node.description = "MicSolo"
        capture.props = {
           node.name = "MicSolo_capture"
           media.class = "Audio/Sink"
           audio.position = [ MONO ]
        }
        playback.props = {
           node.name = "MicSolo_playback"
           media.class = "Audio/Source"
           audio.position = [ MONO ]
        }
     }
   }
]

Virtual sinks are shown, but when I try to select one and press the OK button it reverts back to the "Default".

@dimtpap
Copy link
Owner

dimtpap commented Sep 27, 2024

Add audio.channels = 1 in the properties

@stephematician
Copy link

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?

@stephematician
Copy link

This would require some change near:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants