From 24ee6f96e16b8d8d73bd9eab6d5a7dbaa0b970bd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 11 Sep 2023 21:25:29 -0500 Subject: [PATCH] Don't filter SOPS option by active resolutions with Sunshine --- app/streaming/session.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 841f4c99..53ab2d04 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1327,20 +1327,28 @@ bool Session::startConnectionAsync() Q_ASSERT(m_Computer->currentGameId == 0 || m_Computer->currentGameId == m_App.id); - // SOPS will set all settings to 720p60 if it doesn't recognize - // the chosen resolution. Avoid that by disabling SOPS when it - // is not streaming a supported resolution. - bool enableGameOptimizations = false; - for (const NvDisplayMode &mode : m_Computer->displayModes) { - if (mode.width == m_StreamConfig.width && - mode.height == m_StreamConfig.height) { - SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, - "Found host supported resolution: %dx%d", - mode.width, mode.height); - enableGameOptimizations = m_Preferences->gameOptimizations; - break; + bool enableGameOptimizations; + if (m_Computer->isNvidiaServerSoftware) { + // GFE will set all settings to 720p60 if it doesn't recognize + // the chosen resolution. Avoid that by disabling SOPS when it + // is not streaming a supported resolution. + enableGameOptimizations = false; + for (const NvDisplayMode &mode : m_Computer->displayModes) { + if (mode.width == m_StreamConfig.width && + mode.height == m_StreamConfig.height) { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Found host supported resolution: %dx%d", + mode.width, mode.height); + enableGameOptimizations = m_Preferences->gameOptimizations; + break; + } } } + else { + // Always send SOPS to Sunshine because we may repurpose the + // option to control whether the display mode is adjusted + enableGameOptimizations = m_Preferences->gameOptimizations; + } QString rtspSessionUrl;