Skip to content

Random short audio dropouts when recording or streaming #4600

Open

Description

@floele

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

27.0.0-rc2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://pastebin.com/WfdNU2QN

OBS Studio Crash Log URL

No response

Expected Behavior

Audio recording without dropouts.

Current Behavior

When recording or streaming, audio data contains multiple random short audio dropouts.

Looks like this:
grafik

Distribution of the dropouts seems to be random but happen at a certain rate depending on which computer it is being run on. On my computer it’s approx. every 5 minutes, I have seen it on another computer where it happens roughly twice per hour.
For a 40 min. test recording on my computer, dropouts have occurred at these time stamps:
00:03:19
00:09:40
00:15:38
00:19:51
00:23:41
00:29:55
00:36:07
The length of the dropouts are not necessarily all the same length.

Steps to Reproduce

  1. Launch OBS.
  2. Start test tone (I use https://www.szynalski.com/tone-generator/).
  3. Record desktop audio using OBS (all default settings) and wait.
  4. After stopping the recording, audio dropouts can be found in the resulting file.

As indicated above, the frequency of this issue seems to depend on hardware and may either not occur at all or very rarely on some systems, I'm not sure what it depends on.

The issue can also be reproduced without using a test tone of course, but a continuous tone makes it easier to check the resulting file for dropouts.

Anything else we should know?

Conditions

I have been testing on Windows 10 20H2 with OBS 26.1.2-276 and 27.0.rc2, 64 bit, without any video source configured (issue also happens with video configured though).

The issue seems to be independent of OBS settings (like audio sample rate or output format). I have not yet found any setting in the OS (like energy settings) that fix or reduce the issue.

The frequency of the issue seems to depend on the hardware. There are systems where I was not able to reproduce the issue, though I did not make excessively long recordings (> 4 h) to eliminate the possibility of the issue occurring on these systems.

The issue is not limited to recording from desktop audio but also applies when recording from external USB audio interfaces.
The issue is not limited to recording but also applies to streaming.

When an audio dropout occurs, the message “can't discard, data still pending” is seen in the debug output (if compiled with DEBUG_AUDIO).

The attached log file includes a debug message (Capture size: 480) I added, it outputs the captureSize variable in ProcessCaptureData() to check for any changes in amount of data being returned there.

Debug attempt

I’m not familiar with the OBS code base and the audio processing happening, but to me it seems like the problem is the fact that in audio_callback(), it always takes a fixed amount of data from the audio buffer (audio_size = AUDIO_OUTPUT_FRAMES * sizeof(float)) even if the buffer is not sufficiently filled due to potential delays in the capture thread.

What I have tried to solve this issue is basically waiting for the buffer to be filled, like this in audio_callback.

		if (!source->audio_pending && source->audio_ts > 0) {
			int iterations = 0;
			while (source->audio_input_buf[0].size < 4096) {
				blog(LOG_DEBUG,
				     "waiting 2 ms for audio buffer to fill (%s)",
				     obs_source_get_name(source));
				os_sleep_ms(2);
				iterations++;
			}

			if (iterations > 0) {
				blog(LOG_DEBUG,
				     "waited %i iterations for the audio buffer to fill",
				     iterations);
			}
		}

This significantly reduces the number of dropouts (on my system to like 1 in half an hour), but it’s not a good solution because additional to not entirely fixing the issue it doesn’t recover from the situation and adds continuous wait cycles after the first dropout that far exceed the number of dropouts that would have actually occurred. Also it seems kind of wrong to me doing that in the first place.

I would appreciate some guidance or a fix for this issue.

Activity

  1. WizardCM commented on May 13, 2021

    @WizardCM
    Member

    To confirm, this issue is not new in 27, as you've verified it in OBS 26.1.1?

  2. floele commented on May 14, 2021

    @floele
    ContributorAuthor

    Yep, I have been investigating this in 26 already and only confirmed that it's still there before reporting.

  3. DJ-3ncoder commented on Jun 17, 2021

    @DJ-3ncoder

    I found a simillar or maybe the same issue in my latest stream recordings.

    My software and hardware:
    OBS 27.0.1
    Windows 10 64bit
    Focusrite Clarett 4Pre USB

    My signal chain: Pioneer DJ Mixer puts out 48kHz signal via S/PDIF into the Focusrite Clarett.
    The soundcard gets the S/PDIF clock from the mixer and is locked to it.
    Every soft- and hardware is set to 48kHz.

    OBS_Audio-drop-out

    On the top there is the recording done with Audacity and on the bottom there is the audio-track from the recorded video.
    Recording is set to "stream encoder" (nvenc), mkv and remux to mp4 afterwards.
    The drop-out occurs in the mkv and mp4.
    Both audio-tracks are recorded using the same interface on the same computer. Audacity looks fine but OBS is struggling.

    After scrolling through the waveforms I found this:
    OBS_Audio-time-shift
    To get the first picture I aligned the waveforms after the drop-out. The second picture is before the audio-drop out.
    You can see that the waveforms are not aligned. The bottom waveform (=OBS) is earlier in time.
    After seeing that I was thinking that the drop-out is more like a "break" in the signal because when you delete it and move the bottom waveform to the right, both are aligned all the time.

    These drop-outs or "breaks" happen randomly. I do not click anything because in the video everyone can see that I am not in front of my PC.

    Due to the fact that the Audacity recording is fine on the same PC I think this issue is caused by OBS.
    I do not know if it occurs in the stream too, nobody is listening that carefully.

    Log-file: https://cloud.3ncoder.com/s/nsS7n98QYED9Tnr

  4. konsolenritter commented on Jul 5, 2021

    @konsolenritter

    Unfortunately i must confirm. Still using obs 26.1.1 under win10. All sound devices disabled but a steinberg ur-22. External playback of 1khz tone. i7 10th generation nearby idling.
    With recording or streaming the same experience: By chance (random) happen such short dropouts. Sometimes once within in a couple of minutes, sometimes two dropouts within 20 seconds or even less. Randomly distributed.
    The try/workaround as of user floele i find very interesting.

    Due to the nature of live events in the case of streaming people tend to be forgiving alot, especially in the case of ultra-short outages (its almost anticipated these days). But even then a short cut on audio is more distracting then a few lost frames. So ever stable audio wins (and is more important) over stable video for normal broadcast.

    Would be unbelievable happy if that nasty thing could be fixed.

  5. floele commented on Jul 6, 2021

    @floele
    ContributorAuthor

    Unfortunately I did not have time too look into the issue futher, just wanted to share the last thing I found out.
    It looks like (at least on my PC) I'm dealing with two different kind of dropouts. A frequent one (occurs roughly every 5 minutes) and an infrequent one (maybe each 30 min.).

    I was able to fix the frequent one by changing the sleep method to a more precise alternative (example commit floele@a34fda1), but the issue I actually want to fix is the infrequent one because it reproduces on the machine I'm concerned about (and many other machines as far as I know). This one does not seem to trigger a “can't discard, data still pending” debug message so at this point I'm not sure when it is triggered or what is causing it.

  6. konsolenritter commented on Jul 6, 2021

    @konsolenritter

    Is anybody else working on that issue here?
    My C or C++ is fifteen years ago..., so there is a little rust around. ;)
    I could imagine to invest a couple of hours into the obs-audio world over the next few weeks. My problem is, that i don't have a working environment to test and compile for windows here by myself. I'm totally fan of free software, but when it comes to ms studio or something alike... shiver

  7. DJ-3ncoder commented on Sep 12, 2021

    @DJ-3ncoder

    I found out that the problem that I am facing occurs at around 1h 7min of stream/recording time. It occurs only once but everytime at the same time!

    grafik

    Audacity recordings are fine. Changing the buffer size in the Focusrite panel makes no difference.

    Maybe I can find out how to change log level to debug or so to find out what happens at 1h 7min.

  8. bnacar commented on Jan 26, 2022

    @bnacar

    It's not just on Windows. This has been happening to me during livestreams and recordings on both MacOS and Linux, on average once every ten minutes. Just now I was able to replicate this after compiling from the latest source on Linux (Debian Stable). With OBS and Audacity recording simultaneously for fifteen minutes, I got two dropouts in the OBS recording and none from Audacity.

    @floele were you ever able to pinpoint the cause of the less-frequent dropouts?

  9. floele commented on Jan 27, 2022

    @floele
    ContributorAuthor

    Unfortunately I have not yet looked into it any further...it's still bothering me though.

  10. DJ-3ncoder commented on Feb 10, 2022

    @DJ-3ncoder

    Since the beginning of 2022 I tried the ASIO plugin for OBS.
    I set my input accordingly and the drop outs are still there.
    grafik

    I also tried on a different computer (but the same soundcard). Same result, 1 drop out at timestamp 01:xx:xx of recording.

    I am still shure that this bug is caused by OBS itself and not by my soundcard. It annoys me very much.
    Is there a way to change log level in OBS? I want to find out what is happening at that time.
    Normal loglevel does not log that drop out.

  11. floele commented on Feb 10, 2022

    @floele
    ContributorAuthor

    If you combile OBS yourself you can enable the DEBUG_AUDIO flag for more logs.

    After fixing one of the issues (the frequent dropouts) there weren't any relevant logs left corresponding to the occurrences of the issue on my PC though. So it's likely that these logs won't help you at all.

    I also tried ASIO without success.

  12. konsolenritter commented on Feb 11, 2022

    @konsolenritter
  13. floele commented on Feb 11, 2022

    @floele
    ContributorAuthor

    Yes, there are build instructions available. I would link to it, but apparently there is currently some reorganisation happening and the page asks not to link to it for the moment. So just look for it on Google ("Build Instructions (Windows) - OBS Studio").
    You basically only need VS 2019 with C++ and install some additional tools (like QT). It's doable.

    As for the issue, I've been focusing on https://github.com/obsproject/obs-studio/blob/master/libobs/media-io/audio-io.c and https://github.com/obsproject/obs-studio/blob/master/libobs/obs-audio.c but I'm starting to believe that maybe the issue might be at a later point in execution, maybe the muxing process.

    The reading is basically sleep() controlled as far as I can see. As per my previous comment, this seems to be unreliable on my hardware so I replaced it with a different method, but that doesn't solve the problem everyone is having.

  14. Fenrirthviti commented on Feb 11, 2022

    @Fenrirthviti
    Member

    apparently there is currently some reorganisation happening and the page asks not to link to it for the moment.

    Where exactly are you seeing this comment? Our official build directions are on our Wiki pages here: https://github.com/obsproject/obs-studio/wiki/install-instructions

    There is a pending cmake rewrite that will change how some things work at a high level, but the overall process should be largely unchanged.

  15. bnacar commented on Feb 12, 2022

    @bnacar

    I tried adapting @floele's solution - of making the sleep time in the audio thread more precise - for Linux, and for whatever reason, it didn't affect the frequency of the dropouts (on my system anyway). I did several other experiments and this what I observed on my system:

    The vast majority of audio dropouts that I've encountered are indeed correlated with the "data still pending" message, and these dropouts have a duration equivalent to whatever I set AUDIO_OUTPUT_FRAMES to. Using Audacity to visually inspect the recorded audio, the waveforms at the beginning and end of these dropouts line up, i.e. audio data is getting delayed, not deleted, and delayed by just about one sleep cycle.

    In addition to making the sleep time in audio_thread more accurate, I tried setting AUDIO_OUTPUT_FRAMES to 768, which corresponds to a nice round number of 16 milliseconds when recording at 48kHz. Unfortunately this didn't make any difference either.

    I'm not familiar with what sequence of events will deterministically result in a call to add_audio_buffering, but I tried modifying this function to add an absurd amount of buffering when it does get called:

    - ticks = (int)((frames + AUDIO_OUTPUT_FRAMES - 1) / AUDIO_OUTPUT_FRAMES);
    + ticks = (int)((frames + 3 * AUDIO_OUTPUT_FRAMES - 1) / AUDIO_OUTPUT_FRAMES);
    

    On the occasions that add_audio_buffering does get called, the additional extra buffer results in an initial long stretch of recording (on the order of 20 to 30 minutes) completely free of dropouts, but over that time the buffer gradually shrinks until there isn't enough data available, and then the dropouts resume.

    In short, audio data is being output slightly faster than it gets added to the buffer. If this discrepancy is unavoidable, the permanent solution might be closer to the original proposed fix of adjusting the sleep time on the fly with extra wait cycles (I haven't tried this myself yet).

  16. 72 remaining items

  17. moonlightes commented on Jun 26, 2023

    @moonlightes

    What is your use case exactly? Which sound stutters; what you hear or what is recorded or both? Did you make sure to use the plugin on all audio sources in your scene?

    Quite possibly I did not understand how to use the plugin. I installed it and added a filter for the microphone and windows sound, then I launched the tone generator. Clicks are heard on the recording, and the more samples the plugin adds, the more often they.

  18. moonlightes commented on Dec 11, 2023

    @moonlightes

    Obs v30 in release and the problem is still present.
    Hardware: motu m2.
    --verbose when stuttering shows: "Audio timestamp for 'Playback Device' exceeded TS_SMOOTHING_THRESHOLD" and the same for the microphone
    obs-async-audio-filter helps in my case.
    Is it such a rare problem that it remains unresolved after all this time?

  19. 0x01011970 commented on Jan 5, 2024

    @0x01011970

    I can confirm the problem is still present on windows.

    I could confirm the issue is happening in OBS by recording audio at the same time in OBS and in Bitwig (for ASIO) and Audacity (for WASAPI).

    Both on a Focusrite USB audio card (both ASIO & WASAPI) and on an onboard realtek audio card (WASAPI).

    I tried both "Use Device Timestamps" enabled and disabled.

    In every single tests, no sample drops can be seen in the raw PCM audio file produced by Audacity or Bitwig.

    In every single tests, several sample drops can be seen in the recorded file by OBS (.mkv, .mp4, AAC or PCM 24 sle or 32 float).

    I make sure all software and windows settings use same sampling frequency and depth.

    CPU and GPU both bellow 50% usage, plenty of RAM & VRAM

    There is also a secondary issue. By aligning the start of both sound waves, you can see the OBS soundwave is stretched over time. The OBS audio ends at a later timestamp than the one in Audacity or Bitwig. Logic would dictate since samples are missing in the OBS audio file that it would be shorter, but it’s the reverse.

    I did not try https://github.com/norihiro/obs-async-audio-filter/, it is not a viable workaround.

  20. HWesterhof commented on Oct 16, 2024

    @HWesterhof

    I can confirm the problem is still present on windows.
    I did not try https://github.com/norihiro/obs-async-audio-filter/, it is not a viable workaround.

    I can confirm as well (see my duplicate report in #11407)

    But for me, the mentioned plugin solves my issue totally.

  21. cleary commented on Dec 12, 2024

    @cleary

    Dropping a note here as it seems related:
    OS: Linux (ubuntu studio 24.04)
    Interface: Focusrite Scarlett 8i6 (gen 1)
    OBS: 30.2.3-0obsproject1~noble (from the obs repos)

    Whenever recording a stream of "browser based creativity" using the Desktop Audio as the audio source, I get regular (~30s apart) small audio glitches in the recording similar to @bnacar 's visual example for the "frames ... size ... placement ..." message

    It's a workaround only, but sometime you need a quick fix:
    Adding a JACK input client to the obs sources, then routing directly from the browser to the JACK input source removed the artifact

  22. Cippo95 commented on Dec 25, 2024

    @Cippo95

    Hello, I have the same issue on Linux.

    I use Fedora 41 and I see the exceeded TS_SMOOTHING_THRESHOLD debug message.
    immagine

    I can see the drop outs using Audacity:
    immagine

    It happens both with PulseAudio and JACK implementations (but the former adds buffering when it happens).

    Recording with other software works well and I hear this issue on many videos on YouTube.

    I hope that this bug gets fixed soon, having clean audio is the starting point with recording software, but I also understand that open source software is a gift hence I can't really be mad about this.

  23. mindscarp commented on Jul 7, 2025

    @mindscarp

    I'm also getting this issue on Windows 11 (24H2 / 26100) with OBS Studio 31.0.4 (64 bit) where the audio infrequently cuts for about 20 milliseconds.

    Image

    Using the obs-async-audio-filter ( https://github.com/norihiro/obs-async-audio-filter/ ) completely solves the issue. I see that the pull request was made in April 2022 ( #6351 ) and is only pending a review from @Lain-B , is it planned to be incorporated in a future release?

  24. noodohs commented on Jul 11, 2025

    @noodohs
  25. djrbos commented on Aug 7, 2025

    @djrbos
  26. slrslr commented on Mar 29, 2026

    @slrslr

    I had the issue described in this page title and it was SOLVED by leaving only one audio device enabled in File > Settings > Audio
    and then decreasing "Sample Rate" from 48 kHz (automatically and possibly wrongly detected by OBS) to 44.1 kHz. I have Linux Ubuntu with Wayland and OBS 30.0.2.1-3build1 from default apt repository.

  27. Acey05 commented on Apr 11, 2026

    @Acey05

    Hello, sorry to suddenly come in, but I was curious about something.

    I decided to test out 3 different Video Recording softwares alongside OBS to narrow down the issue, and honestly, I'm at a loss here since I got a consistent result.

    Audacity DOES NOT have the audio drop issues at all, no matter how long I run it for or what I do with it (I'm talking about setting everything badly and wrong so it breaks - nothing broke so far).

    On the other hand, the Audio Interface that I had (the UMC202HD) is basically dropping audio at intervals no matter what I do WHEN I'm using Software like OBS, Meld, XSplit (I think), etc. I don't have another Audio Interface to test if this is a hardware issue, but it's wild on how this seems to be an issue that is consistent.

    What's even wilder, is that if I go back to using the 16bit/48khz USB of the Mic WITHOUT the Audio Interface, the problems stop?

    Again, the crux here is that Audacity doesn't show these issues, BUT 3 different OBS-Like softwares all share the same issue (down to the same drops at the same points).

    Is this a known issue in general with Software like OBS, Melda, etc. or what? I have never seen something like this in my life, and assuming these Softwares for some reason don't play well with Audio Interfaces (forget about those that don't even have access to Filters like Meld) what is one supposed to do?

  28. jxngai commented on Apr 19, 2026

    @jxngai

    I am experiencing this exact issue. I recorded a 1.5 hour video. Short pauses were observed 5 times. They were about 50 - 60 ms in length.

    I am using Windows 11, Presonus Revelator IO24 audio interface. Studio One is DAW used to capture the audio from the output of another interface (Behringer UMC204HD) connected to a separate Macbook.

    I have been having this problem for a while. But only started to look into this seriously now.

    Does norihiro/obs-async-audio-filter support Windows 11 ?

  29. konsolenritter commented on Apr 19, 2026

    @konsolenritter
  30. yllekz commented on Apr 29, 2026

    @yllekz

    I've been running into this for what feels like a year now on OBS on macOS. No idea what's wrong. Tried a bunch of stuff but nothing seems to fix it. M4 Pro MBP.

    Edit: It was the cable running from my laptop to my audio interface. Fixed the issue after I replaced the cable. USB Printer cables are fragile.

  31. TheKleesh commented on Oct 22, 2026

    @TheKleesh

    I have been having this exact issue with the MOTU M2 for over five years. I have seen it in Windows 10, Windows 11, and most recently Ubuntu 26.04. In a similar vein to everyone else, I have zero problems whatsoever using the interface in my DAW. It is exclusively an OBS problem in my experience. I ended up buying a Focusrite Scarlett 2i2 just to see if that would be any different, and for some reason that interface works flawlessly in OBS without any specific settings. But I don't think needing to buy another $100+ piece of hardware is a very good solution. I just tried the Asynchronous Audio Filter Plugin as others have mentioned and my first impression of it is it does appear to completely fix the issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions