Sometimes devices don't suspend - display turns back on immediately

Bug #1549701 reported by Jean-Baptiste Lallement
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Stephen M. Webb
Mir
Fix Released
High
Andreas Pokorny
0.21
Fix Released
High
Andreas Pokorny
mir (Ubuntu)
Fix Released
High
Andreas Pokorny
unity-system-compositor (Ubuntu)
Confirmed
Undecided
Alexandros Frantzis
unity8 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

current build number: 267
device name: krillin
channel: ubuntu-touch/rc-proposed/bq-aquaris.en

it happens also on arale.

sometimes the screen lock timeout is not honoured and the devices don't suspend when the lock timeout expires (display doesn' t turn off)

$ sudo powerd-cli list
[sudo] password for phablet:
System State Requests:
  Name: com.canonical.Unity.Screen, Owner: :1.14, State: 1

Steps to reproduce on arale:

1. Turn on the screen
2. Touch the circular touch button at the lower part of the device
3. Press/release the power button to turn off screen
4. Release the circular touch button

Expected results: The screen turns off and further on/off cycles work properly
Actual results: The screen stays on and attempts to turn it off fail

The touchscreen is handling the circular button and emits a key down event. When turning the screen of the touch screen device is turned off too. Mir is not aware of the touchscreen being off. So meanwhile the repeat handling kicks in and emits key events. This makes USC turn the screen back on again.
The touchscreen driver does not notice that the circular button is still held. So still no release event is sent.

We could fix this by:
- fixing the touchscreen driver to release any touch contacts or buttons pressed, when the device is turned off (something the bluetooth stack seems to do on some devices)
- sidestep the problem by making usc only react to press events as a wake trigger and make repeat and release events only reset the inactivity timer
- give mir the knowledge that the disabled output also disables the touchscreen (a connection we need to be aware of to get the mapping of touch screen coordinates onto scene coordinates right), hence remove the device and thus turn of any repeat key handling attached to that device.

Related branches

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Changed in canonical-devices-system-image:
assignee: nobody → Michał Sawicz (saviq)
status: New → Confirmed
Revision history for this message
kevin gunn (kgunn72) wrote :

adding u-s-c as I'm not sure unity8 will even be involved here

Changed in unity-system-compositor (Ubuntu):
assignee: nobody → Alexandros Frantzis (afrantzis)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Is there an app running (perhaps in the background) that's keeping the screen on?

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

setting to incomplete. It didn't happen on recent builds.

Changed in canonical-devices-system-image:
status: Confirmed → Incomplete
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

It happened again this morning on arale rc-proposed 260.

The only apps started after last reboot nearly 3 hours ago are dekko and the calculator.

Changed in canonical-devices-system-image:
importance: Undecided → High
status: Incomplete → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Actually what happens today is I press the power button to suspend the device, and the screen immediately turns back on.

summary: - Sometimes devices don't suspend
+ Sometimes devices don't suspend - display turns back on immediately
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

list of running processes.

No app is running (at least nothing visible in the spread)

Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
assignee: Michał Sawicz (saviq) → Stephen M. Webb (bregma)
Changed in canonical-devices-system-image:
milestone: none → ww08-2016
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I entered bug #1552371 which could be related especially given the report that a key event had occurred at the time.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

With the help of Jean-Baptiste I was able to get some more information from a device exhibiting the problem.

The logs indicate that the phone is continuously receiving repeat key events (scancode=125=left-meta) from the touchscreen input device. These events are keeping the device awake.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

This seems to be another instance of bug 1550050, which involves the Mir input subsystem sending key repeat events event after an input device disappears. In this case the repeated key is the circular touch key at the bottom of the MX4 (which is sent as left-meta). A fix for this is included in the upcoming Mir 0.20.2 release.

I have added steps to reproduce this on MX4 in the description.

description: updated
Changed in mir (Ubuntu):
assignee: nobody → Andreas Pokorny (andreas-pokorny)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

The only difference to the mentioned lp:#1550050 is that the device is not "removed" during suspend, which I suspect was fixed in lp:mir and will be included in 0.21.0 - this together with the fix for #1550050 should solve that problem.

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

