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

Sunshine alters the refresh rate of displays it is not using #3591

Open
2 tasks done
aaciii opened this issue Jan 26, 2025 · 22 comments
Open
2 tasks done

Sunshine alters the refresh rate of displays it is not using #3591

aaciii opened this issue Jan 26, 2025 · 22 comments

Comments

@aaciii
Copy link

aaciii commented Jan 26, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

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

None

Describe the Bug

I have a Vidtual Display set up and Sunshine is configured to use only that display (by its GUID). I have also configured Sunshine to NOT change the refresh rate of any display.

However, when my client connects (and Sunshine automatically makes the Virtual Display the "primary" as it should), the physical display on my PC changes from 144Hz to 60Hz. This should not happen because (a) this is not the display that Sunshine is working with and (b) I told Sunshine not to change any refresh rates.

After existing the session I have to manually re-set the physical display to 144Hz.

Expected Behavior

Expected behavior is for Sunshine to only apply any display settings (from the client, etc.) to the display it is configured to use. Also expect Sunshine to not change settings it is configured to not change.

Additional Context

No response

Host Operating System

Windows

Operating System Version

11 24H2

Architecture

amd64/x86_64

Sunshine commit or version

2025.122.141614

Package

Windows - installer (recommended)

GPU Type

AMD

GPU Model

NVidia RTX 3060Ti

GPU Driver/Mesa Version

566.36

Capture Method

None

Config

dd_configuration_option = ensure_primary
output_name = {5eb52002-659f-5729-bdd8-9cdc4efd1bf5}
sunshine_name = ALLAN-DESKTOP-SUNSHINE
port = 57989
notify_pre_releases = enabled
nvenc_realtime_hags = disabled
av1_mode = 1
dd_hdr_option = disabled
dd_refresh_rate_option = disabled

Apps

Relevant log output

