From 36e44acc71700b46a68037a8159f2e5fdbabac2d Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Fri, 10 Jul 2026 13:30:20 +0200 Subject: [PATCH] Set the screen frame rate to 60 Hz: fix video playback extremely choppy (#2877) Fixes a destructive conflict between the 60Hz anti-fingerprinting snapping logic (kThrottleMainFrameTo60Hz) and the native kOnBeginFrameThrottleVideo feature when hardware VSync is disabled. The artificial timestamp snapping introduced by the anti-fingerprinting patch tricks the viz video throttling heuristics into thinking the playback is unstable, forcing the compositor to drop BeginFrame intervals to 30Hz (33.3ms). This leads to false lost frames and severe stuttering in the media pipeline. Disabling kOnBeginFrameThrottleVideo restores the continuous 60Hz rhythm. --- .../Set-the-screen-frame-rate-to-60-Hz.patch | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch b/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch index 2031f383..9a0381a5 100644 --- a/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch +++ b/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch @@ -15,6 +15,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/browser/about_flags.cc | 6 +++--- .../browser/chrome_content_browser_client.cc | 11 +++++++++++ .../Set-the-screen-frame-rate-to-60-Hz.grdp | 9 +++++++++ + components/viz/common/features.cc | 3 +++ .../common/frame_sinks/begin_frame_source.cc | 14 +++++++++++++- .../common/frame_sinks/begin_frame_source.h | 1 + .../frame_sinks/delay_based_time_source.cc | 2 +- @@ -25,7 +26,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../Set-the-screen-frame-rate-to-60-Hz.inc | 7 +++++++ .../core/animation/animation_clock.cc | 11 ++++++++--- .../core/view_transition/view_transition.cc | 2 ++ - 16 files changed, 120 insertions(+), 20 deletions(-) + 17 files changed, 123 insertions(+), 20 deletions(-) create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Set-the-screen-frame-rate-to-60-Hz.grdp create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Set-the-screen-frame-rate-to-60-Hz.inc @@ -179,6 +180,26 @@ new file mode 100644 + Throttle compositor frame rate to 60fps, even when VSync rate is higher. + + +diff --git a/components/viz/common/features.cc b/components/viz/common/features.cc +--- a/components/viz/common/features.cc ++++ b/components/viz/common/features.cc +@@ -22,6 +22,7 @@ + #include "gpu/config/gpu_switches.h" + #include "media/media_buildflags.h" + #include "ui/gl/gl_switches.h" ++#include "cc/base/features.h" + + #if BUILDFLAG(IS_ANDROID) + #include "base/android/device_info.h" +@@ -468,6 +469,8 @@ int MaxOverlaysConsidered() { + } + + bool ShouldOnBeginFrameThrottleVideo() { ++ if (base::FeatureList::IsEnabled(features::kThrottleMainFrameTo60Hz)) ++ return false; + return base::FeatureList::IsEnabled(features::kOnBeginFrameThrottleVideo); + } + diff --git a/components/viz/common/frame_sinks/begin_frame_source.cc b/components/viz/common/frame_sinks/begin_frame_source.cc --- a/components/viz/common/frame_sinks/begin_frame_source.cc +++ b/components/viz/common/frame_sinks/begin_frame_source.cc