Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

[macOS] Stream artificially limited to 90fps when set to 120fps in Moonlight

Open louis-pre opened this issue 1 year ago • 19 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your issue described in the documentation?

  • [x] I have read the documentation

Is your issue present in the latest beta/pre-release?

  • [x] This issue is present in the nightly release

Describe the Bug

I have a tablet (Samsung Tab S9+) capable of 120hz refresh rate on which I run Moonlight. Connecting it to my Macbook Pro M1 host works but the fps does not reach 120fps. Instead, it stays at a steady 90 fps.

Screenshot_20240623_032343_Moonlight (Debug)

Expected Behavior

The macOS Sunshine host provides 120fps when the client requests it.

Additional Context

Troubleshooting done:

  • I have successfuly used the full 120Hz of the tablet when connected to a Windows Sunshine host
  • I tried on both the native and external display of the macOS host
  • I made sure Moonlight is set to request 120fps
  • I made sure Sunshine exposes 120fps (although I don't think this matters here)
  • I made sure the display I tried to stream from is set to 120Hz

Host Operating System

macOS

Operating System Version

Sonoma 14.5

Architecture

arm

Sunshine commit or version

v2024.621.193854

Package

macOS - Homebrew

GPU Type

n/a

GPU Model

N/A

GPU Driver/Mesa Version

N/A

Capture Method

None

Config

output_name = 3
hevc_mode = 2
fps = [30,60,90,120]
resolutions = [
    1280x720,
    1920x1080,
    2560x1440,
    1920x1200,
    2560x1600,
    1280x800
]
origin_web_ui_allowed = pc

Apps

No response

Relevant log output

[2024:06:23:03:10:37]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:06:23:03:10:37]: Info: Trying encoder [videotoolbox]
[2024:06:23:03:10:37]: Info: Detecting displays
[2024:06:23:03:10:37]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2024:06:23:03:10:37]: Info: Detected display: 28E850 (id: 3) connected: true
[2024:06:23:03:10:37]: Info: Configuring selected display (3) to stream
[2024:06:23:03:10:37]: Info: SDR color coding [Rec. 601]
[2024:06:23:03:10:37]: Info: Color depth: 8-bit
[2024:06:23:03:10:37]: Info: Color range: [JPEG]
[2024:06:23:03:10:37]: Warning: [h264_videotoolbox @ 0x107b2df90] PrioritizeEncodingSpeedOverQuality property is not supported on this device. Ignoring.
[2024:06:23:03:10:37]: Info: [h264_videotoolbox @ 0x107b2df90] This device does not support the AllowOpenGop option. Value ignored.
[2024:06:23:03:10:37]: Info: SDR color coding [Rec. 601]
[2024:06:23:03:10:37]: Info: Color depth: 8-bit
[2024:06:23:03:10:37]: Info: Color range: [JPEG]
[2024:06:23:03:10:37]: Info: SDR color coding [Rec. 601]
[2024:06:23:03:10:37]: Info: Color depth: 8-bit
[2024:06:23:03:10:37]: Info: Color range: [JPEG]
[2024:06:23:03:10:37]: Error: Couldn't open [av1_videotoolbox]
[2024:06:23:03:10:37]: Info: Detecting displays
[2024:06:23:03:10:37]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2024:06:23:03:10:37]: Info: Detected display: 28E850 (id: 3) connected: true
[2024:06:23:03:10:37]: Info: Configuring selected display (3) to stream
[2024:06:23:03:10:37]: Info: SDR color coding [Rec. 709]
[2024:06:23:03:10:37]: Info: Color depth: 10-bit
[2024:06:23:03:10:37]: Info: Color range: [JPEG]
[2024:06:23:03:10:38]: Info: 
[2024:06:23:03:10:38]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:06:23:03:10:38]: Info: 
[2024:06:23:03:10:38]: Info: Found H.264 encoder: h264_videotoolbox [videotoolbox]
[2024:06:23:03:10:38]: Info: Found HEVC encoder: hevc_videotoolbox [videotoolbox]
[2024:06:23:03:10:38]: Info: Executing [Desktop]
[2024:06:23:03:10:38]: Info: CLIENT CONNECTED
[2024:06:23:03:10:38]: Info: Detecting displays
[2024:06:23:03:10:38]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2024:06:23:03:10:38]: Info: Detected display: 28E850 (id: 3) connected: true
[2024:06:23:03:10:38]: Info: Configuring selected display (3) to stream
[2024:06:23:03:10:38]: Info: SDR color coding [Rec. 709]
[2024:06:23:03:10:38]: Info: Color depth: 8-bit
[2024:06:23:03:10:38]: Info: Color range: [MPEG]
[2024:06:23:03:10:38]: Error: opening microphone '' failed. Please set a valid input source in the Sunshine config.
[2024:06:23:03:10:38]: Error: Available inputs:
[2024:06:23:03:10:38]: Error: 	MacBook Pro Microphone
[2024:06:23:03:10:38]: Error: Unable to initialize audio capture. The stream will not have audio.