[2025-01-26 16:59:10.745]: Info: Sunshine version: v2025.122.141614
[2025-01-26 16:59:10.745]: Info: Package Publisher: LizardByte
[2025-01-26 16:59:10.745]: Info: Publisher Website: https://app.lizardbyte.dev
[2025-01-26 16:59:10.745]: Info: Get support: https://app.lizardbyte.dev/support
[2025-01-26 16:59:10.745]: Info: Provided workaround settings for SettingsManager:
{
  "hdr_blank_delay": null
}
[2025-01-26 16:59:10.750]: Info: Currently available display devices:
[
  {
    "device_id": "{300c9868-b95c-586e-9cd2-8ddf73702953}",
    "display_name": "\\\\.\\DISPLAY1",
    "friendly_name": "DELL G3223Q",
    "info": {
      "hdr_state": "Enabled",
      "origin_point": {
        "x": 0,
        "y": 0
      },
      "primary": true,
      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 2,
          "numerator": 120
        }
      },
      "resolution": {
        "height": 2160,
        "width": 3840
      },
      "resolution_scale": {
        "type": "rational",
        "value": {
          "denominator": 100,
          "numerator": 150
        }
      }
    }
  },
  {
    "device_id": "{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}",
    "display_name": "\\\\.\\DISPLAY25",
    "friendly_name": "VDD by MTT",
    "info": {
      "hdr_state": "Disabled",
      "origin_point": {
        "x": 3840,
        "y": 0
      },
      "primary": false,
      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 1,
          "numerator": 60
        }
      },
      "resolution": {
        "height": 1080,
        "width": 1920
      },
      "resolution_scale": {
        "type": "rational",
        "value": {
          "denominator": 100,
          "numerator": 100
        }
      }
    }
  }
]
[2025-01-26 16:59:10.900]: Info: nvprefs: No need to modify application profile settings
[2025-01-26 16:59:10.900]: Info: nvprefs: Changed OGL_CPL_PREFER_DXPRESENT to OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED for base profile
[2025-01-26 16:59:10.935]: Info: Compiling shaders...
[2025-01-26 16:59:10.948]: Info: System tray created
[2025-01-26 16:59:11.005]: Info: Compiled shaders
[2025-01-26 16:59:11.014]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-01-26 16:59:11.015]: Info: Trying encoder [nvenc]
[2025-01-26 16:59:11.279]: Info: 
Device Description : NVIDIA GeForce RTX 3060 Ti
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002489
Device Video Mem   : 8024 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16246 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 3840x0
Virtual Desktop    : 5760x2160
[2025-01-26 16:59:11.280]: Info: Active GPU has HAGS disabled
[2025-01-26 16:59:11.280]: Info: Using realtime GPU priority
[2025-01-26 16:59:11.280]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0657 nits
Max Luminance      : 1670.85 nits
Max Full Luminance : 1670.85 nits
[2025-01-26 16:59:11.282]: Info: Desktop resolution [1920x1080]
[2025-01-26 16:59:11.282]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-01-26 16:59:11.282]: Info: Display refresh rate [60Hz]
[2025-01-26 16:59:11.282]: Info: Requested frame rate [60fps]
[2025-01-26 16:59:11.283]: Info: Creating encoder [h264_nvenc]
[2025-01-26 16:59:11.283]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:11.283]: Info: Color depth: 8-bit
[2025-01-26 16:59:11.283]: Info: Color range: JPEG
[2025-01-26 16:59:11.334]: Info: NvEnc: created encoder H.264 P1 two-pass rfi
[2025-01-26 16:59:11.361]: Info: Creating encoder [hevc_nvenc]
[2025-01-26 16:59:11.361]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:11.361]: Info: Color depth: 8-bit
[2025-01-26 16:59:11.361]: Info: Color range: JPEG
[2025-01-26 16:59:11.412]: Info: NvEnc: created encoder HEVC P1 two-pass rfi
[2025-01-26 16:59:11.440]: Info: Creating encoder [h264_nvenc]
[2025-01-26 16:59:11.440]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:11.440]: Info: Color depth: 8-bit
[2025-01-26 16:59:11.441]: Info: Color range: JPEG
[2025-01-26 16:59:11.491]: Info: NvEnc: created encoder H.264 P1 yuv444 two-pass rfi
[2025-01-26 16:59:11.705]: Info: 
Device Description : NVIDIA GeForce RTX 3060 Ti
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002489
Device Video Mem   : 8024 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16246 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 3840x0
Virtual Desktop    : 5760x2160
[2025-01-26 16:59:11.705]: Info: Active GPU has HAGS disabled
[2025-01-26 16:59:11.705]: Info: Using realtime GPU priority
[2025-01-26 16:59:11.705]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0657 nits
Max Luminance      : 1670.85 nits
Max Full Luminance : 1670.85 nits
[2025-01-26 16:59:11.707]: Info: Desktop resolution [1920x1080]
[2025-01-26 16:59:11.708]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-01-26 16:59:11.708]: Info: Display refresh rate [60Hz]
[2025-01-26 16:59:11.708]: Info: Requested frame rate [60fps]
[2025-01-26 16:59:11.708]: Info: Creating encoder [hevc_nvenc]
[2025-01-26 16:59:11.708]: Info: Color coding: SDR (Rec. 709)
[2025-01-26 16:59:11.708]: Info: Color depth: 10-bit
[2025-01-26 16:59:11.708]: Info: Color range: JPEG
[2025-01-26 16:59:11.878]: Info: NvEnc: created encoder HEVC P1 yuv444 10-bit two-pass rfi
[2025-01-26 16:59:11.925]: Info: 
[2025-01-26 16:59:11.925]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-01-26 16:59:11.926]: Info: 
[2025-01-26 16:59:11.926]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2025-01-26 16:59:11.926]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2025-01-26 16:59:11.928]: Info: Configuration UI available at [https://localhost:57990]
[2025-01-26 16:59:12.702]: Info: Registered Sunshine mDNS service
[2025-01-26 16:59:21.284]: Info: Trying to apply display device settings. API is available: true
[2025-01-26 16:59:21.284]: Info: Using the following configuration:
{
  "device_id": "{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}",
  "device_prep": "EnsurePrimary",
  "hdr_state": null,
  "refresh_rate": null,
  "resolution": {
    "height": 1080,
    "width": 1920
  }
}
[2025-01-26 16:59:21.286]: Info: Active topology before any changes:
[
  [
    "{300c9868-b95c-586e-9cd2-8ddf73702953}"
  ],
  [
    "{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}"
  ]
]
[2025-01-26 16:59:21.298]: Info: Currently available devices:
[
  {
    "device_id": "{300c9868-b95c-586e-9cd2-8ddf73702953}",
    "display_name": "\\\\.\\DISPLAY1",
    "friendly_name": "DELL G3223Q",
    "info": {
      "hdr_state": "Enabled",
      "origin_point": {
        "x": 0,
        "y": 0
      },
      "primary": true,
      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 2,
          "numerator": 120
        }
      },
      "resolution": {
        "height": 2160,
        "width": 3840
      },
      "resolution_scale": {
        "type": "rational",
        "value": {
          "denominator": 100,
          "numerator": 150
        }
      }
    }
  },
  {
    "device_id": "{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}",
    "display_name": "\\\\.\\DISPLAY25",
    "friendly_name": "VDD by MTT",
    "info": {
      "hdr_state": "Disabled",
      "origin_point": {
        "x": 3840,
        "y": 0
      },
      "primary": false,
      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 1,
          "numerator": 60
        }
      },
      "resolution": {
        "height": 1080,
        "width": 1920
      },
      "resolution_scale": {
        "type": "rational",
        "value": {
          "denominator": 100,
          "numerator": 150
        }
      }
    }
  }
]
[2025-01-26 16:59:21.298]: Info: Will compute new display device topology from the following input:
  - initial topology: [["{300c9868-b95c-586e-9cd2-8ddf73702953}"],["{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}"]]
  - initial primary devices: ["{300c9868-b95c-586e-9cd2-8ddf73702953}"]
  - configuring unspecified device: false
  - device to configure: "{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}"
  - additional devices to configure: []
