Mir

Mir's Android Input implementation has wake-locks stubbed out

Bug #1465514 reported by Daniel van Vugt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Invalid
Medium
Daniel van Vugt

Bug Description

Correct use of wake locks is very important to keeping responsiveness high, and the kernel awake when you need it (e.g. processing input events). Unfortunately in Mir we seem to have stubbed out this functionality, which will hurt our input latency:

grep -ir 'wake_lock' 3rd_party/
3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp:#define acquire_wake_lock(lock, id) {}
3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp:#define release_wake_lock(id) {}

I can understand why -- because wake locks in the form Android has them do not exist outside of Android kernels. Mainline kernels use something different. But using nothing at all is bad for performance.

Related branches

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The implementation on Android seems pretty simple:

https://android.googlesource.com/platform/hardware/libhardware_legacy/+/master/power/power.c

Exported via libhardware?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I vaguely recall our client-side input logic needed fixing for this too. We were signalling from the client library that input event handling was completed before it even began. I assume we need to fix that too, to get the duration of the wake lock right in the server.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Similarly: bug 1388490

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Attached a branch that attempts to solve the problem by re-introducing wake locks. Not seeing any measurable benefit from it yet though.

Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

I'm guessing we stubbed them out because there is another mechanism to keep CPU/display awake. What does tvoss say about this?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

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

Changed in mir:
status: New → Fix Committed
Changed in mir:
status: Fix Committed → Triaged
importance: Undecided → Medium
Changed in mir:
status: Triaged → In Progress
assignee: nobody → Daniel van Vugt (vanvugt)
milestone: none → 0.14.0
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I don't understand why anyone thinks this valid. We've taken some code from a context in which wakelocks (presumably) made sense and used it in a context where they don't. That's a feature not a bug.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

There is absolutely no need for MIR to acquire wakelocks ever. Wakelocks are a suspend prevention mechanism which in Ubuntu Touch is taken care of by powerd.

The user is already interacting with the screen in any case so the system will not be suspending during interaction.

In android the EventHub is a background service hence the wakelocks.

Changed in mir:
status: In Progress → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. In future please keep an eye out for bug reports so that you can make comments in the bug before fixes are proposed.

Changed in mir:
milestone: 0.14.0 → none
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.