Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically disabling Game Mode on macOS 14+ #1297

Closed
crystall1nedev opened this issue May 31, 2024 · 8 comments
Closed

Automatically disabling Game Mode on macOS 14+ #1297

crystall1nedev opened this issue May 31, 2024 · 8 comments

Comments

@crystall1nedev
Copy link

crystall1nedev commented May 31, 2024

Is your feature request related to a problem? Please describe.
This issue comes from a problem that Apple created with macOS Sonoma 14.0 and later: Game Mode. The feature is designed and marketed as such:

Game Mode automatically gives games top priority on the CPU and GPU of your Mac, lowering usage for background tasks. And it dramatically reduces latency with wireless accessories, like AirPods and your favorite controllers, for responsiveness you can feel.

However, after examination across multiple Apple silicon Macs and multiple apps, Game Mode causes issues with apps that stream games to your Mac (GeForce NOW and Moonlight are the two that have major issues.)

Issues that can be observed while in macOS' native fullscreen (using Borderless Windowed, without notch):

  • Mouse and trackpad jitter, latency, and inability to function properly.
    • Even without the mouse captured, the mouse will struggle to properly move and "jump" around the screen. This is a serious issue that I discovered with my wife, and makes gaming with a mouse completely unusable. We have reproduced it on macOS 14.3 and later.
  • Audio and video stutter, and inability to sustain stable frame times.
    • This causes Moonlight to blame the network even though the network is fine!

Describe the solution you'd like
In order to avoid this issue, the Info.plist of the macOS application needs to be modified. gamepolicyd on macOS 14 and later (part of GamePolicy.framework) checks for an LSApplicationCategoryType of *.games. That's it - the entire check is "does it end in games". If you change this to another category, it prevents the issue.

The reason I recommend this approach is because of how disabling Game Mode works on Mac: you can only do it if the app is running, and if you can point your mouse to the menu bar. It's automatically enabled, and there is no system-wide way to disable it without disabling SIP (unloading the service file doesn't work with it on, which is... stupid.)

Describe alternatives you've considered
I understand that changing the app category to something else might confuse the end user, as this is also how Launchpad determines where to put applications, and it might be a bit weird for the developers to implement. However, this might prevent any issues like the above from being filed if they are directly caused by Game Mode.

Additional context
A few things I gathered from Reddit and other issues on this repo:

https://www.reddit.com/r/GeForceNOW/comments/16tehae/mac_os_sonoma_game_mode/
#1170

Also:

  • Game Mode will only be enabled when you fullscreen the application using macOS' native APIs for doing so.
    • As of the latest nightlies, this is Borderless Windowed without the notch enabled.
  • Game Mode cannot be disabled system-wide, from System Settings, or from windowed mode.
    • The Game Mode icon may or may not appear in windowed mode as Paused - from here you can turn it off.
  • Once Game Mode is turned off from the menu bar, it is turned off until you re-enable it.
    • I have discovered a bug in macOS 14.5 that causes Game Mode to re-enable itself and the problem occurs again.

Tested on:
MacBook Pro (16-inch, 2021) with M1 Max, macOS 14.4, 14.4.1, 14.5
MacBook Pro (16-inch, 2021) with M1 Pro, macOS 14.3, 14.4, 14.5
Mac mini (M1, 2020), macOS 14.0, 14.2, 14.5

@ThatStella7922
Copy link

This issue also affects the rhythm game osu! on macOS, worsening input polling and response times and destabilizing frametimes when using the Metal renderer.

Also, it affects NVIDIA GeForce NOW's macOS client (as evidenced by frustrated users on Reddit)

These data points support the fact that, like my creature said: it's not an issue in Moonlight since changing the app category fixes the problem completely. Smooth frametimes, properly working input, input has less latency (felt improvements in the range of 30ms when disabling Game Mode in osu!'s latency tester, I have around a decade of experience in rhythm games which I feel supports my number).

From my observations, it seems to be less of a problem in situations where the app is heavily taxing the hardware (like Ryujinx, Stray, and similar), but here with Moonlight where the load is mainly on dedicated hardware media decode cores and not the CPU or GPU, it just falls flat on its face. Genuinely, turn off Game Mode while streaming with Moonlight and feel how much better it is.

@cgutman cgutman closed this as completed in 807fc6b Jun 1, 2024
@cgutman
Copy link
Member

cgutman commented Jun 1, 2024

Okay, I've disabled Game Mode. Hopefully we don't get complaints from users where Game Mode is actually benefiting them somehow.

@ThatStella7922
Copy link

the absolute wonders of this "world's most advanced desktop operating system"

good work on moonlight though, have been using it since 2021 and it's been smooth sailing the whole time

@JacobM2
Copy link

JacobM2 commented Jun 3, 2024

I haven't noticed any of these issues on my M3 pro. Maybe im just not very observant. I'll manually disable game mode for the next week or so to see if I can distinguish anything.

@ody
Copy link

ody commented Jun 6, 2024

I haven't noticed any of these issues on my M3 pro. Maybe im just not very observant. I'll manually disable game mode for the next week or so to see if I can distinguish anything.

Ditto. I’ve not experienced a single one of these reported issues streaming from Sunshine (Windows 11) to Moonlight on my Mac Studio M2 Max. Only knew anyone had issues with it after seeing the note about it being disabled in 6.0.0 release notes. Issue hasn’t popped up on Discord either.

Maybe an M1 issue since we who commented about not seeing the issue are on newer chips?

@BitGrub
Copy link

BitGrub commented Jun 6, 2024

M1 Max user here, had no issues with mouse input on version v5.x and Game Mode enabled. Also streamed from Sunshine on Windows 11.

Doubt disabling it harms the experience though

@BitGrub
Copy link

BitGrub commented Jun 6, 2024

Ok that was quick. Without game mode, audio crackles when focus is lost

@bytat
Copy link

bytat commented Jun 7, 2024

I've had no issues with game mode on my MacBook Air M1. Maybe the possibility to choose one self would be nice? Considering that it's supposed to double the bluetooth sampling rate, reducing input latency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants