Slight Mouse Look Stutter on M1 Mac

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Andrew67100
Posts: 14
Joined: Thu Jun 23, 2022 1:14 am
Graphics Processor: Apple M1

Slight Mouse Look Stutter on M1 Mac

Post by Andrew67100 »

It's hard to notice on a 60 Hz display, but at higher refresh rates, I'm getting a very slight stutter that I believe has something to do with how GZDoom interprets mouse movements in relation to MacOS, but I'm not sure. Using the exact same mouse (Logitech G305) and same G Hub software on both my PC and Mac Studio, set to the same settings, my PC has no such stutter issues. It almost looks like the renderer is skipping or dropping frames, but looking at the FPS counter and frame time counter, it's perfectly steady, and I'm only running GZDoom at 100 FPS. The issue seems like it's only noticeable with Vsync turned on, but is still there with vsync off and the game running at much higher frame rates. It's just much more severe with Vsync on.

Again, running GZDoom and G Hub with the exact same settings between my PC and Mac on the same monitor shows the PC having no issues and the Mac showing a stutter. I'm going to try to capture a video of it and post a link here later. This has been bugging me a lot since I love that GZDoom runs ARM native on my Mac Studio, and I really prefer playing on my Mac so I don't have to boot up my PC.
User avatar
Rachael
Admin
Posts: 13211
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Slight Mouse Look Stutter on M1 Mac

Post by Rachael »

Unfortunately this seems to me to be a hardware limitation. The dead giveaways are that it happens more often with a higher refresh rate, and that it's more noticeable with vsync on. Classic symptoms of the hardware working at its limits, such that if GZDoom has to do more work than usual in a single frame it manifests as a frame drop.

I don't know where my iMac compares hardware wise to your Mac Studio, I'd imagine mine is a lot weaker in specs, but with GZDoom I do have to set vid_scalefactor 0.5 in the console in order to get a smooth frame rate. Getting the full native resolution simply isn't necessary on it since it's a Retina display and it only causes the hardware to work unnecessarily hard. It's playable, sure, and it does really look nice at native resolution, but it's not a good experience overall.

My RTX card can handle those resolutions because it simply is a better chip than the M1's GPU. Don't get me wrong the M1 is impressive for a low-power chip but it still does not fit the gaming rig category. And that's the simple hard truth about Macs. It does fare better than the old GTX series cards at least though, if only slightly.

Macs are not built with gaming rig specs, that's the unfortunate simple truth of it. So you'll have to accept that the hardware is weaker than on PC's. I really wish Apple got their heads out of their ass and bothered to license Mac OS to be used on non-Apple machines - oddly, for a company this greedy, it's one hell of a missed opportunity. The only thing impressive about my iMac is the display itself, unfortunately.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48543
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Slight Mouse Look Stutter on M1 Mac

Post by Graf Zahl »

Rachael wrote: Wed Sep 07, 2022 2:16 am oddly, for a company this greedy, it's one hell of a missed opportunity. The only thing impressive about my iMac is the display itself, unfortunately.
I think they'd lose more that way because they cannot sell their overpriced hardware anymore. They are scamming $200 off each system using a 500GB SSD compared to the worthless 256GB variant. That doesn't even factor in the loss of control.

Back to the mouse - unlike Windows macOS has no low level interface for its input devices, so it has to travel through all those GUI abstraction layers. You can enable such a mode on Windows, too, but it flat out sucks.
Andrew67100
Posts: 14
Joined: Thu Jun 23, 2022 1:14 am
Graphics Processor: Apple M1

Re: Slight Mouse Look Stutter on M1 Mac

Post by Andrew67100 »

Rachael wrote: Wed Sep 07, 2022 2:16 am Unfortunately this seems to me to be a hardware limitation. The dead giveaways are that it happens more often with a higher refresh rate, and that it's more noticeable with vsync on. Classic symptoms of the hardware working at its limits, such that if GZDoom has to do more work than usual in a single frame it manifests as a frame drop.
This is definitely not a lack of power of this machine. When testing this M1 Max equipped Mac Studio against my RTX 3060 PC, it always runs every WAD significantly faster than my PC. It's some strange behavior of GZDoom for MacOS and even enabling variable refresh rate does not solve it. I guess I could more accurately describe it as 'jitter' rather than stutter, as there is no lack of frames. My Mac Studio can run DOOM II at well over 500 FPS at my monitor's resolution, and locking the framerate to 100 FPS does not cause this jitter to go away. Watching the frame rate counter shows there is no drop in frames or even slight stutter. But, there is some weird rendering jitter where it almost looks like the game phases back and forth within a few milliseconds. It's very hard to notice and is just bugging me because my PC version does not have this issue.

Running vkQuake and a relatively more demanding game like Arcane Dimensions shows no such issues. My Mac can play it at well over 500 FPS as well, and capping the frame rate + enabling vsync results in an absolutely flawless presentation, especially with VRR enabled in MacOS.

I've actually benchmarked this Mac Studio against my Ryzen 9 5900HS and RTX 3060 PC in various more modern titles like Total War: Warhammer III and House Flipper, and it performs better than my PC in almost every scenario as long as the game runs native on MacOS.
User avatar
Nash
 
 
Posts: 17346
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Slight Mouse Look Stutter on M1 Mac

Post by Nash »

Just to rule things out, Andrew67100 - are you running with any mods?
Andrew67100
Posts: 14
Joined: Thu Jun 23, 2022 1:14 am
Graphics Processor: Apple M1

Re: Slight Mouse Look Stutter on M1 Mac

Post by Andrew67100 »

