I redirect my microphone’s audio to the default output:
pactl load-module module-loopback latency_msec=1
Now I hear myself without noticeable latency.
When I launch (even without connecting, which can be done though) either Iriun Webcam (iriunwebcam-bin) or DroidCam (droidcam-obs-plugin) the loopback latency clearly spikes to 200-300 ms and speaking becomes problematic as I start to interrupt myself.
The latency is gone only after a reboot, that is reloading the loopback module or closing a webcam application doesn’t put the latency back to normal.
If I connect a USB webcam and use it in Discord or in OBS via V4L2 video capture I don’t experience any loopback latency ever.
The documentation for module-loopback advises for latency_msec option:
The desired latency in milliseconds, from 1 to 2000. Defaults to 200. (Note that this is only a friendly request, the actual latency might be higher or lower than this value)
If the module cannot deliver 1 ms latency for USB webcam it is probably using the default 200 ms instead
I used to use module-loopback with Skype and the best consistent latency I could get for this module was 10-15 ms, with a modified and minimised PulseAudio configuration
For PulseAudio + USB webcam + Discord or OBS, 10-20 ms latency is more likely to achieve consistent results
If latency is below 20 ms there is no audible echo, but there is a phaser effect - sound is ‘hollow’ or ‘metallic’
Upgrading audio hardware to have zero-latency monitoring would be the optimal solution
But if that is not an option (and phaser effect is not annoying)
Use Discord in JACK and add a JACK source in OBS to share audio source with Discord
Or add webcam as an ALSA source for OBS only
I’ve checked again and the latency in question is actually around 50 ms no matter what I put in latency_msec. I guess that’s the lowest possible latency on an OS level.
Thank you for your answers! I’ll just buy a sound card.