Repository navigation
Animation stutters on Windows desktop, but is smooth on Chrome or MacOS desktop #97334
Description
Issue
With the Rive Flutter application, playback with complex animations is smooth on Windows Chrome and MacOS desktop, but noticeable stuttering occurs on Windows desktop. Same build, same project file - the only difference is the build target. I believe Flutter was using Angle to convert OpenGL to DirectX on the fly, which is not as performant as Skia's native DirectX backend. Not sure if this is still the case and/or relevant.
We've reproduced this behavior across a number of Windows desktops, including machines with RTX 3080 graphics cards.
Target Platform: Windows desktop 10+
Devices: windows-x64 (e.g., Microsoft Windows Version 10.0.19044.1466)
Flutter version: Repro'd with 2.8, 2.9 and 2.10.0-0.2.pre
Windows desktop video
Pay attention to the rocks, tree and castle on the rotating planet below the knight. As these elements rotate you can see a significant stutter or "hitch" every few frames. You can also see this behavior with the blue vertical playhead line in the animation timeline.[Note: The video capture software introduced a teensy bit of playback artifacts, but these videos are 99% accurate to the actual application experience.]
Rive_WinDesktop_stuttering.mp4
Windows Chrome video
Same computer, version of Rive, account and project file as above, but running in Chrome. Playback is much smoother than the Win desktop.Rive_Chrome_no_stuttering.mp4
Logs
flutter analyze
info - The value of the local variable 'cubic' isn't used - lib\rive\stage\items\stage_path_vertex.dart:49:11 - unused_local_variable
info - This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: RiveTreeView.scrollController, RiveTreeView.physics - lib\widgets\tree_view\rive_tree_view.dart:5:7 - must_be_immutable
info - The value of the local variable 'tasksApi' isn't used - test\managers\push_event_manager_test.dart:47:23 - unused_local_variable
flutter doctor -v
[√] Flutter (Channel unknown, 2.10.0-0.2.pre, on Microsoft Windows [Version 10.0.19044.1466], locale en-US)
• Flutter version 2.10.0-0.2.pre at C:\Users\chada\Development\flutter
• Upstream repository unknown
• Framework revision 73adb14 (7 days ago), 2022-01-19 17:02:56 -0600
• Engine revision 74b74b1
• Dart version 2.16.0 (build 2.16.0-134.1.beta)
• DevTools version 2.9.2
[!] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\Users\chada\AppData\Local\Android\sdk
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.0.32014.148
• Windows 10 SDK version 10.0.22000.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\chada\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.32.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1466]
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.55
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
caudetgit commentedon Jan 27, 2022
We created a small project using the public flutter app with a sample animation showing the issue (same animation as in the videos above).
https://github.com/luigi-rosso/flutter_performance_97334
csells commentedon Jan 27, 2022
Thanks, @caudetgit . We'll take a look.
cc @HansMuller
maheshj01 commentedon Jan 28, 2022
Hi @caudetgit, Thanks for filing the issue. I can barely see a difference on windows/ macOS Desktop. I have attached the timeline-trace from the master channel. The app was run in profile mode with
--trace-skiaon both the platforms.Windows desktop
flutter_performance_97334.2022-01-28.19-50-39_Trim.mp4
MacOS desktop
Screen.Recording.2022-01-28.at.8.08.07.PM.mov
flutter doctor -v (windows)
flutter doctor -v (macos)
I could not verify it on the web the animation failed to load with
XMLHttpRequestflutter run -d chrome
Labeling this issue for further investigation.
gspencergoog commentedon Feb 3, 2022
cc @iskakaushik Is this something you have an interest in?
63 remaining items
withliyh commentedon Jan 30, 2024
Based on this patch, I made a few modifications, and there is almost no jitter or frame dropping on Windows 10 and Windows 11 systems.
kobutri commentedon Jan 30, 2024
@withliyh Thank you so much for taking up this issue. I'm having trouble applying your patch. Apparently the angle surface manager stuff was moved in #49900. Could you tell me on which commit of your repo you created the patch or alternatively recreate it on the latest version?
withliyh commentedon Jan 31, 2024
@kobutri on the 3.16.8 branch, commit: 6e2ea58a5ccbefcfadc2d4b7b8045fc6c20ab812
withliyh commentedon Jan 31, 2024
@loic-sharma @kobutri full changes, Hope this is helpful for diagnosing the issue.
kobutri commentedon Jan 31, 2024
I only had time yet to test the simple example of a moving bar, but it seems to be working pretty well. Thank you so much for your effort. I think landing this will remove one of the major barriers to making Flutter a viable choice on Windows.
Edit: you may want to download the video file and play it locally. Because the playback seems laggy, at least in my browser.
2024-01-31.13-03-32.mp4
flutter-triage-bot commentedon Jun 6, 2024
The
triaged-desktoplabel is irrelevant if there is noteam-desktoplabel orfyi-desktoplabel.