Mir

Dynamic double buffering fails to detect inertial dash scrolling as slow; and stutters instead of scaling up to triple buffers.

Bug #1476201 reported by Daniel van Vugt
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Medium
Daniel van Vugt
mir (Ubuntu)
Undecided
Unassigned
qtmir (Ubuntu)
Medium
Unassigned

Bug Description

Dynamic double buffering fails to detect inertial dash scrolling as slow; and stutters...

[1437388267.960199] perf: Scopes: 37.69 FPS, render time 17.79ms, buffer lag 34.87ms (2 buffers)
[1437388268.985012] perf: Scopes: 30.27 FPS, render time 25.22ms, buffer lag 40.29ms (2 buffers)
[1437388269.993894] perf: Scopes: 31.74 FPS, render time 23.42ms, buffer lag 40.46ms (2 buffers)
[1437388271.002470] perf: Scopes: 36.70 FPS, render time 19.13ms, buffer lag 35.59ms (2 buffers)
[1437388272.021942] perf: Scopes: 44.16 FPS, render time 15.96ms, buffer lag 29.12ms (2 buffers)
[1437388273.043734] perf: Scopes: 40.15 FPS, render time 17.85ms, buffer lag 31.90ms (2 buffers)

whereas forcing triple buffers it runs more smoothly:

[1437389981.872839] perf: Scopes: 57.71 FPS, render time 13.86ms, buffer lag 38.31ms (3 buffers)
[1437389982.877556] perf: Scopes: 56.77 FPS, render time 15.72ms, buffer lag 37.31ms (3 buffers)
[1437389983.887702] perf: Scopes: 57.42 FPS, render time 13.53ms, buffer lag 38.76ms (3 buffers)
[1437389984.894372] perf: Scopes: 55.66 FPS, render time 16.02ms, buffer lag 38.12ms (3 buffers)
[1437389985.912328] perf: Scopes: 60.96 FPS, render time 13.72ms, buffer lag 34.99ms (3 buffers)
[1437389986.929857] perf: Scopes: 59.98 FPS, render time 14.49ms, buffer lag 35.67ms (3 buffers)

You can see that unity8-dash is right on the edge here.

Surprisingly the problem is not detectable if you keep your finger on the screen. Then the dash actually renders faster. The problem only seems to happen with inertial scrolling; when you fling the surface and lift your finger off.

Related branches

tags: added: ddb-missed-0.14
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Silly me. Mir seems to be behaving correctly, although I can think of some improvements. The real issue here is that dynamic double buffering relies on the compositor (over)scheduling enough frames for the performance detection to work. That means calling:
    mir::compositor::Scene::frames_pending()
and compositing that many frames as a _minimum_. We just haven't added support for the algorithm fully to qtmir's compositor code yet.

Changed in qtmir:
importance: Undecided → High
Changed in qtmir (Ubuntu):
importance: Undecided → High
summary: Dynamic double buffering fails to detect inertial dash scrolling as
- slow; and stutters
+ slow; and stutters instead of scaling up to triple buffers.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually qtmir can possibly keep using if (m_surface->buffers_ready_for_compositor(userId) > 0)
as it does already.

The problem then is that Mir reduces the return value of that function prematurely if called in that way. So maybe some fix is still possible in Mir itself.

Changed in qtmir:
status: New → Opinion
Changed in qtmir (Ubuntu):
status: New → Opinion
Changed in mir:
milestone: 0.15.0 → 0.16.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This is a blocker for 0.15. It needs to be fixed.

Changed in mir:
milestone: 0.16.0 → 0.15.0
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision 2799, scheduled for release in mir, milestone 0.16.0

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

Dropped severity as dynamic double buffering is now disabled by default.

Changed in mir:
milestone: 0.15.0 → 0.16.0
status: Fix Committed → In Progress
importance: High → Medium
Changed in qtmir:
importance: High → Medium
Changed in qtmir (Ubuntu):
importance: High → Medium
Changed in mir (Ubuntu):
status: New → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Shifted milestones, because lp:mir/0.15 got rebranched from r2801 the other day, which now includes this fix.

Changed in mir:
milestone: 0.16.0 → 0.15.0
status: In Progress → Fix Committed
no longer affects: mir/0.15
Changed in mir:
status: Fix Committed → In Progress
milestone: 0.15.0 → 0.16.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

And I just realized this bug is about a feature that's never been released yet. Also, a proper fix will follow in future. So still in progress.

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

I now also realize the bug isn't really about dynamic queue scaling either. The same issue happens with fixed double buffering:
   restart unity8 QML_NO_TOUCH_COMPRESSION=1 MIR_SERVER_NBUFFERS=2

The core of the problem is probably that the kernel scaling/frequency governors clock down when not touching the screen, which is too slow for double buffers. However if you're still touching the screen then it remains fast enough for double buffers.

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

The above issue has been moved into bug 1488391. Ideally that would be resolved before we're sure this bug is.

tags: added: performance
Changed in mir:
milestone: 0.16.0 → 0.17.0
Changed in mir:
milestone: 0.17.0 → 0.18.0
Kevin DuBois (kdub)
Changed in mir:
milestone: 0.18.0 → 0.19.0
Changed in mir:
milestone: 0.19.0 → 0.20.0
Changed in mir:
milestone: 0.20.0 → none
Changed in mir:
milestone: none → 0.20.0
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.20.0

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
milestone: 0.20.0 → 0.19.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mir (0.19.0+16.04.20160128-0ubuntu1) xenial; urgency=medium

Changed in mir:
status: Fix Committed → Fix Released
Changed in mir (Ubuntu):
status: Invalid → Fix Released
Michał Sawicz (saviq)
no longer affects: qtmir
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers