120hz monitor on macOS, LOVE(?) tries to sync to 62 or 65 FPS instead of 120.
Posted: Wed Dec 27, 2017 7:55 pm
I've successfully connected a 120/144hz (it supports both, but I usually use 120) monitor to my mac and set it to 120hz in system preferences. It generally works perfect on most programs (no jitter), but in my Love2D game when using window.vsync it tries to sync to 60 for some reason instead of 120, and the timer for that is also very inaccurate resulting in very laggy/jittery/stuttering motion. That means it's not true vsync, just a crappy timer, which seems almost like it could be a deliberate, hardcoded 60hz framerate limiter (part of SDL maybe?)
It works fine when I use the same monitor (120hz + LOVE) on a windows PC. And it also gives smooth, non-jittery, tear-free 60hz movement in LOVE when I set the monitor to 60hz mode on mac. However even though LOVE tries to sync to 60hz, it does correctly report 120hz in the window flags which is odd. Could this be an SDL/OpenGL bug on macOS, considering the somewhat uncommon situation of mac+120hz+LOVE+vsync? I doubt this is a bug in mac, that would be pretty ridiculous.
EDIT: Okay, I did more testing... here's what's actually happening: with vsync *off* @120hz it tries to sync to 65 FPS (which explains the jittering), with vsync *on* @120hz it tries to sync to 62 FPS! (which produces slightly less jittering than vsync *off* (65 FPS), but still jittery)
It works fine when I use the same monitor (120hz + LOVE) on a windows PC. And it also gives smooth, non-jittery, tear-free 60hz movement in LOVE when I set the monitor to 60hz mode on mac. However even though LOVE tries to sync to 60hz, it does correctly report 120hz in the window flags which is odd. Could this be an SDL/OpenGL bug on macOS, considering the somewhat uncommon situation of mac+120hz+LOVE+vsync? I doubt this is a bug in mac, that would be pretty ridiculous.
EDIT: Okay, I did more testing... here's what's actually happening: with vsync *off* @120hz it tries to sync to 65 FPS (which explains the jittering), with vsync *on* @120hz it tries to sync to 62 FPS! (which produces slightly less jittering than vsync *off* (65 FPS), but still jittery)