Qt render gets blocked on EGLSwapBuffers [fka Upon upgrading to Qt5.2 the music app no longer plays the next song if the screen is off]

Bug #1292306 reported by Victor Thompson
48
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Critical
Alexandros Frantzis
Ubuntu Music App
Invalid
Critical
Unassigned
unity-mir
Invalid
Critical
Gerry Boland
mir (Ubuntu)
Fix Released
Critical
Unassigned
qtdeclarative-opensource-src (Ubuntu)
Won't Fix
Critical
Michał Sawicz

Bug Description

Running with the landing006 PPA containing Qt5.2 (this should be landing on the next proposed image, r237) on the device causes the music app to stop music playback when the following occurs:

1) A song has started playing
2) The screen is either shut off or the screen automatically shuts off
3) During this time the currently playing song ends
4) The next song will NOT be played until the screen is turned back on

Expected results: Step #4 will allow the next song in the queue to be played without intervention.

Related branches

Revision history for this message
Victor Thompson (vthompson) wrote :

Marking this bug as medium since it hasn't been proven to also be seen in the trusty-proposed images.

tags: added: qt5.2
Changed in music-app:
status: New → Triaged
importance: Undecided → Medium
Changed in music-app:
importance: Medium → Critical
Revision history for this message
Michał Sawicz (saviq) wrote :

I very much doubt this is a unity-mir bug, it doesn't know about when the song ends.

What's more, qmlscene uses CPU when the app stops playing, so the app is not stopped by the app lifecycle. This must be some app/Qt/QtMultimedia issue, or maybe android media services.

Changed in unity-mir:
status: New → Incomplete
Revision history for this message
Michał Sawicz (saviq) wrote :

Additional data points: it's enough for the screen to turn on, no need to focus the app for it to resume playback.

Keeping the device active with `powerd-cli active` doesn't help - it does, however, help to keep the display on, even if locked (and hence the app is unfocused).

I wonder if it's some interaction with the compositor, maybe... like the app is prevented from rendering and Qt/QML gets confused and the playlist doesn't advance.

Revision history for this message
Alexander Sack (asac) wrote :

Suggested promotion blocker on mailing list. CCed a few that might be able to find the right direction to look here.

QA probably should do the call whether this is a blocker or not. If it is, we should ensure that we run a similar test "music lifecycle, screen off/on tests" for all kind of music/media related component landings and of course during image testing. Can we work this into the appropriate image and landing test plans?

Revision history for this message
Victor Thompson (vthompson) wrote :

I've related a branch that adds a test for this in the future for the music app.

Revision history for this message
Victor Thompson (vthompson) wrote :

I agree that this seems like a QtMultimedia issue. Jim Hodapp, could I get verification that the media hub's modified QtMultimedia MediaPlayer component isn't being included in the recent phone images.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

@Victor Thompson: there is no media-hub code landed in the archive at all yet, so no this isn't media-hub affecting things. And there's the possibility that media-hub could in fact fix this issue. It sounds to me like the music-app is no longer in the foreground when the screen is off and so the music-app can't advance the playlist to the next song. If this is the case, this is why I think media-hub will fix this scenario with the background playlist support added.

Revision history for this message
Michał Sawicz (saviq) wrote :

Here goes: lp:~albaguirre/mir/test-hack-consume-buffers-display-off hacks in a way that lets apps render even though screen is off. Attached are armhf binaries with a script to push it to device (thanks AlbertA!).

tail -f /var/log/lightdm/unity-system-compositor.log will show you that composition happens every second (when app updates the time counter) even when screen is off.

This makes the app continue to next song on the playlist, as well as handle volume keys when screen is off.

This means that indeed Qt changed something that makes the events not go around when it can't render frames. Next step would be to find if that is the designed behaviour and why not, and how to fix it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtdeclarative-opensource-src (Ubuntu):
status: New → Confirmed
Changed in qtdeclarative-opensource-src (Ubuntu):
assignee: nobody → rosa maria (rprosamaria383)
Changed in unity-mir:
assignee: nobody → rosa maria (rprosamaria383)
Changed in music-app:
assignee: nobody → rosa maria (rprosamaria383)
Revision history for this message
Michał Sawicz (saviq) wrote :

Confirmed the suspicions and filed a bug upstream: https://bugreports.qt-project.org/browse/QTBUG-37677

I could emulate the rendering block by SIGSTOP'ing Xvfb to which qmlscene was rendering, see bug for details.

Changed in music-app:
assignee: rosa maria (rprosamaria383) → nobody
Changed in unity-mir:
assignee: rosa maria (rprosamaria383) → nobody
Changed in qtdeclarative-opensource-src (Ubuntu):
assignee: rosa maria (rprosamaria383) → nobody
assignee: nobody → Michał Sawicz (saviq)
Changed in unity-mir:
status: Incomplete → Invalid
Changed in music-app:
status: Triaged → Invalid
Changed in music-app:
assignee: nobody → rosa maria (rprosamaria383)
Changed in unity-mir:
assignee: nobody → rosa maria (rprosamaria383)
assignee: rosa maria (rprosamaria383) → nobody
assignee: nobody → rosa maria (rprosamaria383)
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

@rosamaria, only assign a bug to yourself if you're actively working on a fix, otherwise stop changing assignees. Thanks.

