libretro / gambatte-libretro

Hard fork of Gambatte to the libretro API.
http://sourceforge.net/projects/gambatte/
GNU General Public License v2.0
104 stars 79 forks source link

Fix audio sample pacing + enable runtime selection of audio resampler #224

Closed jdgleaver closed 2 years ago

jdgleaver commented 2 years ago

At present, the core has bad audio sample pacing:

As a result, the core is 'abusing' the frontend audio buffer, leading to poor performance at low audio latencies and bad AV synchronisation.

This PR fixes the issue. Samples are now output with even pacing, and usage of the audio batch callback is minimised to once per frame.

In addition, the PR adds a new Audio Resampler core option which allows the audio resampler to be changed at runtime. Previously this was a complier option, which meant several platforms were limited to using only the (poor quality but fast) Convoluted Cosine algorithm.