Add a --audio-output-latency command-line argument
This allows optimizing the audio output latency on higher-end CPUs, especially in projects that do not expose a way to override this setting.
This commit is contained in:
@@ -111,7 +111,7 @@ Error AudioDriverALSA::init_output_device() {
|
||||
// In ALSA the period size seems to be the one that will determine the actual latency
|
||||
// Ref: https://www.alsa-project.org/main/index.php/FramesPeriods
|
||||
unsigned int periods = 2;
|
||||
int latency = GLOBAL_GET("audio/driver/output_latency");
|
||||
int latency = Engine::get_singleton()->get_audio_output_latency();
|
||||
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
||||
buffer_size = buffer_frames * periods;
|
||||
period_size = buffer_frames;
|
||||
|
||||
Reference in New Issue
Block a user