We need a different solution here since we never stop reading from the the touchscreen when the screen is off. Instead the hardware is turned off so it never sends a release..

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

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

Changed in unity-system-compositor (Ubuntu):
status: New → Confirmed
Changed in unity8 (Ubuntu):
status: New → Confirmed
Changed in canonical-devices-system-image:
milestone: ww08-2016 → 11
Changed in mir:
assignee: nobody → Andreas Pokorny (andreas-pokorny)
status: New → In Progress
milestone: none → 0.22.0
Changed in mir:
importance: Undecided → High
tags: added: display-control
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.2 KiB)

This bug was fixed in the package mir - 0.21.0+16.04.20160330-0ubuntu1

---------------
mir (0.21.0+16.04.20160330-0ubuntu1) xenial; urgency=medium

  [ Alberto Aguirre ]
  * New upstream release 0.21.0 (https://launchpad.net/mir/+milestone/0.21.0)
    - ABI summary:
      . mirclient ABI unchanged at 9
      . mirserver ABI unchanged at 38
      . mircommon ABI unchanged at 5
      . mirplatform ABI unchanged at 11
      . mirprotobuf ABI unchanged at 3
      . mirplatformgraphics ABI unchaged at 8
      . mirclientplatform ABI bumped to 5
      . mirinputplatform ABI unchanged at 5
    - Enhancements:
      . New display enumeration API
      . Added Android diagnostic tests to assist during porting to
        new devices
      . Added mir_demo_client_camera: a Video4Linux2 client
    - Bugs fixed:
      . Sometimes devices don't suspend - display turns back on
        immediately (LP: #1549701)
      . Mir crashed with exception 'failed to add sync point to command
        buffer' (LP: #1554635)
      . Mouse cursor is unusably slow in Unity 8 with a 1000Hz mouse
        (LP: #1539009)
      . Packaged mir_unit_tests binary is not suitable for general use
        (LP: #1547015)
      . [regression] Mir stops receiving input after a pause/resume
        cycle (LP: #1548989)
      . NBS (--nbuffers=0) causes software clients to crash with
        std::exception::what: Failed to mmap buffer 13, "Permission denied")
        (LP: #1550432)
      . Fullscreen clients freeze when using NBS with multiple monitors
        (LP: #1551536)
      . [ FAILED ] DisplayConfigurationTest.output_position_is_independent_of_
        orientation (LP: #1552065)
      . The server-side use of MIR_SOCKET is confusing (LP: #1290345)
      . [regression] FTBFS with -DMIR_LINK_TIME_OPTIMIZATION=on
        -Duse_debflags=on (LP: #1350343)
      . Mir On X (mesa-x11) keeps receiving mouse movement events even
        when not focused (LP: #1528110)
      . x11 platform: mouse cursor moves strange (LP: #1546324)
      . Cross compiling to wily/vivid doesn't work (LP: #1549152)
      . Rendering stutters when a new client establishes a connection
        (LP: #1549359)
      . 'mir_demo_server --test-client' crashes (SIGSEGV) when client
        dies (LP: #1555620)
      . [testfail] CI failure: TestClientInput.client_input_config_request_
        receives_all_attached_devices (LP: #1555708)
      . [regression] Mir FTBFS when MIR_ENABLE_TESTS=no (LP: #1556080)
      . Mir-on-X11 doesn't exit (until it gets an event) (LP: #1556210)
      . InputPlatformProbe.x11_platform_found_and_used_when_display_connection_
        works breaks with old input drivers present (LP: #1543049)
      . [regression] MIR_CLIENT_PERF_REPORT is missing window/surface
        names (LP: #1546933)
      . Installed binaries fail to run with mir_demo_server --test-client XXXX
        (LP: #1556160)
      . mir_demo_server --test-client [mir_demo_client_scroll|
        mir_demo_client_flicker] fails (LP: #1556205)
      . The contents of debian/mir-demos.examples are out of date and useless
        (LP: #1557446)

  [ CI Train Bot ]
  * No-change rebuild.

 -- Alberto Aguirre <alberto.aguirre@can...

Read more...

Changed in mir (Ubuntu):
status: Confirmed → Fix Released
Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.22.0

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.