Jun 17 16:58:03 mobilemars pulseaudio[8715]: Configured latency of 1.00 ms is smaller than minimum latency, using minimum instead
Jun 17 16:58:03 mobilemars pulseaudio[8715]: Cannot set requested sink latency of 2.25 ms, adjusting to 2.50 ms
Jun 17 16:58:03 mobilemars pulseaudio[8715]: Cannot set requested source latency of 2.25 ms, adjusting to 2.50 ms
with:
pactl load-module module-loopback latency_msec=1
Apparently didn't need to specify log_interval=1
.
This is with my build-in microphone. That is:
03:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller
This is just a fairly cheap notebook with an AMD Ryzen 4800U cpu. Definitely not the high end stuff. I'm not entirely sure if this audio support driver comes from the CPU itself or from the motherboard and it's chipset though.
Anyhow, 2.5ms.
Funny thing is. If i specify 3ms (which is above 2.5 :P) then the logging says:
Jun 17 17:05:51 mobilemars pulseaudio[8715]: Configured latency of 3.00 ms is smaller than minimum latency, using minimum instead
Jun 17 17:05:51 mobilemars pulseaudio[8715]: Cannot set requested sink latency of 2.33 ms, adjusting to 2.50 ms
Jun 17 17:05:51 mobilemars pulseaudio[8715]: Cannot set requested source latency of 3.08 ms, adjusting to 4.00 ms
And this is suspiciously repeatable every single time. Which leads me to think that there is a bug in the way latency is determined.
Same if i set 5ms, i get:
Jun 17 17:08:40 mobilemars pulseaudio[8715]: Configured latency of 5.00 ms is smaller than minimum latency, using minimum instead
Jun 17 17:08:40 mobilemars pulseaudio[8715]: Cannot set requested sink latency of 2.33 ms, adjusting to 2.50 ms
Jun 17 17:08:40 mobilemars pulseaudio[8715]: Cannot set requested source latency of 3.08 ms, adjusting to 4.00 ms
I don't get this logging, it makes no sense to me.. But you can probably make sense of it i suppose
Well, we can try that out
Now, the funny thing is that you can run this line as many times as you want: 'pactl load-module module-loopback latency_msec=1'
I'm not sure if this is a bug or a feature but it certainly is nice. So say i run that time 3x i get the module loaded 3x with the 1ms setting. It's like the microphone is amplified!
But besides that, we can also use it to see if there is a true difference between 1ms and say 10 or 20 ms. So running:
pactl load-module module-loopback latency_msec=1
pactl load-module module-loopback latency_msec=10
If 1ms and 10 ms are essentially the same internally then the sound would be exactly the same as when i would run:
pactl load-module module-loopback latency_msec=10
pactl load-module module-loopback latency_msec=10
But it turns out this is not the case! Running it with different msec values leads to the sound being really weird. I can't explain it but you'll know immediately if you run it for yourself.
If i change the msec difference to 20ms (1 with 1ms, 1 with 20ms) then i clearly do hear a bit of an echo. Leading me to think that the very low ms ranges are in fact useful! It might be hardware dependent? Yet my cheap external usb sound driver and my internal sound driver both behave as described above.
In other terms, a ms setting of more then 1ms still seems wrong by me.
Oh, to amend.
My microphone is attached to a USB audio dongle. This one to be exact. And a very cheap lapel microphone. So while this is connected to USB, i darn well notice a difference between even 5ms and 1ms delay. I'm raising this point as i just found some post from ~13 years ago where it was deemed silly to have such a low latency for USB connections. Perhaps time has improved the technique on the USB side of things, i don't know. All i know is that i very well notice a difference even. Even between 5 and 1 ms.
If that reasoning - from ~13 years ago - is still the reason for it's current default then i certainly would suggest to re-evaluate this and change it to 1ms by default.
Hi,
I found myself in the very normal situation where i wanted to hear my own microphone input in my speakers. To do that you need to have module-loopback loaded.
Loading it in it's default values like so:
pactl load-module module-loopback
Gives me a very noticeable delay in microphone audio. A delay that didn't make sense at all to me. So i went on a google endeavor just to find that the default latency is 200ms https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/master/src/modules/module-loopback.c#L62
Turns out that loading the module with:
pactl load-module module-loopback latency_msec=1
Is the lowest amount of latency that's apparently accepted. Microphone input now does sound very snappy with no real apparent latency. I guess 1ms can't really be noticed.
Now i'm sure there are very good reasons to default to 200 ms, right? In the case of a microphone this does now give a "bad experience by default" which i'm sure isn't the intention here.
But this does make me wonder, why a latency at all?
Isn't 0ms (i tried, it fails with Failure: Module initialization failed
) a very valid usecase too?
Why is a latency at all needed???
Best regards, Mark