[macOS] Experiencing strange FPS behaviour with SDL 2.0.9

I’m experiencing some strange macOS FPS behaviour with the open source emulator Mednafen, which is written using SDL2. I’m not one of the primary Mednafen developers, but I have been trying to diagnose the bug and patch it if I can figure it out.

Using SDL 2.0.9, the framerate is capped at approximately 28FPS regardless of how much CPU a game is using. Games should be aiming to hit 60FPS, which is the behaviour for the same version of Mednafen under SDL 2.0.8. I was looking at the SDL 2.0.9 release notes, but I didn’t see any descriptions of anything that might have caused this. I’m wondering if there might be a bug in how it handles vsync or otherwise trying to lock the framerate - any help diagnosing this would be really appreciated!

The bug occurs on macOS 10.13 and 10.14 using SDL 2.0.9. It doesn’t reproduce using any older version of SDL.

1 Like

Tracked it down with a bisect - it’s this commit: https://hg.libsdl.org/SDL/rev/ffd52bb02bcc

Confirmed by updating to the latest tip, then reverting that one commit; performance returns to the expected behaviour at that point.

1 Like

Please submit a bug at https://bugzilla.libsdl.org so that this doesn’t get lost.

Filed a bug: https://bugzilla.libsdl.org/show_bug.cgi?id=4481

1 Like