Public bug reported:

Ubuntu 26.04.1, mutter 50.1-0ubuntu2.5 (libmutter-18-0), Wayland
session.

[ Impact ]

A screen cast of a real monitor asked for at the monitor's own refresh
rate (for example `max-framerate=60/1` on a 60 Hz monitor) delivers
about 40 frames per second instead of 60. About every third frame is
skipped as "too early" because of a few microseconds of timing jitter. A
cast asked for at half the refresh rate (30/1) delivers about 23 frames
per second instead of 30.

This affects screen recording and remote desktop through the portal or
Mutter's ScreenCast API on monitor streams, for GNOME's own tools and
third-party apps alike. Upstream report:
https://gitlab.gnome.org/GNOME/mutter/-/work_items/4702

Expected: 60 frames per second at 60/1 and 30 at 30/1. What happens:
about 40 and about 23.

[ Fix ]

Upstream merge request
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5358 (merged
2026-10-14 into main and gnome-51; four commits: bdb26d61, 60cca392,
e5ffb192, 6771b410). It replaces the "too early" test with rounding to
the nearest frame boundary. It is not on gnome-50. A mutter developer
said on the upstream issue that a backport to 50 is possible in
principle, and that Ubuntu has to be asked directly.

The four commits apply to 50.1 with one change: the file is
src/backends/meta-screen-cast-stream-src.c in 50, and 50's
accumulate_damage() call on the skip path is kept. The helper the fix
uses, mtk_find_nearest_interval_boundary, already exists in 50.

[ Test Plan ]

On Ubuntu 26.04 with one 60 Hz monitor, Wayland session:
1. Run a window that draws at 60 fps.
2. Start a monitor screen cast (org.gnome.Mutter.ScreenCast RecordMonitor) and 
read it with `pipewiresrc path=<node> ! video/x-raw,max-framerate=60/1 ! 
fakesink` (or any consumer), counting buffers per second.
3. Expected with the fix: about 60 per second, with gaps of 16.7 ms. Without 
it: about 40, with gaps of 16.7 and 33.3 ms.
4. Repeat with max-framerate=30/1. Expected with the fix: 30 per second.

Results on one machine (Intel UHD 750, 1920x1080 at 60 Hz), stock
50.1-0ubuntu2.5 against a local build with the four commits:

- pipewiresrc 60/1, real monitor: stock 38.7 fps; with !5358 59.8 and 60.0 fps
- pipewiresrc 30/1, real monitor: stock not measured; with !5358 30.0 and 30.0 
fps
- remote-desktop client, 60/1, decoded on the far end: stock about 40 fps; with 
!5358 60.6 fps
- private `mutter --headless`, 60/1, 30/1, 50/1, 24/1: stock 40.7, 23.0, 30.0, 
20.0; with !5358 60.0, 30.0, 47.0, 24.0

Mutter's own test suite passed in the local build (including
mutter:native-screen-cast).

[ Where problems could occur ]

The change is limited to when a screen-cast frame counts as "too early"
in maybe_record_frame. A mistake would show as screen casts delivering
more or fewer frames than asked for: too many frames at rates below the
refresh rate, or uneven spacing. In our tests, frames at 30/1 were 30
per second, but about 10-16% of the gaps were 16.7 or 50 ms in pairs
instead of all 33.3 ms. That is upstream's rounding working as designed,
and the average is exact. Virtual-monitor and window streams are not
affected by the limiter.

[ Other Info ]

Fixed upstream in GNOME 51.2 and later (and 52).

** Affects: mutter (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to mutter in Ubuntu.
https://bugs.launchpad.net/bugs/2174434

Title:
  Monitor screen casts drop to about 40 fps at 60/1 (and about 23 fps at
  30/1); fixed upstream by mutter !5358

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2174434/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to