Apps appear to freeze in Unity8, although they are really still rendering (swap interval zero). Need to interact with the shell to unfreeze it.

Bug #1497828 reported by Daniel van Vugt
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
qtmir (Ubuntu)
Expired
High
Unassigned
unity8 (Ubuntu)
Invalid
High
Unassigned

Bug Description

Apps appear to freeze in Unity8, although they are really still rendering (swap interval zero). Need to interact with the shell to unfreeze it.

Test case (on Unity8 wily desktop):
$ glmark2-mir -b :title=--desktop_file_hint=unity8
This freezes a couple of times during the benchmark.

Test case (on a phone):
$ mir_demo_client_target -n--desktop_file_hint=unity8
This freezes very quickly when you move your finger around.

Test case (on a phone):
$ glmark2-es2-mir -b :title=--desktop_file_hint=unity8

Changed in unity8 (Ubuntu):
importance: Undecided → High
Changed in qtmir (Ubuntu):
importance: Undecided → High
Changed in qtmir:
importance: Undecided → High
summary: - Clients in Unity8 freeze occasionally. Need to interact with the window
- or launcher to unfreeze them.
+ Clients using swap interval zero in Unity8 freeze occasionally. Need to
+ interact with the shell to unfreeze them.
description: updated
summary: - Clients using swap interval zero in Unity8 freeze occasionally. Need to
+ Clients using swap interval zero in Unity8 freeze regularly. Need to
interact with the shell to unfreeze them.
tags: added: performance
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Clients using swap interval zero in Unity8 freeze regularly. Need to interact with the shell to unfreeze them.

When the freeze occurs, MIR_CLIENT_PERF_REPORT=log in the affected client shows the client is then seeing only two buffers despite Mir being configured for triple buffers. So it would appear the problem might be QtMir failing to release the one that's on screen.

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

Come to think of it, this might be the same underlying problem as bug 1476201 which has a fix on the way.

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

The proof the client is really still rendering while the composited image appears frozen is in MIR_CLIENT_PERF_REPORT=log. Using that you can see the client is still rendering at a high rate but it also shows the client has been starved of one of its three buffers during the freeze.

summary: - Clients using swap interval zero in Unity8 freeze regularly. Need to
- interact with the shell to unfreeze them.
+ Apps appear to freeze in Unity8, although they are really still
+ rendering (swap interval zero). Need to interact with the shell to
+ unfreeze it.
description: updated
description: updated
tags: added: xmir
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Re comment #2 - the fix for bug 1476201 does not appear to solve this one :(

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

Found roughly the cause of the freeze. This callback randomly stops calling back:

        connect(window(), &QQuickWindow::frameSwapped, m_surface, &MirSurfaceInterface::onCompositorSwappedBuffers,
            (Qt::ConnectionType) (Qt::DirectConnection | Qt::UniqueConnection));

and so this function no longer retrieves new buffers, just returns early:

void MirSurface::updateTexture()
{
    QMutexLocker locker(&m_mutex);

    if (m_textureUpdated) {
        return;
    }

Changed in unity8 (Ubuntu):
status: New → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Another test case: This one shows the freeze happening in the log too (nbuffers drops from 3 to 2):

$ env MIR_CLIENT_PERF_REPORT=log glmark2-es2-mir -b :title=--desktop_file_hint=unity8

Changed in qtmir:
status: New → Triaged
Changed in qtmir (Ubuntu):
status: New → Triaged
Revision history for this message
Sturm Flut (sturmflut) wrote :

A simple way to test it on the phone is to install my updated glmark2 click from the store, I recompiled it against the stable overlay PPA today so it now runs on OTA-7.

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

This seems to be fixed now (using xenial on desktop and phone). Can anyone else confirm?

Maybe dandrader/greyback have some idea of when/where a fix landed?

Changed in qtmir:
status: Triaged → Incomplete
Changed in qtmir (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for qtmir (Ubuntu) because there has been no activity for 60 days.]

Changed in qtmir (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QtMir because there has been no activity for 60 days.]

Changed in qtmir:
status: Incomplete → Expired
Michał Sawicz (saviq)
no longer affects: qtmir
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.