[2025-01-26 16:59:21.299]: Info: Newly computed display device topology data:
  - topology: [["{300c9868-b95c-586e-9cd2-8ddf73702953}"],["{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}"]]
  - change is needed: false
  - additional devices to configure: []
[2025-01-26 16:59:21.303]: Info: Changing primary display to:
"{5eb52002-659f-5729-bdd8-9cdc4efd1bf5}"
[2025-01-26 16:59:21.744]: Info: Encoder reenumeration is required
[2025-01-26 16:59:21.744]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-01-26 16:59:21.747]: Info: Trying encoder [nvenc]
[2025-01-26 16:59:22.193]: Info: 
Device Description : NVIDIA GeForce RTX 3060 Ti
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002489
Device Video Mem   : 8024 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16246 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 3840x0
Virtual Desktop    : 5760x2160
[2025-01-26 16:59:22.193]: Info: Active GPU has HAGS disabled
[2025-01-26 16:59:22.193]: Info: Using realtime GPU priority
[2025-01-26 16:59:22.193]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0657 nits
Max Luminance      : 1670.85 nits
Max Full Luminance : 1670.85 nits
[2025-01-26 16:59:22.545]: Info: Desktop resolution [1920x1080]
[2025-01-26 16:59:22.545]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-01-26 16:59:22.545]: Info: Display refresh rate [60Hz]
[2025-01-26 16:59:22.545]: Info: Requested frame rate [60fps]
[2025-01-26 16:59:22.546]: Info: Creating encoder [h264_nvenc]
[2025-01-26 16:59:22.546]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:22.547]: Info: Color depth: 8-bit
[2025-01-26 16:59:22.547]: Info: Color range: JPEG
[2025-01-26 16:59:22.653]: Info: NvEnc: created encoder H.264 P1 two-pass rfi
[2025-01-26 16:59:22.717]: Info: Creating encoder [hevc_nvenc]
[2025-01-26 16:59:22.717]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:22.717]: Info: Color depth: 8-bit
[2025-01-26 16:59:22.717]: Info: Color range: JPEG
[2025-01-26 16:59:22.796]: Info: NvEnc: created encoder HEVC P1 two-pass rfi
[2025-01-26 16:59:22.844]: Info: Creating encoder [h264_nvenc]
[2025-01-26 16:59:22.844]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:22.844]: Info: Color depth: 8-bit
[2025-01-26 16:59:22.844]: Info: Color range: JPEG
[2025-01-26 16:59:22.943]: Info: NvEnc: created encoder H.264 P1 yuv444 two-pass rfi
[2025-01-26 16:59:23.200]: Info: 
Device Description : NVIDIA GeForce RTX 3060 Ti
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002489
Device Video Mem   : 8024 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16246 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 3840x0
Virtual Desktop    : 5760x2160
[2025-01-26 16:59:23.200]: Info: Active GPU has HAGS disabled
[2025-01-26 16:59:23.200]: Info: Using realtime GPU priority
[2025-01-26 16:59:23.200]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0657 nits
Max Luminance      : 1670.85 nits
Max Full Luminance : 1670.85 nits
[2025-01-26 16:59:23.204]: Info: Desktop resolution [1920x1080]
[2025-01-26 16:59:23.204]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-01-26 16:59:23.204]: Info: Display refresh rate [60Hz]
[2025-01-26 16:59:23.204]: Info: Requested frame rate [60fps]
[2025-01-26 16:59:23.204]: Info: Creating encoder [hevc_nvenc]
[2025-01-26 16:59:23.204]: Info: Color coding: SDR (Rec. 709)
[2025-01-26 16:59:23.204]: Info: Color depth: 10-bit
[2025-01-26 16:59:23.205]: Info: Color range: JPEG
[2025-01-26 16:59:23.424]: Info: NvEnc: created encoder HEVC P1 yuv444 10-bit two-pass rfi
[2025-01-26 16:59:23.508]: Info: 
[2025-01-26 16:59:23.508]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-01-26 16:59:23.508]: Info: 
[2025-01-26 16:59:23.508]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2025-01-26 16:59:23.508]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2025-01-26 16:59:23.508]: Info: Executing: [steam://rungameid/201810] in [""]
[2025-01-26 16:59:23.549]: Info: Resolved user-provided command 'steam://rungameid/201810' to '"C:\Program Files (x86)\Steam\steam.exe" -- "steam://rungameid/201810"'
[2025-01-26 16:59:23.553]: Info: steam://rungameid/201810 running with PID 50068
[2025-01-26 16:59:23.703]: Info: New streaming session started [active sessions: 1]
[2025-01-26 16:59:23.864]: Info: nvprefs: No need to modify application profile settings
[2025-01-26 16:59:23.864]: Info: nvprefs: No need to modify global profile settings
[2025-01-26 16:59:23.962]: Info: CLIENT CONNECTED
[2025-01-26 16:59:24.258]: Info: Changed virtual audio sink format to [S24 48000 2.0]
[2025-01-26 16:59:24.326]: Info: Audio capture format is [F32 48000 2.0]
[2025-01-26 16:59:24.328]: Info: Opus initialized: 48 kHz, 2 channels, 512 kbps (total), LOWDELAY
[2025-01-26 16:59:24.436]: Info: 
Device Description : NVIDIA GeForce RTX 3060 Ti
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002489
Device Video Mem   : 8024 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16246 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 3840x0
Virtual Desktop    : 5760x2160
[2025-01-26 16:59:24.436]: Info: Active GPU has HAGS disabled
[2025-01-26 16:59:24.436]: Info: Using realtime GPU priority
[2025-01-26 16:59:24.436]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0657 nits
Max Luminance      : 1670.85 nits
Max Full Luminance : 1670.85 nits
[2025-01-26 16:59:24.440]: Info: Desktop resolution [1920x1080]
[2025-01-26 16:59:24.440]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-01-26 16:59:24.440]: Info: Display refresh rate [60Hz]
[2025-01-26 16:59:24.440]: Info: Requested frame rate [60fps]
[2025-01-26 16:59:24.440]: Info: Creating encoder [hevc_nvenc]
[2025-01-26 16:59:24.440]: Info: Color coding: SDR (Rec. 601)
[2025-01-26 16:59:24.440]: Info: Color depth: 8-bit
[2025-01-26 16:59:24.440]: Info: Color range: MPEG
[2025-01-26 16:59:24.458]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-01-26 16:59:24.508]: Info: NvEnc: created encoder HEVC P1 two-pass rfi
[2025-01-26 16:59:29.540]: Info: Resetting sink to [virtual-Stereo{0.0.0.00000000}.{220189d8-e1b3-46f7-b231-7f7f7f6680dc}] after default changed
[2025-01-26 16:59:29.570]: Info: Changed virtual audio sink format to [S24 48000 2.0]
[2025-01-26 16:59:29.605]: Info: Reinitializing audio capture
[2025-01-26 16:59:29.633]: Info: Audio capture format is [F32 48000 2.0]
[2025-01-26 16:59:46.429]: Info: Gamepad 0 will be Xbox 360 controller (default)
[2025-01-26 16:59:46.639]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.640]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.641]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.656]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.657]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.659]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.665]: Info: CLIENT DISCONNECTED
[2025-01-26 16:59:46.680]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.681]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.681]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.682]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:46.683]: Error: Couldn't receive data from udp socket: No connection could be made because the target machine actively refused it
[2025-01-26 16:59:51.025]: Info: Successfully requested the app to exit. Waiting up to 5 seconds for it to close.
[2025-01-26 16:59:56.028]: Warning: App did not fully exit within the timeout. Terminating the app's remaining processes.
[2025-01-26 16:59:59.107]: Info: Trying to revert applied display device settings. API is available: true
[2025-01-26 16:59:59.114]: Info: Trying to change back the original primary device to: "{300c9868-b95c-586e-9cd2-8ddf73702953}"
@FrogTheFrog
Copy link
Collaborator

