Code review comment for lp:~vanvugt/unity8/more-smooth-less-lag

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

Upstream it's possibly not broken because no one else uses nesting. It's more broken for the Mir nested architecture for three reasons:

1. QML touch compression doesn't support nesting (hence stuttering). If you remove it from either client layer the stuttering goes away (bug 1486341).

2. QML touch compression is laggy by design in that it withholds touch events for a full frame. And this lag seemingly happens twice (once in the app client, once in the unity8 client). So it's at least twice as laggy as the Mir input resampling algorithm when nested.

3. QML touch compression (when it does finally) emits events at too high a rate for Mir's long buffer queues. So it fills up the buffer queues making the nested buffer lag 4x16.6ms = 66ms. By comparison, Mir's touch resampling employs a trick to hide the long nested buffer queue lag. In Mir we emit events only at 59Hz so that the queue drains faster than it fills, and so you don't suffer from the full length of the buffer queue. It's more like half or less.

So Mir's built-in touch resampling (which is already enabled) works much better. It's designed to deal with nesting (without stuttering), and also has lower latency.

The QML touch compression is probably not broken for upstream. Upstream no one is trying to use nesting (although this might be evidence:

In the very least you can see some beneficial numbers where the stuttering was first described in bug 1486341.

You can also see the reduced lag easily with your own eyes:

Manual test case #1:
Drag the indicator panel down and up quickly. The gap between your finger and the edge of the panel is much shorter.

Manual test case #2:
Run Mir's latency test client (requires Mir 0.16) in Unity8:
  $ mir_demo_client_target -- --desktop_file_hint=unity8
And now draw consistent circles. The gap between your finger and the target is much shorter.

I've been talking up the benefits of Mir's input resampling algorithm for a while now (it landed on 2014-08-29). But I guess the message still hasn't sunk in everywhere yet.

« Back to merge proposal