diff options
| author | 2023-03-18 20:57:00 +0000 | |
|---|---|---|
| committer | 2023-03-27 21:34:28 +0100 | |
| commit | ea5dd02db9bdb9759a400907672ec6606bebb96b (patch) | |
| tree | 9f6f4f4662eb48ad57fe713e29f6b98778f263bf /src/audio_core/renderer/adsp | |
| parent | audio: Interpolate system manager sample count using host sink sample info (diff) | |
| download | yuzu-ea5dd02db9bdb9759a400907672ec6606bebb96b.tar.gz yuzu-ea5dd02db9bdb9759a400907672ec6606bebb96b.tar.xz yuzu-ea5dd02db9bdb9759a400907672ec6606bebb96b.zip | |
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')
| -rw-r--r-- | src/audio_core/renderer/adsp/audio_renderer.cpp | 2 | ||||
| -rw-r--r-- | src/audio_core/renderer/adsp/audio_renderer.h | 1 |
2 files changed, 3 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() { | |||
| 189 | max_time = std::min(command_buffer.time_limit, max_time); | 189 | max_time = std::min(command_buffer.time_limit, max_time); |
| 190 | command_list_processor.SetProcessTimeMax(max_time); | 190 | command_list_processor.SetProcessTimeMax(max_time); |
| 191 | 191 | ||
| 192 | streams[index]->WaitFreeSpace(); | ||
| 193 | |||
| 192 | // Process the command list | 194 | // Process the command list |
| 193 | { | 195 | { |
| 194 | MICROPROFILE_SCOPE(Audio_Renderer); | 196 | MICROPROFILE_SCOPE(Audio_Renderer); |
diff --git a/src/audio_core/renderer/adsp/audio_renderer.h b/src/audio_core/renderer/adsp/audio_renderer.h index 151f38c1b..f97f9401e 100644 --- a/src/audio_core/renderer/adsp/audio_renderer.h +++ b/src/audio_core/renderer/adsp/audio_renderer.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | #include "common/reader_writer_queue.h" | 13 | #include "common/reader_writer_queue.h" |
| 14 | #include "common/thread.h" | 14 | #include "common/thread.h" |
| 15 | #include "common/polyfill_thread.h" | ||
| 15 | 16 | ||
| 16 | namespace Core { | 17 | namespace Core { |
| 17 | namespace Timing { | 18 | namespace Timing { |