Mouse input latency in GNOME 44.1 Wayland sessions is one frame higher than it was in 44.0 and earlier

Bug #2023363 reported by Daniel van Vugt
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Invalid
Medium
Daniel van Vugt
Lunar
Won't Fix
Medium
Daniel van Vugt
Mantic
Invalid
Medium
Daniel van Vugt

Bug Description

[ Impact ]

Mouse input latency in Wayland sessions is slightly higher in 23.10 than 22.04 at the moment.

I might be imagining things and it does feel like only one frame higher latency. But experimenting with MUTTER_DEBUG_TRIPLE_BUFFERING seems to confirm my suspicion:

 BAD: MUTTER_DEBUG_TRIPLE_BUFFERING=auto (the Ubuntu default)
 BAD: MUTTER_DEBUG_TRIPLE_BUFFERING=always
 GOOD: MUTTER_DEBUG_TRIPLE_BUFFERING=never

[ Workaround ]

Add MUTTER_DEBUG_FORCE_KMS_MODE=simple to /etc/environment. Actually that was already a good idea for the best cursor performance even before this bug.

[ Test Plan ]

0. Find a machine with an Intel GPU.

1. Add this to /etc/environment: CLUTTER_DEBUG=frame-timings

2. Reboot.

3. Log in to a Wayland session and wait for the desktop to become idle.

4. Also log in via ssh from a remote machine and run:
   journalctl -f /usr/bin/gnome-shell

5. Over your idle desktop just wiggle the mouse continuously for at least 5 seconds.

6. In your ssh login, verify that the resulting log messages from gnome-shell say "[FRAME_TIMINGS]: Double buffering:" and not "[FRAME_TIMINGS]: Triple buffering:" when only the mouse pointer is moving.

[ Where problems could occur ]

In the frame rate and latency of the Ubuntu desktop experience.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
summary: - Mouse input latency in Wayland sessions is slightly higher in 23.10 than
- 22.04 at the moment
+ Mouse input latency in GNOME 44 Wayland sessions is one frame higher
+ than it should be
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Mouse input latency in GNOME 44 Wayland sessions is one frame higher than it should be

It's a regression in 44.1 caused by the fix for bug 2017137 / bug 2017097. Nobody noticed because one frame of latency is so hard to notice.

tags: added: regression-update
tags: added: regression
summary: - Mouse input latency in GNOME 44 Wayland sessions is one frame higher
- than it should be
+ Mouse input latency in GNOME 44.1 Wayland sessions is one frame higher
+ than it was in 44.0 and earlier
tags: added: lunar
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fixed in 45: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441
but I'll wait till next week to backport it to 44 because it's Friday night and I keep changing my mind about the design of the fix.

Changed in mutter (Ubuntu Lunar):
assignee: nobody → Daniel van Vugt (vanvugt)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robie Basak (racb) wrote :

Thank you for the report. I noted this in https://wiki.ubuntu.com/DesktopTeam/TestPlans/Mutter for future updates that rely on the exception. Would it be appropriate to add this Test Plan to future mutter updates that are based on the exception? If so, please could you amend the wiki? Thanks!

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I don't think cursor motion latency is one of the most important things to test, and it's kind of too awkward for most people to test. So I would not recommend making it part of the primary test case but linking to this bug as a record of what can go wrong seems appropriate.

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Alright a fix is prepared for 44:
https://gitlab.gnome.org/Community/Ubuntu/mutter/-/commits/triple-buffering-v4-44/

But now I'm thinking perhaps bug 2020049 should be addressed at the same time before updating Salsa.

Changed in mutter (Ubuntu Lunar):
status: Triaged → In Progress
Changed in mutter (Ubuntu Mantic):
status: In Progress → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It looks like the fix for bug 2023766 will do a better job at fixing this one too, in theory. And that fix is no longer part of triple buffering so can be patched independently.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

In progress again. Looks like it needs to be redesigned:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441#note_1777367

Changed in mutter (Ubuntu Mantic):
status: Fix Committed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A new fix is coming in triple-buffering 45:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441#note_1777992

But I want it to mature a little, and even try proposing a backport upstream to main, before backporting to 44.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Chow Loong Jin (hyperair) wrote :

Tested the new patch in mutter 44.3 on Lunar. Works great, thanks!

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Invalid for mantic since mutter 45 uses a different approach which doesn't have this bug.

Changed in mutter (Ubuntu Mantic):
status: In Progress → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Won't Fix for lunar because it's EOL next month. https://wiki.ubuntu.com/Releases

Changed in mutter (Ubuntu Lunar):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.