Music app needs to register with powerd for display to blank

Bug #1229448 reported by Olli Ries
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Ubuntu Music App
Fix Released
Critical
Victor Thompson

Bug Description

in order to be able to put the music app into the background and put the device into a powersaving mode, music app needs to register itself with powerd.

Mike Frey offered help in pointing you at the right API, I couldn't find any obvious reference in http://bazaar.launchpad.net/~phablet-team/powerd/trunk/files/head:/src/

We are striving to get this resolved by the end of this week, please let us know if this will take longer and we'd be happy to help further.

Related branches

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

Are there any QML apps that currently make use of this registration? Does this code provide QML bindings to register with powerd? If not, we might have an uphill battle on our hands--but I realize this is core functionality and is probably more important than some of the remaining design work.

Please have Mike Frey let our team know how and what needs to be done.

Thanks!

Changed in music-app:
status: New → Confirmed
Revision history for this message
Michael Hall (mhall119) wrote :

There are currently no QML plugins to call this. We will need to make a new QML plugin for the music app, and package it as a separate .deb that the music-app's .deb will depend on.

The plugin itself should be relatively straight forward, since it just wraps DBus. Unity8 has a simple one[1] already that only connects to one signal, we would need to make one that calls 2 methods, requestSysState and clearSysState, which are defined in the DBus API definition file[2]

When the music-app starts playing music, it should call:
cookie = requestSysState("music-app-background", 1)

The name 'music-app-background' isn't used, but the '1' will tell powerd to keep the phone and music-app active. When the music is stopped or paused, it should call:

clearSysState(cookie)

This will tell powerd that it can suspend the music-app and put the phone to sleep. Notice that the 'cookie' from requestSysState is needed to clear the state later.

[1] http://bazaar.launchpad.net/~unity-team/unity8/trunk/view/head:/plugins/Powerd/Powerd.cpp
[2] http://bazaar.launchpad.net/~phablet-team/powerd/trunk/view/head:/data/com.canonical.powerd.xml

Revision history for this message
Daniel Holm (danielholm) wrote :

So basically we need a seperate .deb for the QML bindings and then we just att those signals to trackPlaying and trackStopped?
Who will create this binding; some one of us three, or someone over at Canonical?

Revision history for this message
Olli Ries (ories) wrote :

it would be great if you could give it a shot if you can

David Planella (dpm)
Changed in music-app:
status: Confirmed → Triaged
importance: Undecided → Critical
assignee: nobody → Victor Thompson (vthompson)
summary: - music app needs to register with powerd for display to blank
+ Music app needs to register with powerd for display to blank
Changed in music-app:
status: Triaged → In Progress
Revision history for this message
Loïc Minier (lool) wrote :

(I've commented about various issues I have with the code and with qtpowerd in the merge proposal)

Revision history for this message
Daniel Holm (danielholm) wrote :

Isn't this now resolved?

Changed in music-app:
status: In Progress → Fix Released
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.