1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00:00

LibAudio: Improve latency on audio queue failures

We don't know what is a good time to wait after an audio buffer fails to
be processed by AudioServer. However, it seems like decreasing the wait
time to 10ms after such a failure should improve latency and has not
caused issues in my testing. After all, 10ms is quite some time in audio
sample magnitudes.
This commit is contained in:
kleines Filmröllchen 2021-07-05 14:34:14 +02:00 committed by Andreas Kling
parent 96155009dd
commit c8ced9f11d

View file

@ -20,7 +20,9 @@ void ClientConnection::enqueue(const Buffer& buffer)
auto success = enqueue_buffer(buffer.anonymous_buffer(), buffer.id(), buffer.sample_count());
if (success)
break;
usleep(100000);
// FIXME: We don't know what is a good value for this.
// For now, decrease it to enable better real-time audio.
usleep(10000);
}
}