Could you please post verbose logs and do the following steps:

  • Restore everything to the initial state manually.
  • Restart Sunshine.
  • Start Sunshine and start the stream.
  • Stop the stream and paste the logs.

I'll check the logs tomorrow.

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

Stopped and re-started Sunshine service.
Verified that physical monitor was set to 144Hz in Windows settings.
Started a stream from iPhone Moonlight client (just a desktop session to the Virtual Display).
Watched as the physical display's refresh rate changed to 60Hz.

Verbose Log attached.

sunshine.log

@FrogTheFrog
Copy link
Collaborator

So, it seems that Windows API reports the refresh rate as:

      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 2,
          "numerator": 120
        }
      },

Which is simply 60Hz...

What if you disable the resolution change option?

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

It looks like maybe it has to do with Windows Dynamic refresh (see screenshot). I had the display set to 144Hz... but I also had Dynamic Refresh switched ON.

If I turn OFF the very bottom setting (Dynamic Refresh Rate), then Sunshine does NOT change the refresh rate of the monitor which is what we want.

The Dynamic Refresh rate setting slows the monitor down to 60Hz on the fly (doesn't change the display settings, but slows the screen down to save power).

Sunshine may be reading the screen's refresh at 60Hz as a result (even though the setting is 144Hz).

This makes me wonder though - why is Sunshine messing with this physical display AT ALL? It shouldn't be doing anything to this display.

Image

@FrogTheFrog
Copy link
Collaborator

FrogTheFrog commented Jan 27, 2025

It is simply the way Windows API works. It stores the information about primary display alongside the resolution and refresh rate and there simply is no way to change primary display without touching these other settings.

It is possible to tell Windows that we are virtual refresh rate-aware, but I don't know if it will work out-of-the-box.

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

So it seems like Sunshine needs to be aware that the refresh rate returned by the Windows API may not actually be the actual setting in Windows Settings for that display. Because refresh rates in the running state can vary.

The current process seems to read the refresh rate via API, and then when Sunshine is changing the Primary monitor, it uses that value from the API and changes the setting on the display - even in cases when it shouldn't like we are seeing here.

@FrogTheFrog
Copy link
Collaborator

Yes. Unless you tell Windows explicitly that you are aware of the virtual refresh rate, it will convert the information into the format that would be usable to you.

Sadly my display does not support this virtual refresh rate, but if you would build Sunshine yourself, I could tell you how to enable it and test it, if you want.

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

Happy to give it a try - are there build instructions anywhere?

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

Also - if it's in the code already, could this be a flag (checkbox) in Sunshine - something like "enable Dynamic Refresh support (yes/no)" ?

@ReenigneArcher
Copy link
Member

Happy to give it a try - are there build instructions anywhere?

https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2building.html

Be sure to checkout the branch/commit of interest though.

@FrogTheFrog
Copy link
Collaborator

Also - if it's in the code already, could this be a flag (checkbox) in Sunshine - something like "enable Dynamic Refresh support (yes/no)" ?

It depends on what will this new flag do. The last one that was added for Win10 required almost a complete rewrite of the existing algorithm...

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

Happy to give it a try - are there build instructions anywhere?

https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2building.html

Be sure to checkout the branch/commit of interest though.

terrific... seems simple enough. However... why am I doing this again? What will be different about the build (or are you going to have me change something)?

@FrogTheFrog
Copy link
Collaborator

There's are really simple change that might enable virtual refresh rate support, however it could also be a waste of time if it's not as simple as a single switch.

It's up to you.

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

There's are really simple change that might enable virtual refresh rate support, however it could also be a waste of time if it's not as simple as a single switch.

It's up to you.

I'm happy to do the build - but wouldn't it be faster for you to make the change, build and drop the executable in a share someplace (since you are already set up)?

@FrogTheFrog
Copy link
Collaborator

Sure, I can prepare the build maybe tomorrow or sometime this week. I'll ping you when it's ready.

@aaciii
Copy link
Author

aaciii commented Jan 27, 2025

super, happy to be a guinea pig :)

