Skip to content

Audio Monitoring Buffer Buildup / Offsync #4531

Open

Description

@MechanicallyDev

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

26.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

2021-04-15 11-03-34.txt

OBS Studio Crash Log URL

No response

Expected Behavior

When monitoring audio, the monitoring audio buffer should be rebuild in case of buildup to avoid losing sync with the stream/recording audio buffer. It can be done either by evaluating the size of the buffer, comparing it to the bitrate to check if it is too long, or by continually rebuilding the buffer every X seconds.

Current Behavior

When monitoring the audio, only the monitoring audio gets off sync over time, while the streaming / recording audio stays in sync.

Steps to Reproduce

  1. On OBS, add an Microphone as an Input Source.
  2. On the "Edit" menu, select the option "Advanced Audio Properties".
  3. Find the microphone on the list and on the "Audio Monitoring" column, select "Monitor and Output".
  4. Let OBS run for a while. Over time the monitoring of the audio will get off sync with the input, making really hard to speak while monitoring the audio.

Anything else we should know?

To check the buffer buildup hypothesis:

To clean the buffer, you can click on the Eye Icon to disable the microphone, and click again to re-enable it, but will eventually rebuild the delay.

To automatically and continuously clean the buffer, you can use 2 "Move Source" filters on the scene:
Move Source # 1: To disable the microphone source, wait an interval with it disabled (I got good results disabling for 100ms), and at the end enable the Move Souce # 2.
Move Source # 2: To enable the microphone source, wait an interval with it enabled (I got good results with 60000ms / 1 minute), and at the end enable the Move Source # 1.

