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

[UWP] Prefere 60Hz display mode instead of 120Hz #4798

Closed
wants to merge 1 commit into from

Conversation

MarekLuxoft
Copy link
Collaborator

The reason of this pull request is huge number of dropped frames on XBOX for 120Hz.

During the investigation we observed strange behavior of Present1 method. It’s always takes ~15ms, but we believe that for 120Hz display it should be ~7ms (SyncInterval is set to 1).

After discussion with Microsoft Support it occur that 120Hz is not supported in UWP apps even though the app can select 120Hz display mode. It's recommended that UWPs should not select 120Hz display mode.

Tests:
PR was tested on Xbox Series S:

  • 120Hz: 60fps and 30fps
  • 60Hz: 60fps with x1, x2 playback rate and 30fps with x1, x2 playback rate

Comment on lines +1024 to +1026
preferred_display_mode_hdmi_ = preferred_display_mode_sdr_
? preferred_display_mode_sdr_
: preferred_display_mode_hdmi_;
Copy link
Collaborator Author

@MarekLuxoft MarekLuxoft Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory if we change display mode, we should also set new currently mode:
SetCurrentDisplayMode
but we change on the same resolution, so I didn't observe any side effect of those changes (and omitting SetCurrentDisplayMode)

if (preferred_display_mode_hdmi_->RefreshRate > kRefreshRateMaximum &&
(!preferred_display_mode_sdr_ ||
preferred_display_mode_sdr_->RefreshRate < mode->RefreshRate)) {
preferred_display_mode_sdr_ = mode;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory it could happen that we don't find any different mode so preferred_display_mode_hdmi_ would have 120Hz on the end anyways but in practice, I think it's not possible (if device support 120Hz it should also support 60Hz).

to cover it we would need use 60Hz as a default refresh rate:
https://github.com/youtube/cobalt/blob/25.lts.1%2B/starboard/shared/uwp/application_uwp.h#L145

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

Successfully merging this pull request may close these issues.

1 participant