@FrogTheFrog
Copy link
Collaborator

Please try a build from here FrogTheFrog#7 and post the verbose logs whatever the outcome is.

@aaciii
Copy link
Author

aaciii commented Jan 28, 2025

Please try a build from here FrogTheFrog#7 and post the verbose logs whatever the outcome is.

Sorry I thought you were going to build it and post the .exe for me to download.

@FrogTheFrog
Copy link
Collaborator

Please try a build from here FrogTheFrog#7 and post the verbose logs whatever the outcome is.

Sorry I thought you were going to build it and post the .exe for me to download.

Open the build artifacts and:
Image

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Jan 28, 2025

https://github.com/FrogTheFrog/Sunshine/actions/runs/12998913973?pr=7#artifacts

Note: the link will change for different job runs

@aaciii
Copy link
Author

aaciii commented Jan 28, 2025

Better, this time it changed the refresh from 144Hz to 120Hz on the primary display (rather than changing from 144Hz to 60Hz). But it is still altering the configuration settings of the primary display. It does this at the moment the client connects and it switches the primary screen from the physical to the virtual display.

I believe the reason that 120Hz was the value it used is because with "Dynamic Refresh Rate" turned on in Windows display settings, the display alternates between 120Hz and 60Hz when in desktop mode (as opposed to fullscreen mode for games where it goes to the full actually-configured 144Hz).

logs attached.

Image

sunshine.log

@FrogTheFrog
Copy link
Collaborator

FrogTheFrog commented Jan 28, 2025

Well, unfortunately this is as much as I can help you right now.

Everywhere in the logs never anything resembling 144Hz is mentioned once. It could be another hidden API or something (based on the fact that scaling API that W10+ uses is not even available yet) or it is bug...

The later can be checked by you - if you manually switch the primary display, will it still say 144 Hz everywhere on the window from your screenhot? On the button, in the "Display information" panel.

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

3 participants