How to use ASIO audio driver with Godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By djex81

How would I go about using ASIO audio drivers with Godot? For example using ASIO4ALL with Godot? I tried setting the audio driver in Project Settings > Audio > Driver to ASIO from the default WASAPI but this does not work. For some reason the AudioServer will only list the WASAPI devices and no ASIO devices. Do I have to provide the specific ASIO driver name?

I’m working on a rhythm style game and would like to see if using a lower latency ASIO driver would help.

:bust_in_silhouette: Reply From: Calinou

Godot only supports WASAPI for audio output on Windows, not ASIO. Regardless of this, keep in mind Godot currently can’t schedule audio events to be played at an absolute time.

I’m working on a rhythm style game and would like to see if using a lower latency ASIO driver would help.

In Godot 4.0, the Output Latency project setting will affect WASAPI – this hasn’t been backported to Godot 3.x yet.

Thank you for the clarification. I understand Godot currently can not schedule real time audio events through it’s API as I’ve struggled with this for way to long now. However I am very close to real time after many days of research and work.

I’m currently using a Windows Multimedia Timer as a clock source. It’s so far accurate to ~1ms. For each sound sample I am using AudioStreamGenerator as this is a bit faster than AudioStreamPlayer.Play(). Each sound is processed in it’s own thread with a AudioStreamGenerator for each. This is the best I’ve comes up with so far. Playing a standard 4 on the floor drum beat sounds great but every once in a while it will trigger to late or too early and so I’m trying to eliminate as many things that can cause latency.

I’ve been waiting for version 4.0 for year(s) now lol. I hope the output latency setting gets back ported as this would help a lot.

Edit: So it does look like it was back ported some time ago. I might have a look and compile Godot myself with the change.

djex81 | 2022-01-05 23:22