Activity

  1. WizardCM commented on Apr 15, 2021

    @WizardCM
    Member

    Please launch OBS with the --verbose flag and after reproducing the issue, post a log (Help -> Log Files -> Upload Current Log File).

    Additionally, please test with 27.0.0-rc2 in case it was fixed by some of the audio fixes there.

    Additionally, in future do not delete parts of the issue template. They are required fields for a reason (they help with reproduction & verification).

  2. RytoEX commented on Apr 15, 2021

    @RytoEX
    Member

    As @WizardCM said, please do not delete parts of the issue template. I've manually added the removed portions back in, but in the future we will close issues where parts of the template have been removed.

  3. MechanicallyDev commented on Apr 15, 2021

    @MechanicallyDev
    Author

    Please launch OBS with the --verbose flag and after reproducing the issue, post a log (Help -> Log Files -> Upload Current Log File).

    Log included in the main post. When I closed the program the delay between the input and the monitoring of the same input was about 500ms.

    Additionally, please test with 27.0.0-rc2 in case it was fixed by some of the audio fixes there.

    I tried with OBS 27.0.0-rc2, but the same thing happens.

    Additionally, in future do not delete parts of the issue template. They are required fields for a reason (they help with reproduction & verification).

    Sorry, I thought it was not relevant, but my assumption was probably wrong.

  4. AaronD-GH commented on Apr 16, 2021

    @AaronD-GH

    I'm slightly concerned about the suggested workaround. It seems to me that it would affect not only the monitor, which is where the problem is, but also the stream and recording, which are perfectly okay as they are.

    I see no need to introduce an artificial hiccup in the audience's feed, to fix a problem that only exists in the producer's verification.

    An alternate workaround is to wait for the problem to manifest itself, and then change the monitoring device. This resets only the monitor's buffer, while leaving the stream and recording unaffected. Change the setting back, of course, to hear it again, or physically switch your headphones or studio monitors to the other device. Either way, the latency is back to nominal...for a while, and then you change the setting again to reset again, ad infinitum. Unfortunately, I don't see a way to automate this, so you have to just bear with it until you get a break in your workload, and then do it manually.

    See also Issue #3664.

  5. MechanicallyDev commented on Apr 16, 2021

    @MechanicallyDev
    Author

    @AaronD-GH If I understand correctly, the render and monitoring audio buffers are distinct (hence why the render audio is synced, while the monitoring isn't). If that is the case, a proper fix can be done by either by evaluating the size of the buffer, comparing it to the bitrate to check if it is too long, or by continually rebuilding the monitoring buffer every X seconds.

    The workaround I mentioned (automatically blinking the audio source using Move Source) was mentioned just to verify the sync problem being fixed, not as a proper fix. A proper fix should change only the monitoring, not the sound source, as you mentioned.

    About the workaround you suggested, I believe it would be possible using the webhook plugin and a script to change the monitoring state every once in a while, I'll investigate it further.

  6. MechanicallyDev commented on Apr 17, 2021

    @MechanicallyDev
    Author

    It took me some time since I don't code in Python, but here is a Python OBS script that enables and disables the monitoring of a audio input source after a set interval. This way it won't affect the streaming or recording, only the monitoring (it is barely noticeable, tho).

    It is still a workaround, but a better one.

    Anti Mic Monitoring Desync

    Since it's an OBS script you need Python 3.6 to run, newer versions may not work.
    I'll try to port it to LUA to increase the compatibility.

  7. added
    platform/windows
    on Oct 24, 2021
  8. anzz1 commented on Apr 9, 2022

    @anzz1

    I am using OBS only for it's monitoring (not streaming at all) and don't need any fancy features, so do any of you know a older version where this issue (audio drifting gradually out-of-sync) does not exist?

  9. anzz1 commented on Apr 10, 2022

    @anzz1

    I got around this issue by turning OBS monitoring off and using this "monitor filter" instead https://github.com/exeldro/obs-audio-monitor (version 0.8.0 of plugin, version 27.2.4 of OBS, win-x64)

  10. kryztoval commented on Sep 3, 2022

    @kryztoval

    I am seeing this bug or a separate instance of this in windows as well.
    OBS version 28.0.1 64 bit
    Capturing audio from EZcast CatchU and Avermedia's Live Gamer both UV meters show the right sound input, and the recording of both separate tracks look quite similar, however the monitored audio that goes out to the card becomes delayed every passing second. It does sound crackly and a bit out of range but that is not the focus of this thread, the focus is the fact that it keeps delaying.

    I will check if the obs-audio-monitor plug in is updated to this version of obs :(

  11. anzz1 commented on Sep 3, 2022

    @anzz1

    I ultimately opted to forego the audio monitoring entirely as I don't really need to have a duplicate audio source for my setup, just mirroring the screen is fine. IIRC the setup using audio-monitor plugin didn't work perfectly either, the delay was much less but ultimately it started to eventually drift too.

  12. kryztoval commented on Sep 3, 2022

    @kryztoval

    Based on your comment what I will do is patch the audio source in one of the Virtual inputs of Voicemeeter Potato and route it to my headset. Annoying but at least it has no delay. I do still get popping and crackling from the audio source but that is another report not this one. thanks @anzz1 for the update.

  13. YorVeX commented on Sep 4, 2022

    @YorVeX

    During the past months I have researched a lot around audio delay issues in OBS. I am coming from a different direction, my issues were mostly related to NDI feed audio desyncs and around audio delay issues more in general but that always also touched audio monitoring problems. Also for me it was never a problem that audio slowly drifted into becoming desync, instead it was triggered by an event like a short lag in OBS. Still, here's what I found, maybe it's helpful to someone here or sparks ideas for other solutions.

    Make the sample rates of all audio sources in OBS match

    That's the obvious one, I believe also the OBS log analyzer detects and warns about this, yet it's still too often overlooked even by people that actually know about this when sneaky things happen like you update your audio drivers and that silently resets your carefully adjusted sample rate settings without you ever noticing. I've even seen it happen that just plugging an USB audio device into a different USB port reset this. No matter whether you're an OBS beginner or pro, it's always worth double checking.

    Every single source in OBS that has audio should match the same rate setting that is configured in OBS (Settings -> Audio):
    image
    If you set 48 KHz there, then all your audio devices in your operating system also need to be set to 48 KHz (= 48000 Hz). E.g. from the log that was posted in this original issue:

    11:03:34.651: audio settings reset:
    11:03:34.651: 	samples per sec: 48000
    11:03:36.396: WASAPI: Device 'Mic Sony ECM 717 (High Definition Audio Device)' [44100 Hz] initialized
    

    48000 Hz configured in OBS, this mic is set to 44100 Hz however. Probably not relevant here since this issue is about an audio output device (which according to the log is set to 48000) and there's also another mic set to 48000, maybe the one with the sample rate mismatch is not even used. I still thought it's a good example to show what log lines you should be looking for. If you configured OBS to 48000 Hz, search the logs for "44100" and make sure you don't find anything or only devices you don't use in OBS. Vice versa if you configured OBS to 44100 Hz.
    It's not sufficient to only check your sample rate settings in your OS settings, especially for capture cards it seems to be a common problem that e.g. in Windows an Elgato capture card is set to 48 KHz (which is also the correct setting for it) but from the logs you can see that OBS still initializes it as 44.1 KHz.

    Ah, yeah, and also try to disable or enable device timestamps and see whether it helps (also mentioned a lot everywhere so you probably know that already, but just to be sure).

    Use Asynchronous Audio Filter and Mute Filter

    • Use the Asynchronous Audio Filter on all sources that are outputting audio that you actually want to use (usually at least the main desktop audio output). This filter actively corrects audio drift. With verbose logging enabled it can also give you detailed information about the audio drift currently occurring which can help with debugging any such problems, e.g. if you have sample rate mismatches as explained above this should become visible
    • Use the Mute Filter on all sources that are outputting audio you don't want to use (e.g. webcams or other video capture devices).

    Low latency mode aka Fixed audio buffering

    image
    Boy, is this whole part still confusing to me. The option is new since OBS 28 and for some reason located right where monitoring audio is configured, yet in my early tests the monitoring audio was the only thing enabling this did not fix, while it very well did fix A/V desyncs that occurred in the recording or a stream. Also the comments in the code don't say anything about this being specifically relevant only for audio monitoring. All the confusion aside, I assume when you're here you've already tried a lot of things and are quite desperate, might as well give that option a shot too now that it's there.

    Avoid using render delay filters

    Yeah, I know, a bit hard to avoid if you have a setup that just depends on them. but at least you might want to be aware that this could cause trouble and temporarily turn it off for the sake of testing and ruling it out. What I know for sure is that they break on lags, as demonstrated in #6673. And who knows, maybe they can also cause a slow desync over time.

  14. matijaerceg commented on Sep 7, 2022

    @matijaerceg

    I tried just using the Audio Monitor plugin, but it didn't solve it; However, using Asynchronous Audio Filter seems to have eliminated my issue of monitoring lagging over time. I'm about 60min into testing it. Thanks for the suggestion YorVeX Spoke too soon.

  15. YorVeX commented on Sep 7, 2022

    @YorVeX

    I tried just using the Audio Monitor plugin, but it didn't solve it; However, using Asynchronous Audio Filter seems to have eliminated my issue of monitoring lagging over time. I'm about 60min into testing it. Thanks for the suggestion YorVeX

    I also tried the Audio Monitoring plugin when I read that it was suggested as a solution here but with the same result, it didn't improve the situation at all.

  16. 34 remaining items

  17. Fenrirthviti commented on Aug 15, 2023

    @Fenrirthviti
    Member

    The tl;dr at this point is that to fix this, we would need to rewrite large parts of the audio subsystem, which is a heck of a lot of work and something we haven't had the time for. We haven't forgotten about this, though.

  18. conlanpatrek commented on Aug 15, 2023

    @conlanpatrek

    @Fenrirthviti Thanks for the response. I'm not historically a c / c++ guy, but I've done a little. I don't suppose there's anything I can do to help? Or do you keep patches closer to the chest than that?

  19. Fenrirthviti commented on Aug 15, 2023

    @Fenrirthviti
    Member

    We certainly welcome any contributions, but I'm not the best positioned to explain what all needs to be changed/updated from a deep technical standpoint. I can say that the audio subsystem is one of the most complex, and fiddly, parts of OBS, which is part of why this has been waiting for so long.

  20. AaronD-GH commented on Aug 16, 2023

    @AaronD-GH

    The tl;dr at this point is that to fix this, we would need to rewrite large parts of the audio subsystem, which is a heck of a lot of work and something we haven't had the time for. We haven't forgotten about this, though.

    We certainly welcome any contributions, but I'm not the best positioned to explain what all needs to be changed/updated from a deep technical standpoint. I can say that the audio subsystem is one of the most complex, and fiddly, parts of OBS, which is part of why this has been waiting for so long.

    At that point, maybe a complete overhaul to make it more like a professional workflow wouldn't be such a wild idea. Take cues from a bunch of different DAW's and physical consoles, but with less functionality of course. No sense in reinventing all of that when we can just feed OBS externally from one of those.

    Or maybe do something like this?:
    https://ideas.obsproject.com/posts/2137/audio-overhaul

  21. Fenrirthviti commented on Aug 16, 2023

    @Fenrirthviti
    Member

    I'm very wary of solutions that just turn OBS in to a DAW. I'd much prefer we focus on making OBS easier to use with a DAW, rather than reinventing the wheel and having to support such complicated workflows in OBS itself.

  22. AaronD-GH commented on Aug 16, 2023

    @AaronD-GH

    I'm very wary of solutions that just turn OBS in to a DAW. I'd much prefer we focus on making OBS easier to use with a DAW, rather than reinventing the wheel and having to support such complicated workflows in OBS itself.

    Yes. I was hoping that my linked suggestion would be both easy enough to implement and support - lots of reused components and concepts, even for things that a "real" professional workflow doesn't necessarily reuse - and functional enough to actually be useful beyond the basic getting started.

    At the moment, I usually end up recommending to people who use more than the default single mic and Desktop audio capture, that they move their entire audio system over to a DAW or physical console because OBS really is that bad at the moment.

    For two independent mics on a single interface, we need to use what is essentially a hack to get them separated in OBS, because OBS absolutely insists that that's a single stereo source. More mics from a single interface? Forget it.

    Likewise for the many-channel USB interface that most digital consoles have now, and a handful of analog consoles too: out of the 18 or 32 channels on one of those, I only want channels 15-16 as a stereo source, NOT THE ENTIRE BAND MASHED TOGETHER INTO A USELESS BLOB!!! Yes, I know you're trying to downmix the first 6 channels as 5.1 down to stereo, or something like that, but that's NOT what this is!

    Even a single mic can cause problems for a different reason, because of the difference between the "live" level that you have to keep for the raw mic to avoid it clipping, and the "broadcast" level that the listeners expect. Lots of forum questions about why their mic is both quiet and distorted, when the people they watch have it loud and clean. In the linked suggestion, the default filter settings for the basic mic channel should provide a rough solution to that already.

    If OBS is going to have audio processing at all, then NONE of that should require an external tool, or a persistent question from a different new user every week or two.

    By the time all of those problems are solved, plus the people who want to drive a Zoom call from OBS with both picture and sound (virtual camera + audio), or a physical overflow room via HDMI (fullscreen projector + audio), and still keep the headphones for something else (don't hijack the Monitor output for either of those purposes), and loosen up some other needlessly arbitrary restrictions, I think you've pretty much arrived at my linked suggestion.
    The only thing I'd change about it, is to allow any number of Mic channel strips in Basic mode, that are each limited to the description of that one strip.

    Just because it's starting to share some capabilities with a DAW, doesn't mean it is one, nor should it be made into a caricature just to avoid that appearance. Professional tools are the way they are for some very good reasons; ignore them, and you make an amazingly bad product that doesn't have to be that bad.


    Or, maybe severely reduce OBS's audio functionality compared to what it is now - make it passthrough only - give it some virtual audio devices instead, and provide a list of good free DAW's on each platform to connect to those virtual devices? The idea then, is to have everyone use one of those DAW's. Period.

    One virtual device would feed each Track of the encoders, as a 1:1 connection with nothing else, one would facilitate the connection between the DAW and some other app like Zoom or a web browser, and the rest would be used to get sound out of OBS's media players and into the external DAW. What is presently the Monitor would come directly from the DAW: no need for that function to continue in OBS. And the DAW would also feed everything else directly that needs audio.


    I really do think it should be one or the other, with no middle ground. Or at the very least, make it obviously clear-cut, just from the way the user interface works and nothing else, where the boundary is. The present UI doesn't do that.

    Again referring to my linked suggestion, if you want to have only what it calls the Basic mode, with all of its intentional limitations and features, and switch between that and a "DAW mode" that functions per the previous section of this comment, maybe that's okay.

  23. conlanpatrek commented on Aug 16, 2023

    @conlanpatrek

    Vigorous hand waving ahead. One could also make the case that prioritizing a dead simple but easily extensible / moddable / plug-innable or wholly replaceable audio subsystem might be a strong option as well. A stronger foundation that better encourages and empowers the community to build their own solutions on top of it. So the extra complexity doesn't fall into this repo, but if some enterprising devs want a full DAW experience into obs, they have the tools to build it.

  24. Fenrirthviti commented on Aug 16, 2023

    @Fenrirthviti
    Member

    One could also make the case that prioritizing a dead simple but easily extensible / moddable / plug-innable or wholly replaceable audio subsystem might be a strong option as well.

    I can't speak for everyone on the project, but this is more or less the approach that I would personally prefer.

  25. conlanpatrek commented on Aug 16, 2023

    @conlanpatrek

    The nice thing about it is that this approach allows all others, if done right.

  26. conlanpatrek commented on Aug 16, 2023

    @conlanpatrek

    @MarcusBuer I ended up going with your script, as the exeldro plugin I mentioned didn't seem to fix anything, so he's likely using the existing monitoring buffers.

    Script seems to work great so far. Thank you for your hard work.

  27. AaronD-GH commented on Aug 16, 2023

    @AaronD-GH

    ......dead simple but easily extensible / moddable / plug-innable or wholly replaceable audio subsystem......encourages and empowers the community to build their own solutions on top of it......if some enterprising devs want a full DAW experience into obs, they have the tools to build it.

    I can support that too.

  28. ckohen commented on Dec 15, 2023

    @ckohen

    Or, maybe severely reduce OBS's audio functionality compared to what it is now - make it passthrough only - give it some virtual audio devices instead, and provide a list of good free DAW's on each platform to connect to those virtual devices? The idea then, is to have everyone use one of those DAW's. Period.

    This is essentially what I'm trying to help one of the streamers I watch frequently do right now. We have picked a mixer that allows all the live sources to be mixed and delivered as a stereo pair, but that should also support having the main desktop output (background music etc...), remote guests, built-in videos, and SFX to be brought in as separate sources to the mixer.
    This would allow each of those sources to be mixed together and brought in as a single final mix to OBS (through virtual routing because, as you mentioned, OBS doesn't understand multi-channel inputs and treats them as surround for some ungodly reason) as well as monitor the final mix and feed the remote guests with whatever they would want to hear (but not themselves obviouslly).

    This all works great, except for remote guests and built-in videos. Remote guests aren't that big of an issue, because they come in via a browser source, which luckily (on windows at least) you can use the OS to change which output device it goes to. That is, so long as you didn't check "Control audio via OBS" because, ironically, that gives you less control in this situation.
    However, all browser sources will go to this audio device (unless you control via OBS the rest of them) which makes it quite annoying when you're wanting to treat it as a separate input.

    Videos don't have this option at all, so you're truly stuck with monitoring audio. Granted for stingers, short clips etc... the drift that occurs should be a non-issue since the video likely won't even be playing for long enough for it to matter.

    That all said, it is entirely possible to do what we will need to do with the current audio situation, though there's a lot of really "hacky" things we have to do to make it work.
    If OBS were to just be a passthrough application, it is very important to consider the behavior of native sources like browser and video. These output video and audio within OBS, and that's the best way to keep them in sync. We should still have the ability to get a direct feed of these types of sources. Browser sources almost have this nailed right now.

  29. kryztoval commented on Dec 15, 2023

    @kryztoval

    I like the idea of OBS having simple input devices that you can route the audio from the computer to.

    There is a way to do this right now, at least partially, if you use SteelSeries GG's Sonar, when you enable streamer mode it creates several devices (Game, Chat, Media, Aux, Mic) and it provides a couple of outputs (Personal, Stream) and you can drag and drop apps between them. Sadly this program is still in beta and sometimes the sliders do not apply until you move the applicaiton from inputs, etc. The one thing this one does not do is take the input from another interface and route it to one or more outputs (But you can do this with voicemeeter, easily).

    After this you can just use OBS to capture the Stream and Personal audio outputs and you are all set.


    All of this does not fix the sync issue from devices that only allow extracting audio and video from one connection and at the same time. For those I still do not see how this would or could fix that.

  30. goofyseeker311 commented on May 12, 2024

    @goofyseeker311

    There is still an issue with crackling audio with video capture device audio monitoring, related to this or not.
    The sound is fine in a recording of the same source, and also directly listening to the video audio on a dedicated app.
    So its definitely an OBS monitoring play-back only issue.

    Now I have to use the separate app to get the audio without crackling and have to use stream link NDI for OBS, instead of video capture device in OBS.

    yep I do plan to use OBS monitoring as main audio out. not a nice monitor if its not the same as the source and crackles.

    edit: now even the recording to video includes crackling. when the main audio did not contain any crackling.
    edit: the recording crackling was caused by windows 11 explorer crashing and rebooting fixed it. monitor crackling remains.

  31. marked Audio monitor desync #13411 as a duplicate of this issue on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform/windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions