exeldro / obs-audio-monitor

audio monitor filter for OBS Studio
GNU General Public License v2.0
282 stars 29 forks source link

Question: Expected latency in contrast to standard OBS audio monitoring? #16

Open rse opened 3 years ago

rse commented 3 years ago

This is not a bug-reporting issue, but a question on some subtle details to get a better understanding what is happening for me: when I do regular OBS audio monitoring (via Advanced Audio Settings) I observe (in ManyCam or SplitCam) that my resulting audio stream is about 50-100ms before the video stream. When I switch to your awesome OBS Audio Monitor filter (which I really like because it can operate after some other audio filters while the regular OBS audio monitoring seems to operate before the filters) I observe that now the audio stream is about 100-150ms behind the video stream.

Those A/V-sync delays are always hard to measure correctly, of course. I've repeated it multiple times, but there are just too many involved parts to be sure. So, I'm better asking for some hints here before seeking further. I've even removed all other audio filters before OBS Audio Monitor. But it looks like there is a noticeable buffering in the audio stream happening when your OBS Audio Monitor is in use. I can compensate for this by delaying the video stream in ManyCam (the next app in my pipeline after OBS), of course. But I would like to know: independent of my particular (rather complex) scene setup: is a noticeable latency caused by OBS Audio Monitor also expected from your side and if yes, what amount of milliseconds do you expect on average? I just want to know whether I should stick with my video delaying (because it is just expected) or seek further because 100-150ms is too much to be caused by just OBS Audio Monitor alone. Do you have an opinion?

In my personal opinion that the use of a filter like OBS Audio Monitoring inherently has to cause some more latency for the resulting audio stream (in contrast to regular OBS audio monitoring), because OBS does a lot more things between the regular audio monitoring and the stage where the filters are applied. But 100-150ms IMHO is more than I would expect here, except your OBS Audio Monitor filter uses a rather large internal buffering...

exeldro commented 3 years ago

The audio is captured in the filter chain and direct resampled to the correct format and send to the audio device. You can add some buffering in the properties of the filter, but there should be 0 buffering by default. The resampling and sending to the audio device is done in the same way as the build in audio monitoring. I would expect the audio monitoring of this plugin to be faster than the build in audio monitoring, because the plugin is in the filter chain and the build in monitoring is after the filter chain.