Nash wrote: Thu Sep 08, 2022 2:34 am Just to rule things out, Andrew67100 - are you running with any mods?
Usually I do, but to isolate the problem I tried just running the vanilla DOOM 2 WAD and the problem still persisted. It's soooo so slight, and I almost thought I was going crazy when I noticed it, but having my Mac and PC connected to the same monitor and peripherals allowed me to quickly switch between machines and notice the slight rendering differences. I then thought maybe it's just a Vulkan or MoltenVK issue, and tried using every other hardware renderer and software rendering. The issue was still there on every renderer. I tried lots of other WADs, and the issue was there.

To be clear, after paying more close attention and limiting the frame rate to my monitor's refresh rate, enabling VRR and Vsync so that frame timing wasn't an issue, this definitely isn't stutter like I originally suspected and a very slight rendering jitter where it almost looks like the world geometry very quickly rubberbands (like within a couple of milliseconds) a few times per second. This jitter does not affect my gun sprite or crosshair as those seem to continue to move fluidly with no stutter or jitter. But, weirdly, this bug seems to only occur when using mouse look. If I don't touch the mouse but run around a map, I see no jitter in the geometry. I've messed with the DPI and polling rate of my Logitech mouse to see if it has any affect, and it doesn't. I make sure to have the same mouse settings on Logitech G Hub on both my PC and Mac. I've even tried messing with MacOS's native mouse sensitivity to see if it was conflicting with Logitech's settings, but even after isolating both the jitter remains.

I want to reiterate that this issue is so slight that it's nearly impossible to notice at 60 Hz (mainly because I think the jitter happens quicker than the roughly 16 milliseconds it takes to deliver a single 60 Hz frame) and is only slightly distracting in an otherwise flawless running presentation on my Mac Studio. This thing is an absolute beast at running GZDoom and absolutely crushes my PC at running it, and squishing this jitter bug would make it perfect.
dpJudas
 
 
Posts: 2923
Joined: Sat May 28, 2016 1:01 pm

Re: Slight Mouse Look Stutter on M1 Mac

Post by dpJudas »

Seems they introduced GCMouseInput in macOS 11 (Big Sur) as part of their game controller API. If it really is the mouse input causing some kind of reposition stutter maybe that could fix it. In any case, the documentation for GCMouseMoved states that it returns the raw mouse movement without affecting mouse sensitivity settings, which I read as this is actually true proper linear raw mouse input.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48543
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Slight Mouse Look Stutter on M1 Mac

Post by Graf Zahl »

Oh, it's maybe 20 years too late, but some progress at least. However, GZDoom still supports 10.12, so the important question is, do we really need support for something that old?
If you discount the hopelessly upgrade resistant people 11.0 should be good for all systems from the last 11 years or so.

What bothers me is that on Steam there's still significant market share of 10.13 and 10.14, which according to the paranoid, were the "last good" versions of macOS.
User avatar
Rachael
Admin
Posts: 13211
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Slight Mouse Look Stutter on M1 Mac

Post by Rachael »

The problem here might be less about the OS version itself and more about the hardware it's running on.

Each Mac model has a very specific list of OS versions that it will run. (Officially, anyway) And between 10.12 and 11 I think there was a lot of droppage of support for older Macs.

I do wonder though - similar to how raw input was implemented in Windows, is there a way to get this code to compile against the older 10.12 compatible SDK while offering the support for the new function for people on 11.0 and newer?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48543
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Slight Mouse Look Stutter on M1 Mac

Post by Graf Zahl »

I know there was a lot of droppage. The question is, is this hardware still worth the hassle. My old MacBook from 2013 got finally dropped this year with 12.0, so everything dropped with 11.0 must be 10 years old or more. At Steam, 10.13 and 10.14 are roughly 8% of the entire market share, plus 18% "other" (Yeah, effectively far more fragmented than Windows. Oh the irony,...)
dpJudas
 
 
Posts: 2923
Joined: Sat May 28, 2016 1:01 pm

Re: Slight Mouse Look Stutter on M1 Mac

Post by dpJudas »

Graf Zahl wrote: Fri Sep 09, 2022 10:12 amHowever, GZDoom still supports 10.12, so the important question is, do we really need support for something that old?
I was hoping _mental_ could pull some rabbit out of the hat. I have no idea how much work it takes to support both (keep the old code as fall back). :)
_mental_
 
 
Posts: 3791
Joined: Sun Aug 07, 2011 4:32 am

Re: Slight Mouse Look Stutter on M1 Mac

Post by _mental_ »

It's possible to use new frameworks on new macOS and to keep compatibility with older versions of OS. Vulkan was supported when minimum version was 10.9, it just required 10.11 to be available. This complicated implementation a bit, GameController will probably require some work to handle it.
Regarding the minimum version, I always tried to support the oldest one if this can be done without too much compilations, e.g. without using custom C++ standard library. It is expected that 11.0 will become the oldest supported version after release of macOS 13 later this year.
Andrew67100
Posts: 14
Joined: Thu Jun 23, 2022 1:14 am
Graphics Processor: Apple M1

Re: Slight Mouse Look Stutter on M1 Mac

Post by Andrew67100 »

Alright, I was able to capture the bug on video recording my monitor in slow motion so everyone can see what my eyes are seeing. I also recorded my Windows PC to offer a reference. The game is running at a perfectly smooth 100 FPS on both machines (my monitor's refresh rate) with vsync turned on. The first clip is my PC running DOOM 2, and the second clip is my Mac Studio running DOOM 2. No mods or additional wads are running. You'll notice about 5 stutters in the MacOS clip where it almost freezes for one additional frame taking 20 ms to post the next frame instead of 10. Here is the video: https://imgur.com/a/H3YRack

Edit: I just tried one of the last Intel-only versions of GZDoom and this stutter/jitter is non-existent when running the game through Rosetta II ironically. Going back and playing on 4.7.1 seemed to introduce the bug.

Return to “Technical Issues”