aboutsummaryrefslogtreecommitdiff
path: root/src/audio_core/renderer/adsp/audio_renderer.cpp
diff options
context:
space:
mode:
authorBilly Laws <blaws05@gmail.com>2023-03-18 20:57:00 +0000
committerBilly Laws <blaws05@gmail.com>2023-03-27 21:34:28 +0100
commitea5dd02db9bdb9759a400907672ec6606bebb96b (patch)
tree9f6f4f4662eb48ad57fe713e29f6b98778f263bf /src/audio_core/renderer/adsp/audio_renderer.cpp
parentd8fc3f403b62e2b3d67ec08791fdc66847ddb4ac (diff)
audio: Wait for samples on the emulated DSP side to avoid desyncs
Waiting on the host side is inaccurate and leads to desyncs in the event of the sink missing a deadline that require stalls to fix. By waiting for the sink to have space before even starting rendering such desyncs can be avoided.
Diffstat (limited to 'src/audio_core/renderer/adsp/audio_renderer.cpp')
-rw-r--r--src/audio_core/renderer/adsp/audio_renderer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp
index 42b4b167a..503f40349 100644
--- a/src/audio_core/renderer/adsp/audio_renderer.cpp
+++ b/src/audio_core/renderer/adsp/audio_renderer.cpp
@@ -189,6 +189,8 @@ void AudioRenderer::ThreadFunc() {
max_time = std::min(command_buffer.time_limit, max_time);
command_list_processor.SetProcessTimeMax(max_time);
+ streams[index]->WaitFreeSpace();
+
// Process the command list
{
MICROPROFILE_SCOPE(Audio_Renderer);