louis-pre avatar Jun 23 '24 10:06 louis-pre

There is a new config option to adjust the minimum fps factor.

Sunshine streams at a lower FPS when it detects frames are changing less frequently.

ReenigneArcher avatar Jun 23 '24 13:06 ReenigneArcher

There is a new config option to adjust the minimum fps factor.

Sunshine streams at a lower FPS when it detects frames are changing less frequently.

I forgot to mention it in my post, I have tried some troubleshooting of the variable refresh rate using the "technique" I use on Windows hosts, aka moving my mouse really fast. The fps stays at a steady 90fps (it also does not drop below 90 like it does on a Windows host).

I did not know about that setting, you're referring to Minimum FPS Factor correct? If so, I just tried with the values 1,2,3,10,120 with no effect on the stream's fps (as in, it remains at 90fps). I tried with both the native display and my external display using 1080p resolution.

edit: I redid my test using blur busters' UFO test to make sure the results I am getting are not due to my unorthodox testing methology.

louis-pre avatar Jun 23 '24 19:06 louis-pre

@louis-pre @ReenigneArcher I'm on Intel mac, but I'll have a first look at it and see if I can find anything. What happens if you set the FPS and min FPS to 40? Does it work or it fallbacks to 90 or even 60?

Don't wait for me tho, I won't be able to pay enough attention to it this week, so if anyone finds something first, go for it.

Hazer avatar Jun 27 '24 00:06 Hazer

@louis-pre @ReenigneArcher I'm on Intel mac, but I'll have a first look at it and see if I can find anything. What happens if you set the FPS and min FPS to 40? Does it work or it fallbacks to 90 or even 60?

Don't wait for me tho, I won't be able to pay enough attention to it this week, so if anyone finds something first, go for it.

I'll try that this evening. I did try 60fps and it worked if I remember correctly though. I also have an Intel Mac and can do a comparison (although its screen is 60Hz).

louis-pre avatar Jun 27 '24 01:06 louis-pre

@Hazer

40fps is not supported by the Android app so I tested on my Steam Deck instead (which supports up to 90Hz).

Setting the fps target to 40 in Moonlight gives me a stable 40fps out of the M1 Mac host (stable, as in it does not drop like on a Windows host). I also tested 120fps target on the Deck and got 90fps from the M1 Mac host too.

I don't know how to set the minimum fps so I did not try that.

edit: I tested streaming from my Intel Mac and observed the same problem (I used out of the box settings on Sunshine). 40fps -> Sunshine provided 40fps 60fps -> Sunshine provided 60fps 90fps -> Sunshine provided 90 fps (even though I used the native 60Hz screen) 120fps -> Sunshine provided 90fps again

louis-pre avatar Jun 27 '24 07:06 louis-pre

@louis-pre thanks for the detailed report, that will help me a lot.

Hazer avatar Jun 28 '24 12:06 Hazer

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Sep 30 '24 10:09 LizardByte-bot

Yes, I could still reproduce the issue as of a few days ago. I can try and reproduce it on the latest build too if necessary.

louis-pre avatar Sep 30 '24 17:09 louis-pre

I have the same issue, macos 15.0.1, sunshine version v2024.1031.235235

weazyexe avatar Nov 01 '24 10:11 weazyexe

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Jan 31 '25 10:01 LizardByte-bot

Still relevant

louis-pre avatar Feb 03 '25 23:02 louis-pre

I have exactly same issue with the same setup. On macos the fps is 90 at most.

Shallow-Seek avatar Mar 11 '25 21:03 Shallow-Seek

Same here, on MacOS sunshine host, it can only achieve maximum 90 FPS no matter how I config.

penguinsam avatar Mar 13 '25 03:03 penguinsam

Same problem here as well

conblem avatar Apr 28 '25 11:04 conblem

I still have the same issue. Using BetterDisplay and displayplacer to ensure that the virtual display is set to 120hz does not work. Additionally, I'm experiencing very high - values of up to 150% CPU usage - when using Sunshine and forcing the HEVC codec to be used.

My setup is a bit different: I'm using USB tethering to create a direct connection between my tablet and my Mac after partially disabling SIP. This allowed the tablet to be discovered as a local network and I was able to screen extend to the tablet after tinkering with the extended display/ virtual display options with BetterDisplay.

Xryphon avatar Jun 01 '25 06:06 Xryphon

Same issue on my M4 Mac mini with latest sunshine beta as of 7/15/25.

systox avatar Jul 15 '25 18:07 systox

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Oct 14 '25 10:10 LizardByte-bot

Still an issue

louis-pre avatar Oct 14 '25 18:10 louis-pre