mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.62k stars 771 forks source link

Framepacing issues #3125

Closed perguto closed 7 months ago

perguto commented 7 months ago

image

The frametimes of the mgba standalone program aren't even, but have regular small spikes (See the spikes in the pink frametime graph). For comparison, the mgba core in Retroarch has basically perfect framepacing:

image

endrift commented 7 months ago

Duplicate of #2199, or close to it.

perguto commented 6 months ago

I did some further testing and found out that it's an audio synchronization issue. Turning off audio sync stabilizes the framerate, but introduces some noise, which can be fixed by setting the buffer size sufficiently high (4096 samples), which however leads to noticable audio lag (about 120ms?). Still suboptimal, as Retroarch runs fine with just 30ms of audio latency.