Andersama / obs-asio

ASIO plugin for OBS-Studio
GNU General Public License v3.0
664 stars 43 forks source link

How to specify audio buffer size #145

Open 0x01011970 opened 6 months ago

0x01011970 commented 6 months ago

Hello,

Is there anyway to specify the sizes of the different audio buffer used by OBS & ASIO ?

I am not referring to the sample size of the audio card which is already at maximum 1024 (focusrite).

I am having a few audio glitches in content recorded using OBS.

I also have these log messages : "07:24:28.105: adding 42 milliseconds of audio buffering, total audio buffering is now 64 milliseconds (source: ASIO Input Capture)", not happening at the same time as the glitches.

I would like to specify the size of the audio buffering to try and see if the audio glitches disappear.

Is there any way for me to specify the size of the buffer mentioned in the log?

Also, would anyone know what kind of events can trigger these auto adjustments?

Thanks in advance

Andersama commented 6 months ago

It's been too long since I've touched obs source code. However, the buffer that you're referring to is obs's internal buffer to keep audio roughly in sync with video, which of course naturally, you don't get control over. And if I remember correctly, If there's processing hiccups that buffer extends and essentially represents an ever increasing time delay that your computer has stored for when it pushes out packets or attempts to write to disk etc... If your processor's overly busy with other things that can be an issue.

obs's audio engine processes 1024 (perhaps that's changed, I doubt it) samples at a time per filter / loop / callback, however you'd like to put it. I'd recommend actually keeping your asio's device buffer <1024. The main benefit of asio actually is the low latency / the tightness of your recorded audio to the stream, hopefully your device should be stable at a lower value.