Pipewire now delays microphone audio

bnordgren

New Member
FYI, since Pipewire 0.3.60 and/or Fedora 37, pipewire's loopback module has a target.delay.sec parameter. So if you're mostly using the virtual camera for webmeetings (where the audio goes straight into the client, but the video comes from OBS and they're out of sync), you can use this new feature to create an audio device that better matches the video. Put something like the following in your .config/pipewire/pipewire.conf.d and do a systemctl --user restart pipewire. You can then pick "delay_microphones" (or whatever you put in the node.description below) from your client software of choice. You need to put your own audio interface device (the one that has your microphones on it) in target.object. For that, you kind of have to sift through the output of pw-top and cut and paste your most likely candidate. Because you changed your config, it should automatically get created every time you log in.

I just found this last Friday and got it working this morning. Pretty psyched because I've been needing something like this for a long time.

JSON:
context.modules = [
{   name = libpipewire-module-loopback
    args = {
        node.description = "delay_microphones"
        target.delay.sec = 0.36
        capture.props = {
            node.name = "input.delay_microphones"
            target.object = "alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y8ATAE5079692D-00.analog-stereo"
        }
        playback.props = {
            node.name = "playback.delay_microphones"
            media.class = "Audio/Source"
            audio.channels = 2
        }
    }
}
]
 
Top