Changed in music-app:
assignee: rosa maria (rprosamaria383) → nobody
Changed in unity-mir:
assignee: rosa maria (rprosamaria383) → nobody
Michał Sawicz (saviq)
Changed in qtdeclarative-opensource-src (Ubuntu):
status: Confirmed → In Progress
Leo Arias (elopio)
Changed in qtdeclarative-opensource-src (Ubuntu):
importance: Undecided → Critical
Leo Arias (elopio)
tags: added: elopio qa-new
Changed in music-app:
assignee: nobody → rosa maria (rprosamaria383)
Changed in music-app:
assignee: rosa maria (rprosamaria383) → nobody
Changed in unity-mir:
assignee: nobody → rosa maria (rprosamaria383)
Michał Sawicz (saviq)
Changed in unity-mir:
assignee: rosa maria (rprosamaria383) → nobody
Changed in unity-mir:
assignee: nobody → rosa maria (rprosamaria383)
Changed in music-app:
assignee: nobody → rosa maria (rprosamaria383)
Revision history for this message
Michał Sawicz (saviq) wrote :

Once again. @rosa maria. Please don't assign yourself to the tasks, unless you're really working on them.

Changed in music-app:
assignee: rosa maria (rprosamaria383) → nobody
Changed in unity-mir:
assignee: rosa maria (rprosamaria383) → nobody
Revision history for this message
Michał Sawicz (saviq) wrote :

The commit responsible for this was the threaded render loop rewrite:

https://qt.gitorious.org/qt/qtdeclarative/commit/ebe8b9408cfcd953fae80514aa67e49221541bed

Revision history for this message
kevin gunn (kgunn72) wrote :

I'm marking this bug as a mir & unity-mir bug, since that's where we are going to solve the "problem"
short story, we're going to make mir not block on eglswapbuffers & rely on exposeEvent() in qt (via shell trigger)
please read this for detail
https://lists.launchpad.net/ubuntu-phone/msg07458.html

mir branch under test as of today
  https://code.launchpad.net/~afrantzis/mir/non-blocking-swap-buffers-spike
note, expose event change branch still needed, to be updated

Changed in mir:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Alexandros Frantzis (afrantzis)
Changed in unity-mir:
status: Invalid → Triaged
importance: Undecided → Critical
assignee: nobody → Gerry Boland (gerboland)
Changed in qtdeclarative-opensource-src (Ubuntu):
status: In Progress → Won't Fix
summary: - Upon upgrading to Qt5.2 the music app no longer plays the next song if
- the screen is off
+ Qt render gets blocked on EGLSwapBuffers [fka Upon upgrading to Qt5.2
+ the music app no longer plays the next song if the screen is off]
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

FWIW, this still happens in image 276. Not surprising though, since no fix is committed.

tags: added: r276
Changed in mir:
milestone: none → 0.1.9
status: Triaged → In Progress
Revision history for this message
kevin gunn (kgunn72) wrote :

just an update, associated branches up for MP. but at the moment experiencing the dreaded "fails ci testing, but when rerun ci testing locally no failures".

tags: added: qa-touch-blocker
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir/devel at revision 1545, scheduled for release in mir, milestone Unknown

Changed in mir:
status: In Progress → Fix Committed
Revision history for this message
kevin gunn (kgunn72) wrote :

Branches up for testing are built in silo3 for testing
https://launchpad.net/~ci-train-ppa-service/+archive/landing-003

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mir (Ubuntu):
status: New → Confirmed
Changed in mir:
status: Fix Committed → Fix Released
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Reproduced on utopic image 2.

tags: added: u2
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mir - 0.1.9+14.10.20140430.1-0ubuntu1

---------------
mir (0.1.9+14.10.20140430.1-0ubuntu1) utopic; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.1.9 (https://launchpad.net/mir/+milestone/0.1.9)
    - mirclient ABI unchanged, still at 7. Clients do not need rebuilding.
    - mirserver ABI bumped to 19. Shells need rebuilding.
    - More libmirserver class changes and reorganization, including;
      . Moving things from shell:: to scene::
      . Rewriting/refactoring surface factories.
    - Added an id() to Renderable.
    - Scene/Renderer interfaces:
      . Scene is no longer responsible for its own iteration (no for_each
        any more). Instead you should iterate over the list returned by
        Scene::generate_renderable_list().
    - Bugs fixed:
      . Stale socket issue. (LP: #1285215)
      . Qt render gets blocked on EGLSwapBuffers. (LP: #1292306)
      . Lock order violated found in helgrind (potential deadlock).
        (LP: #1296544)
      . [regression] SwitchingBundle in framedropping mode can hang.
        (LP: #1306464)
      . [DPMS] Display backlight turns back on almost immediately after
        being turned off. (LP: #1231857)
      . Wrong frame is seen on wake up/resume/unlock. (LP: #1233564)
      . Nested platform is not testable (LP: #1299101)
      . [regression] mir_demo_server_shell crashes on display resume.
        (LP: #1308941)
      . Multi-threaded composition is actually mostly serialized by
        SurfaceStack::guard. (LP: #1234018)
      . Mirscreencast slows down compositing and makes it very jerky.
        (LP: #1280938)
      . Mirscreencast can cause clients to render faster than the screen
        refresh rate. (LP: #1294361)
      . Screen turns on when a new session/surface appears. (LP: #1297876)
      . mir-doc package is >56MB in size, expands to >100MB of files.
        (LP: #1304998)
      . [regression] Clang: 'mir::test::doubles::MockSurface::visible'
        hides overloaded virtual function [-Woverloaded-virtual].
        (LP: #1301135)
      . [regression] GLRenderer* unit tests have recently become noisy.
        (LP: #1308905)
      . FocusController::set_focus_to() no longer seems to raise a session
        to the top. (LP: #1302689)

  [ Ubuntu daily release ]
  * New rebuild forced
 -- Ubuntu daily release <email address hidden> Wed, 30 Apr 2014 13:26:58 +0000

Changed in mir (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Victor Thompson (vthompson) wrote :

Confirmed this as fixed in Utopic image r7.

Changed in mir (Ubuntu):
importance: Undecided → Critical
Gerry Boland (gerboland)
Changed in unity-mir:
status: Triaged → Invalid
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.