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.
This commit is contained in:
Billy Laws 2023-03-18 20:57:00 +00:00
parent 7e7ad78aaf
commit d3f0149af2
6 changed files with 28 additions and 24 deletions

View file

@ -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);

View file

@ -12,6 +12,7 @@
#include "common/common_types.h"
#include "common/reader_writer_queue.h"
#include "common/thread.h"
#include "common/polyfill_thread.h"
namespace Core {
namespace Timing {