Apps can keep screen lit permanently
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Canonical System Image |
High
|
Michał Sawicz | ||
| | Oxide |
Critical
|
Olivier Tilloy | ||
| | 1.10 |
Critical
|
Olivier Tilloy | ||
Bug Description
rc-proposed, r140, krillin
There are times when it seems the display blanking policy stops working and the display stays on until I press the power button.
Steps to reproduce:
* install and start Siete
* put it in background
Expected outcome:
* the display is switched off after a predetermined amount of time
Actual outcome:
* the display stays on forever
======
Now that apps can request the screen to stay on, they can do so regardless of whether they're focused/visible or not.
Related branches
- Chris Coulson: Approve on 2015-10-19
-
Diff: 40 lines (+11/-5)1 file modifiedshared/browser/oxide_power_save_blocker.cc (+11/-5)
| Andrea Bernabei (faenil) wrote : | #2 |
backtrace of all threads
http://
| Changed in unity-system-compositor (Ubuntu): | |
| assignee: | nobody → Alexandros Frantzis (afrantzis) |
| Andrea Bernabei (faenil) wrote : | #3 |
phablet@
Package: unity-system-
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 8595
Maintainer: Ubuntu Developers <email address hidden>
Architecture: armhf
Version: 0.1.3+15.
Depends: libandroid-
Suggests: powerd
Conffiles:
/etc/dbus-
Description: System compositor for Ubuntu
System compositor used by the Mir display server in Ubuntu. If the Unity
System Compositor can't start, LightDM will fallback to plain Xorg display
server.
Homepage: https:/
| Andrea Bernabei (faenil) wrote : | #4 |
I think this happens when I receive Text messages notifications (SMS)
| Launchpad Janitor (janitor) wrote : | #5 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in unity-system-compositor (Ubuntu): | |
| status: | New → Confirmed |
| Pat McGowan (pat-mcgowan) wrote : | #6 |
Last time we saw somethign similar was bug #1391230 in case it helps
| Changed in canonical-devices-system-image: | |
| assignee: | nobody → kevin gunn (kgunn72) |
| kevin gunn (kgunn72) wrote : | #7 |
ok, i've been running a script to text, blank at various intervals (including various power button & manual app sessions) for the last 24+hrs on krillin - it's still blanking fine on it's own.
mzanetti reported he no longer sees this after his update this morning.
Would like to know if anyone is experiencing this on the ota7 candidate.
| Pat McGowan (pat-mcgowan) wrote : | #8 |
I just got this on an MX4 running proposed 136
Browser messaging and settings are running
Phone has not been rebooted for several days
powerd-cli list
System State Requests:
Name: active, Owner: :1.42, State: 1
Name: com.canonical.
| Pat McGowan (pat-mcgowan) wrote : | #9 |
Mapping the dbus name on :1.42 with
sudo dbus-send --print-
shows it is unity8
| Pat McGowan (pat-mcgowan) wrote : | #10 |
sudo powerd-cli stats
System Request Statistics:
Owner Name Count Active Time Time Active Since
:1.23 usensord 61 150.659522 25.733926 0.000000
:1.42 active 14 5436.939907 3336.396409 69890.487776
:1.14 com.canonical.
:1.90 ubuntu push client 256 1697.831991 60.090916 0.000000
:1.60 media-hub-
| Pat McGowan (pat-mcgowan) wrote : | #11 |
after gdb to usc we found the culprit is the webbrowser-app, suspecting the new feature to play in the background added to oxide
| Changed in canonical-devices-system-image: | |
| assignee: | kevin gunn (kgunn72) → David Barth (dbarth) |
| importance: | Undecided → Critical |
| milestone: | none → ww46-2015 |
| status: | New → Confirmed |
| Changed in webbrowser-app (Ubuntu): | |
| assignee: | nobody → Olivier Tilloy (osomon) |
| importance: | Undecided → Critical |
| summary: |
- rc-proposed r140, krillin: screen does not blank after timeout expires + screen does not blank after timeout expires |
| Michał Sawicz (saviq) wrote : | #12 |
We need unity8 to proxy the screen request to u-s-c on behalf of the app, clearing it when the requesting app goes out of focus/view.
Webbrowser app still needs investigation as it should behave correctly here, but it might not get enough time to release the screen lock.
| description: | updated |
| summary: |
- screen does not blank after timeout expires + Apps can keep screen lit permanently |
| Olivier Tilloy (osomon) wrote : | #13 |
Oxide (the web engine under webbrowser-app) is the one that issues a request to prevent screen blanking when playing a video.
It has code to handle releasing the lock when the app goes into the background, so unless the signal doesn’t reach oxide in time before the process is stopped, the lock should be released as expected.
See oxide::
| Alexandros Frantzis (afrantzis) wrote : | #14 |
I have found a way to deterministically reproduce the issue with webbrowser-app. Perhaps there are other scenarios that are problematic, but hopefully this will at least provide some hints. Below are the steps and between them the USC logs I get for each step, which give some insight into what is going wrong.
[TL;DR]
The problem seems to be that, for some reason, if after the screen is turned on and logging in the webbrowser is in focus and playing a video (which means that the user previously turned off the screen with the power button while playing a video in the browser) the webbrowser app leaks (doesn't eventually release) two keepDisplayOn requests ids. This causes the screen to stay on even when focusing away from it.
[Detailed analysis]
1. Start browser, start watching a youtube video. The browser requests keepDisplayOn twice from two different dbus connections, which is strange, but OK.
[1444841076.023016] usc::UnityScree
[1444841076.023390] usc::UnityScree
[1444841077.052913] usc::UnityScree
[1444841077.053164] usc::UnityScree
2. Turn off screen with power key. Everything is normal the keepDisplayOn requests are released.
[1444841087.268477] usc::UnityScree
[1444841087.274530] usc::UnityScree
3. Turn on screen with power key, log in, video should resume. Strange things happen here, note the extra keepDisplayOn requests this time (4 vs 2 before, and they are all from webbrowser-app)
[1444841106.885474] usc::UnityScree
[1444841106.885997] usc::UnityScree
[1444841106.889124] usc::UnityScree
[1444841106.889333] usc::UnityScree
[1444841106.895151] usc::UnityScree
[1444841106.895258] usc::UnityScree
[1444841106.900406] usc::UnityScree
[1444841106.900471] usc::UnityScree
4. Focus away from webbrowser (e.g. go to scopes). webbrowser-app requested 4 keepDisplayOn ids but releases only 2, which causes the screen to stay on.
[1444841117.298103] usc::UnityScree
[1444841117.307436] usc::UnityScree
| Olivier Tilloy (osomon) wrote : | #15 |
Thanks for the detailed analysis Alexandros. I am able to reproduce the issue reliably on my arale, looking into it.
Note that the fact that keepDisplayOn is requested twice is expected: chromium instantiates one PowerSaveBlocker per stream, so for a video with audio, that’s two streams, hence two requests. Perhaps not the most efficient thing to do, but it should be okay as long as the corresponding removeDisplayOn
| Olivier Tilloy (osomon) wrote : | #16 |
I have instrumented oxide, and I’m seeing the following:
Start playback of video, two instances of PowerSaveBlocker (one for video, one for audio) are created and request a lock:
[1015/201111:
[1015/201111:
[1015/201111:
[1015/201111:
[1015/201111:
[1015/201111:
[1015/201111:
[1015/201111:
Press power button, the two PowerSaveBlocker instances correctly release their locks, as expected:
[1015/201117:
[1015/201117:
[1015/201117:
[1015/201117:
Press power button again to wake screen, unlock screen, playback resumes but Init() appears to be called twice on each instance:
[1015/201130:
[1015/201130:
[1015/201130:
[1015/201130:
[1015/201130:
[1015/201130:
[1015/201130:
[1015/201131:
[1015/201131:
[1015/201131:
[1015/201131:
[1015/201131:
I’m suspecting that Init() is called once by chromium itself when it resumes the paused playback, and a second time in the meantime by the code that handles application state changes, when oxide detects that the application got focused.
This is a bug in oxide: a call to Init() should bail out if another Init() has alrea...
| Changed in oxide: | |
| assignee: | nobody → Olivier Tilloy (osomon) |
| importance: | Undecided → Critical |
| status: | New → Confirmed |
| Changed in webbrowser-app (Ubuntu): | |
| status: | New → Invalid |
| Changed in oxide: | |
| status: | Confirmed → In Progress |
| Changed in unity-system-compositor (Ubuntu): | |
| status: | Confirmed → Invalid |
| Michał Sawicz (saviq) wrote : | #17 |
I'm reopening the unity-system-
We need to make sure that only the foreground app can request a screen lock, which means we need to refactor how it works and have the shell proxy the requests to u-s-c.
| Changed in unity-system-compositor (Ubuntu): | |
| status: | Invalid → New |
| Changed in oxide: | |
| status: | In Progress → Fix Released |
| Changed in canonical-devices-system-image: | |
| assignee: | David Barth (dbarth) → Michał Sawicz (saviq) |
| Changed in canonical-devices-system-image: | |
| milestone: | ww46-2015 → ww02-2016 |
I have seen this (screen lit and never goes blank) in OTA-7, bq aquaris 4.5. I simply cancelled an alarm, and it happened. syslog attached,
| Launchpad Janitor (janitor) wrote : | #19 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in qtmir (Ubuntu): | |
| status: | New → Confirmed |
| Changed in unity-system-compositor (Ubuntu): | |
| status: | New → Confirmed |
| Changed in unity8 (Ubuntu): | |
| status: | New → Confirmed |
| Changed in canonical-devices-system-image: | |
| milestone: | ww02-2016 → ww46-2015 |
| Changed in canonical-devices-system-image: | |
| status: | Confirmed → Fix Committed |
| Andrea Bernabei (faenil) wrote : | #22 |
this just happened again to my krillin, rc-proposed, r181
sudo dbus-send --print-
reports unity8
| Changed in canonical-devices-system-image: | |
| status: | Fix Committed → Fix Released |
| Pat McGowan (pat-mcgowan) wrote : | #23 |
Per comment #17 this is not fully fixed
| Changed in canonical-devices-system-image: | |
| milestone: | ww46-2015 → ww02-2016 |
| status: | Fix Released → Confirmed |
| no longer affects: | webbrowser-app (Ubuntu) |
| Changed in canonical-devices-system-image: | |
| importance: | Critical → High |
| Changed in canonical-devices-system-image: | |
| milestone: | ww02-2016 → none |
| Changed in canonical-devices-system-image: | |
| milestone: | none → backlog |
| Bill Filler (bfiller) wrote : | #24 |
still seeing this issue on krillin, and it's very easy to reproduce:
1) launch a few apps, system-settings, messaging-app, address book
2) put phone to sleep
3) send a text message to the phone or recv some other kind of notification (gmail, telegram, etc)
Expected Results:
- phone screen turns on for notification and then goes back sleep in some seconds
Actual Results:
- phone screen turns on for notification and never goes back to sleep
| Changed in unity-system-compositor (Ubuntu): | |
| importance: | Undecided → High |
| Changed in unity8 (Ubuntu): | |
| importance: | Undecided → High |
| Bill Filler (bfiller) wrote : | #25 |
It's very easy to reproduce now. Just run an app that requests the screen to stay on, in my case ubuntu-
Steps to reproduce:
- launch the app
- press the power button to lock the phone/dim the screen
- now send a text message to the phone
Expected results
- screen turns on for notification, then goes black after timeout
Actual results:
- screen turns on for notification then stays on
Seems to happen even if you move the app to the background before turning off the screen.
Whenever the screen is locked or hte app is moved to the background we should remove the lock that is causing the screen to stay on.
| Bill Filler (bfiller) wrote : | #26 |
| Bob Harvey (bobharvey) wrote : | #27 |
M10 tablet, OTA13
I had not seen this problem until I installed OTA13.
Now my screen never blanks.
I pretty much only use the web browser app.
| Alexandros Frantzis (afrantzis) wrote : | #28 |
Bob, could you please attach /var/log/
| Pat McGowan (pat-mcgowan) wrote : | #29 |
The original report for the browser was closed some time ago so I suggest we need a new bug.
Per comment #27 this may be a new behavior with the new repowered in ota13. (I added lp:1630986)
Per comment #25 I think this is actually functioning as intended, if an app sets display on and is an active app we honor it. What is missing IMO is any indication that this is the state of the display. Also would be nice to add display on to the app permissions controlled via settings.(lp:1630989)
| no longer affects: | qtmir (Ubuntu) |
| no longer affects: | unity-system-compositor (Ubuntu) |
| Changed in canonical-devices-system-image: | |
| status: | Confirmed → Fix Released |
| no longer affects: | unity8 (Ubuntu) |

phablet@ ubuntu- phablet: ~$ sudo powerd-cli list Unity.Screen, Owner: :1.13, State: 1
[sudo] password for phablet:
System State Requests:
Name: com.canonical.
Name: active, Owner: :1.75, State: 1