obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
57.29k stars 7.72k forks source link

[BUG] Audio delay #2801

Open ayygurl opened 4 years ago

ayygurl commented 4 years ago

Platform

Operating system and version: Windows 10 1903 - 64 bits OBS Studio version: 25.0.4 and older versions

Expected Behavior

I should be able to route my audio signal from my DAW (Reaper) to OBS wihout it getting delayed.

Current Behavior

OBS Studio is adding delay onto the audio signal that's coming from Reaper. The audio input is handled Synchronous Audio Router, a software that lets me route the audio from Reaper to OBS by creating a new Windows input device.

Back when I was using OBS 23.1.0, the delay would appear and then disappear pretty noticeably thanks to a glitch that could be briefly heard. -> https://clips.twitch.tv/CuriousIcyRamenMoreCowbell -> logs

This is not the case anymore. The delay doesn't even disappear, it just gradually builds up until the recording/stream stops. -> https://youtu.be/mbBcmNwInr0 -> logs for the recording of the faulty click

What you're hearing in that video is two metronome beats that are supposed to be synchronised but aren't. One of them is the signal being sent by Reaper captured using Audacity, the other one (the one pitched higher or "the faulty click" as I previously called it) is the signal captured using OBS. Both takes were routed using Synchronous Audio Router.

The two beats are synchronised up until about 6 minutes and 43 seconds where the metronome beat captured by OBS suddenly loses track by about 23 miliseconds. You can see that here: https://puu.sh/Fqr2Z/145da57614.png

From there, as previously mentionned, it gradually starts building up delay until the recording stops.

Steps to Reproduce

  1. Open up the DAW of your choice equipped with any tool that can route the DAW's signal to OBS, in my case I'm using Reaper along with Synchronous Audio Router.
  2. Insert a metronome in your DAW.
  3. Open up OBS, start recording.
  4. Play the metronome.
  5. Make sure OBS is capturing the metronome and let it record for about 30 minutes.
  6. Once you're done recording, convert the video into an audio file so that it can then be imported into your DAW.
  7. Compare the intial metronome to what you've recorded using your DAW.
  8. Cry.

Additional information

I've tried:

Disabling CPU throttling. Using another USB port for my audio interface. Using CoreAudio ACC encoder. Recording without my other USB devices plugged in. Using two other computers. Buying a new interface. (UMC404HD -> Studio 68c) Using another DAW. Using a bigger sample size. Using ReaRoute along with the obs-asio plugin instead of Synchronous Audio Router to route the audio from Reaper to OBS (I've done most of my tests, in fact, using ReaRoute.) Ticking the "Use Device Timestamps" box. Using another encoder on OBS.

..and probably a bunch of other stuff, but in vain. The delay may kick in at a different time depending on certain variables such as the interface I'm using, but it's ALWAYS there. The only ways I've managed to get rid of it were by using DirectSound, ASIO4ALL and WASAPI (in exclusive mode, NOT shared) on Reaper instead of the usual interface drivers I use. My friend, who's using a Steinberg UR44 interface, also doesn't have any issues. I've tried using the same OBS/Reaper settings than him but it didn't work.

Some log files contain a line about OBS adding some audio buffering to the recording. What's weird about this is that: a) I believe the line isn't always there even though the delay is. b) the line isn't logged at the same time than when the delay kicks in even though the value of it is the same (23 miliseconds as previously mentionned).

My desktop audio signal isn't getting delayed, only the signal that's coming from my DAW is.

Audacity and Voicemeter Banana do not suffer from this problem, only OBS does as far as I know.

RytoEX commented 1 year ago

Please confirm if this is still an issue in OBS Studio 28.0.2.

ayygurl commented 1 year ago

Please confirm if this is still an issue in OBS Studio 28.0.2.

It's still loses track after a few minutes and then starts gradually building up delay.

gxalpha commented 11 months ago

@ayygurl hi, could you turn on "Low Latency Audio Buffering Mode" in Settings -> Audio -> Advanced and see if it's still an issue with that enabled?