Open Bug 1928283 Opened 8 months ago Updated 3 months ago

Scroll Stuttering at 120fps in Android 15

Categories

(Core :: Graphics: WebRender, defect, P3)

Firefox 133
All
Android
defect

Tracking

()

UNCONFIRMED

People

(Reporter: giwayume, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

  1. Install GrapheneOS (Android 15, October 5, 2024 security update) on a brand new Pixel 9 device.
  2. Enable "Smooth display" under Settings -> Display.
  3. Install Firefox Nightly, 133.0a1
  4. Run through my usual ritual of:
    • Customize -> Address bar location: Top
    • Customize -> Gestures -> Pull to refresh: off
    • Customize -> Gestures -> Scroll to hide toolbar: off
    • Secret Settings -> Enable Navigation Toolbar: off
  5. Visit pretty much any website and scroll vertically. For example, the comments section of a youtube video: https://m.youtube.com/watch?v=4iNMyilmDfg

Actual results:

Sample video in Firefox: https://www.youtube.com/watch?v=PxfxanLVPgM
(original recording was 120 fps, this was slowed down 1/2 to 60 fps)
Easier to see in 1080p60 full screen.

There is a mixture of types of stuttering:

  1. Rare, longer pauses
  2. Micro stuttering, where you'll see a consistent short pause every split second between smooth scrolling frames. E.g. 1, 2, 3 (pause) 1, 2, 3 (pause)

It's not just youtube, most websites display the issue where there are several "long" (in comparison) pauses during scrolling, even on web pages that are fully loaded, scrolling up and down through the entire page several times. Even simple pages like duckduckgo search results have scroll stuttering.

Expected results:

Compare to Chromium on the same device: https://www.youtube.com/watch?v=bXfh-xU3em0
(original recording was 120 fps, this was slowed down 1/2 to 60 fps)

I'm not sure it's coming across very well in these recordings, but on the device I basically can't notice any stuttering in Chrome, it looks perfect.

I'm not sure I encoded those videos correctly, they seem to be displaying an image every other frame (30fps)

I re-encoded it properly in 60fps this time. You can see the stuttering WAY better.

Firefox: https://www.youtube.com/watch?v=ghJwBEwKcOE

Chrome: https://www.youtube.com/watch?v=u2b3Jc11N10

The youtube comment section is one of the worst performing use cases. Usually the stutter jank I see is 1-3 longer pauses in the middle of a scroll. If the cause of the longer pauses can be identified and fixed it would be a big win.

Interestingly, the stutter seems to not be because display frames are skipped, but rather it's sometimes inconsistent with how far the page scrolls each frame. This is very obvious if you go frame-by-frame at the scroll that starts at the 3 second mark of the Firefox video.

The severity field is not set for this bug.
:kaya, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(kkaya)

This is just a general observational suspicion, but the lag spikes appear to occur most often on pages displaying several images, such as search engine image search results, or shopping sites.

I am getting horrible lag spikes scrolling down and up back and forth on this page, worst I have seen.

https://duckduckgo.com/?q=yoshiyuki+konichi&iax=images&ia=images

Component: Performance → Panning and Zooming
Flags: needinfo?(kkaya)
Product: Fenix → Core
Blocks: 1895538

Hi,
Can you still reproduce the bug? If yes, it might be useful for us to have a Profile. For that, you need to:

  • Open Settings in Nightly, then "About Firefox", and then tap repeatedly on the Firefox icon until "Debug menu enabled" is shown at the bottom of your screen
  • Scroll down on the Settings screen, and tap "Start Profiler". Then click on the "Start profiler" button on the dialog that shows (keep the default option, "Firefox", selected)
  • Reproduce the bug
  • Open settings, scroll down and tap "Stop profiler", and then "Upload profile"
  • The profile url will be copied into your clipboard, paste it into a comment here.

You can do that on Nightly if you can reproduce the bug there, other wise you can do it on Firefox Release.

Thanks for your help here.

The severity field is not set for this bug.
:botond, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(botond)

Needinfoing reporter for comment 7.

Also marking as S3 based on symptom severity.

Severity: -- → S3
Flags: needinfo?(botond) → needinfo?(giwayume)
Priority: -- → P3

It's been a while. On my retest of the same page, not as prevalent as I remember it but I can still see the scroll -> pause -> scroll -> pause.

https://profiler.firefox.com/public/z9cnfn6e3epj39gk9d98xwafbnxd8cv34fqnhr8/calltree/?globalTrackOrder=50w4&hiddenGlobalTracks=12&hiddenLocalTracksByPid=23607-04~23690-0w2~24407-0w2~23965-2w578~24287-03&thread=e&v=10

Flags: needinfo?(giwayume)

136.0a1 (Build #2016066375)

The only thing I can tell from this profile is the pauses in scroll rendering seem to be tied to an abnormally long composite that's tagged as a VSYNC.

Keep in mind I run the display at 120hz. It has an adaptive refresh that goes down to 60, but if I turn on the "display refresh rate" setting in the android developer options, the lag is not associated with adaptive refresh dropping to 60.

(In reply to Firefox Reporter from comment #12)

Here is the profile for this page, which still has really bad lag spikes.

https://duckduckgo.com/?q=yoshiyuki+konichi&iax=images&ia=images

https://profiler.firefox.com/public/kjwhwezxfb3ae4vy0429kbpsz6bfvzbbaxb9vx0

Thanks for the profile. I do see some composites that are taking longer than what fits into the frame budget at 120fps. They are happening during the "fling" phase (the fingers have left the screen, we're not processing any touch events, just doing momentum scrolling from an earlier touch). We seem to be requesting composites regularly but periodically one takes longer than expected (e.g. around the 8.8s mark, in the Rendered thread of the GPU Process there is a "Composite #3" marker whose duration is 42.3ms).

Moving to the WebRender component for further investigation of the slow composites, and cc'ing Jamie.

Component: Panning and Zooming → Graphics: WebRender

I see a lot of complaints about Firefox scrolling on Android, I thought this Chromium post might help out. https://blog.chromium.org/2023/08/smoothing-out-scrolling-experience-in.html

One of the improvements listed there seems to only be available to Android 14 and up.

You need to log in before you can comment on or make changes to this bug.