suspends during video playback when USB gets unplugged

Bug #1602933 reported by Selene ToyKeeper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
kevin gunn
repowerd
Fix Released
High
Alexandros Frantzis

Bug Description

As of yesterday's phone images (2016-07-12, krillin rc-p 383, arale rc-p 376, when repowerd landed), I'm getting unusual behavior during automated tests. This is easiest to see, manually, with video playback.

Steps to trigger this issue:
* Flash the affected image.
* Put a video on the device, at least 2 minutes long.
* Start video playback. Symptoms seem most severe when played via "adb shell" with "ubuntu-app-launch mediaplayer-app file:///media/phablet/3562-3231/Videos/long-video.avi".
* Wait at least 60 seconds.
* Unplug USB.

Expected result: Phone stays active until video playback completes.

Actual result: Phone suspends after a few seconds. Depending on how the video was started, sound may or may not continue playing.

Playing a video from inside the video scope (without launching mediaplayer-app) results in sound but no visuals. Playing it with mediaplayer-app at a command line (like the automated tests do) results in a full suspend with no sound.

I'm getting similar behavior during other automated tests too. What happens is, roughly:
* USB connect.
* Reboot.
* Adt runs to set up the device. This takes a few minutes.
* USB disconnect.

At this point, what should happen is:
* If the current app has no "keep screen on" state, the screen should dim after 50 seconds then shut off after another 10 seconds. Otherwise, the screen should stay on until the "keep screen on" state is cleared. (adt sets this state sometimes to allow testing power with the display on, or it should also stay on until the video finishes)
* Measurements start after a while, and continue for a pre-determined length of time.

What actually happens instead:
* A few seconds after USB gets unplugged, the screen turns off. If music isn't playing, the phone also goes into suspend mode. The "keep screen on" state appears to be ignored, and the user's screen-off delay setting appears to be ignored too. No 50-seconds-then-dim-then-10-seconds-then-off happens.
* Measurements happen at the expected times, but the phone isn't in the expected state so the results are wrong.

An additional oddity: If I start a video with USB unplugged, it will continue playing indefinitely. However, if I plug in USB during playback the video stops after a few seconds. Or if I simply plug/unplug USB while the phone is idle, the screen comes on but turns off again after a few seconds instead of the configured delay time. Pretty much any USB event seems to cause screen-off after a few seconds.

Will attach comparison measurements below. In the graphs, the red areas indicate when USB was connected. Non-red areas mean USB was unplugged. Green areas are the part of the measurement which "counts" for test purposes.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Top image: Normal power behavior after unplugging USB. Display dimming and shutoff clearly visible, timed to match the user's preferences in USS.

Bottom image: New behavior with repowerd. Display turns off very quickly.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Top image: Normal power behavior when adt is instructed to keep the screen on (forever).

Bottom image: New behavior with repowerd; adt's permanent screen-on mode is ignored.

description: updated
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Top image: Expected power behavior during video playback. After USB is unplugged, the video continues playing.

Bottom image: New behavior with repowerd. Video playback stops within seconds of unplugging USB and phone enters suspend mode.

description: updated
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Hmm, it apparently fails with youtube videos too. I hadn't tried it until now. A few seconds after unplugging, the screen went off. A few seconds after that, sound stopped.

Changed in canonical-devices-system-image:
milestone: none → 13
importance: Undecided → High
status: New → Confirmed
assignee: nobody → kevin gunn (kgunn72)
Changed in repowerd:
status: New → Confirmed
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Alexandros Frantzis (afrantzis)
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

This appears to be fixed in the latest silo:
https://requests.ci-train.ubuntu.com/#/ticket/1790

Both manual and automated tests behaved as expected, the same as the older powerd aside from turning the screen off sooner in cases where screen-off is appropriate.

The important part is that the keep-display-on flag seems to be respected now.

Changed in repowerd:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Changed in repowerd:
status: Fix Committed → 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.