Commit graph

4 commits

Author SHA1 Message Date
Nikos Chantziaras
0d46e464d2
Don't submit audio samples to frontend multiple times mid-frame
The core is submitting audio samples to the frontend in multiple calls
before the current video frame loop has finished. This is a bad idea, as
the retro_audio_sample_batch_t callback is a blocking call, since the
frontend performs audio sync.

When using a low audio latency setting in RetroArch (like 5ms), audio
dropouts can occur. It's also possible that input lag is increased,
since video frames are presented later than they could have. The calls
to retro_audio_sample_batch_t can block for over 10ms, unnecessarily
delaying video frame presentation.

This commit fixes the issue by submitting all accumulated audio samples
at the end of the current video frame. Since the rendered audio is
stored in a HeapFIFOQueue which is not contiguous, an extra buffer is
used to consolidate all samples into a contiguous buffer. The buffer is
a stack allocated std::array so there's no memory allocation involved.
2022-03-22 22:16:43 +02:00
DarthMew
dcff9d884d Dynamically hide software and hardware renderer specific options 2022-03-01 03:31:20 +01:00
DarthMew
542c6d14af Small touchup 2022-02-22 17:39:36 +01:00
DarthMew
4335a2ad7e Reduce the amount of files in the repo & rename 'duckstation-libretro' to 'libretro' 2022-02-21 23:16:22 +01:00
Renamed from src/duckstation-libretro/libretro_host_interface.cpp (Browse further)