diff --git a/docs/configuration.md b/docs/configuration.md index 9a08d0c2bd3..2b503e92658 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1154,14 +1154,15 @@ editing the `conf` file in a text editor. Use the examples as reference. -### dd_wa_hdr_toggle +### dd_wa_hdr_toggle_delay @@ -1169,13 +1170,13 @@ editing the `conf` file in a text editor. Use the examples as reference.
Description - When using virtual display device as for streaming, it might display incorrect (high-contrast) color. - With this option enabled, Sunshine will try to mitigate this issue. + When using virtual display device (VDD) for streaming, it might incorrectly display HDR color. Sunshine can try to mitigate this issue, by turning HDR off and then on again.
+ If the value is set to 0, the workaround is disabled (default). If the value is between 0 and 3000 milliseconds, Sunshine will turn off HDR, wait for the specified amount of time and then turn HDR on again. The recommended delay time is around 500 milliseconds in most cases.
+ DO NOT use this workaround unless you actually have issues with HDR as it directly impacts stream start time! @note{This option works independently of [dd_hdr_option](#dd_hdr_option)} @note{Applies to Windows only.}
Default @code{} - disabled + 0 @endcode
Example @code{} - dd_wa_hdr_toggle = enabled + dd_wa_hdr_toggle_delay = 500 @endcode
diff --git a/src/config.cpp b/src/config.cpp index bdf719e0c93..67e822f9310 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1133,7 +1133,11 @@ namespace config { } } generic_f(vars, "dd_mode_remapping", video.dd.mode_remapping, dd::mode_remapping_from_view); - bool_f(vars, "dd_wa_hdr_toggle", video.dd.wa.hdr_toggle); + { + int value = 0; + int_between_f(vars, "dd_wa_hdr_toggle_delay", value, {0, 3000}); + video.dd.wa.hdr_toggle_delay = std::chrono::milliseconds {value}; + } int_between_f(vars, "min_fps_factor", video.min_fps_factor, {1, 3}); diff --git a/src/config.h b/src/config.h index 34e673d150b..3a01c0bec05 100644 --- a/src/config.h +++ b/src/config.h @@ -84,7 +84,7 @@ namespace config { struct dd_t { struct workarounds_t { - bool hdr_toggle; ///< Specify whether to apply HDR high-contrast color workaround. + std::chrono::milliseconds hdr_toggle_delay; ///< Specify whether to apply HDR high-contrast color workaround and what delay to use. }; enum class config_option_e { diff --git a/src/display_device.cpp b/src/display_device.cpp index d028829026d..005ac3041fb 100644 --- a/src/display_device.cpp +++ b/src/display_device.cpp @@ -621,7 +621,7 @@ namespace display_device { std::make_shared(persistence_filepath) ), WinWorkarounds { - .m_hdr_blank_delay = video_config.dd.wa.hdr_toggle ? std::make_optional(500ms) : std::nullopt + .m_hdr_blank_delay = video_config.dd.wa.hdr_toggle_delay != std::chrono::milliseconds::zero() ? std::make_optional(video_config.dd.wa.hdr_toggle_delay) : std::nullopt } ); #else diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index d5ada9469e3..ce35f9c6053 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -176,7 +176,7 @@

{{ $t('config.configuration') }}

"dd_hdr_option": "auto", "dd_config_revert_delay": 3000, "dd_mode_remapping": {"mixed": [], "resolution_only": [], "refresh_rate_only": []}, - "dd_wa_hdr_toggle": "disabled", + "dd_wa_hdr_toggle_delay": 0, "min_fps_factor": 1, }, }, diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue index ee2951733a7..f1837dc6c9a 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue @@ -132,11 +132,18 @@ function addRemappingEntry() { - + + +
+ {{ $t('config.dd_wa_hdr_toggle_delay_desc_1') }} +
+ {{ $t('config.dd_wa_hdr_toggle_delay_desc_2') }} +
+ {{ $t('config.dd_wa_hdr_toggle_delay_desc_3') }} +
diff --git a/src_assets/common/assets/web/public/assets/locale/en.json b/src_assets/common/assets/web/public/assets/locale/en.json index 57b8846eca8..0ede355ac3e 100644 --- a/src_assets/common/assets/web/public/assets/locale/en.json +++ b/src_assets/common/assets/web/public/assets/locale/en.json @@ -187,8 +187,10 @@ "dd_resolution_option_manual": "Use manually entered resolution", "dd_resolution_option_manual_desc": "Enter the resolution to be used", "dd_resolution_option_ogs_desc": "\"Optimize game settings\" option must be enabled on the Moonlight client for this to work.", - "dd_wa_hdr_toggle_desc": "When using virtual display device as for streaming, it might display incorrect HDR color. With this option enabled, Sunshine will try to mitigate this issue.", - "dd_wa_hdr_toggle": "Enable high-contrast workaround for HDR", + "dd_wa_hdr_toggle_delay_desc_1": "When using virtual display device (VDD) for streaming, it might incorrectly display HDR color. Sunshine can try to mitigate this issue, by turning HDR off and then on again.", + "dd_wa_hdr_toggle_delay_desc_2": "If the value is set to 0, the workaround is disabled (default). If the value is between 0 and 3000 milliseconds, Sunshine will turn off HDR, wait for the specified amount of time and then turn HDR on again. The recommended delay time is around 500 milliseconds in most cases.", + "dd_wa_hdr_toggle_delay_desc_3": "DO NOT use this workaround unless you actually have issues with HDR as it directly impacts stream start time!", + "dd_wa_hdr_toggle_delay": "High-contrast workaround for HDR", "ds4_back_as_touchpad_click": "Map Back/Select to Touchpad Click", "ds4_back_as_touchpad_click_desc": "When forcing DS4 emulation, map Back/Select to Touchpad Click", "encoder": "Force a Specific Encoder",