# High Latency in UnrealEngine (editor and game)

**URL:** <https://qa.fmod.com/t/high-latency-in-unrealengine-editor-and-game/19903>\
**Category:** Unreal Engine\
**Tags:** ue4\
**Created:** [February 22, 2023, 5:02pm UTC](https://qa.fmod.com/t/high-latency-in-unrealengine-editor-and-game/19903 "2023-02-22T17:02:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcelEissens](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@MarcelEissens](https://qa.fmod.com/u/MarcelEissens)\
**Post date:** [February 22, 2023, 5:02pm UTC](https://qa.fmod.com/t/high-latency-in-unrealengine-editor-and-game/19903/1 "2023-02-22T17:02:47Z")

</div>

Hi all!

I’m experiencing latency issues, sadly.  
Now, the latency isn’t _that_ bad, but it’s definitely noticable.

I did a few tests to see if I can reduce the amount of latency:  
What I did to test the latency is setting up a microphone in the room, speakers blasting and measuring the duration of a mouse-click and the sound that’s supposed to play.

In FMOD Studio (clicking the play button):  
WASAPI is roughly 193ms latency (through a Focusrite Scarlett interface)  
ASIO is roughly 130ms latency.

In the engine I set up a simple widget with a button, and onPressed-\>PlayEvent2D+SetParameter  
In Unreal Engine (Editor):

Output type = Autoselect (wasapi)  
DSPBuffer Length = 128  
DSPBufferCount = 3  
FileBufferSize = 1024  
Latency is around 130ms

Output type = ASIO  
Untestable, no devices found in the editor

In Packaged Build (Shipping)

Output type = Autoselect (wasapi)(through a Focusrite Scarlett interface)  
DSPBuffer Length = 128  
DSPBufferCount = 3  
FileBufferSize = 1024  
Latency is around 116ms

Output type = ASIO  
DSPBuffer Length = 512  
DSPBufferCount = 1  
FileBufferSize = 1024  
Latency is around 132ms

On every output type and dsp setting there seems to be quite a bit of latency.  
Is there a way to lower this?

Also, ASIO might not be a viable option (mainly because in editor it doesn’t work, and I don’t want everyone to download a driver for playing the game hah)

Thanks in advance,

Marcel

EDIT:  
After lowering my DSP buffersize on the sound card (1024-\>128, 89ms-\>15ms) the latency is still 96ms

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [February 27, 2023, 9:25pm UTC](https://qa.fmod.com/t/high-latency-in-unrealengine-editor-and-game/19903/2 "2023-02-27T21:25:00Z")

</div>

Hi,

Thank you for the detailed information. What version of Unreal and FMOD are you using?

---

<div class="post-metadata">

**Author:** ![MarcelEissens](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@MarcelEissens](https://qa.fmod.com/u/MarcelEissens)\
**Post date:** [February 28, 2023, 10:06pm UTC](https://qa.fmod.com/t/high-latency-in-unrealengine-editor-and-game/19903/3 "2023-02-28T22:06:51Z")

</div>

Hi,

I’m using 4.27 (oculus source build) + FMOD 2.02.07  
Although I’ve heard that WASAPI has terrible latency on it’s own, what can I expect to be the least amount of latency with that driver? I know ASIO should be able to get much, much lower latency. I couldn’t set the dsp buffer too low when using ASIO.

Also, I don’t know if this is the way to go, but I change the output driver as follow:

I modified the fmod plugin code to check the user-settings (asio enabled, dsp size/count) in the module startup (the part where the settings are read). It works, but may not be ideal since it requires a full restart for the game to use the new settings.

Any advice is welcome, thanks in advance!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 7, 2023, 3:40am UTC](https://qa.fmod.com/t/high-latency-in-unrealengine-editor-and-game/19903/4 "2023-03-07T03:40:23Z")

</div>

Hi, apologies for the delayed response.

Thanks for that info.

Running simple tests without any of your improvements is showing 400ms for both FMOD and UE Sounds. I think you have pushed the improvements are far as possible currently.

On each button press are you creating a new event instance? Enabling the `Load All Sample Data` option in the [Unreal Integration | Settings](https://fmod.com/docs/2.02/unreal/settings.html#load-all-sample-data) may help reduce it further for `Streaming` audio sources.

Could I see the modifications you made to the code?
