Take advantage of CHRE (co-processor) to significantly reduce power consumption

Modern Android system supports CHRE (Context Hub Runtime Environment) to run nano app on co-processor for long-running sensor-related task, to let application processor (CPU) to keep sleeping in the process. Google already takes advantage of CHRE to implement low-latency and power-saving Activity Recognition in Google Play services. This is a perfect match for Sleep as Android, and could potentially help to reduce power consumption in an order of magnitude.

At the beginning, only Google Pixel phones support CHRE (since Pixel 1). As the platform matures, more and more OEMs join. Now even my wife’s sub-$300 Xiaomi 9 SE also supports CHRE.

Please consider support sensor data collection procedure (and even mic recording, which is supported since CHRE v1.2) running on CHRE. This will also enable potentials for other new features in the future, such as auto-detection of sleeping (without much battery consumption).

FYI: https://android.googlesource.com/platform/system/chre/

You can confirm the CHRE support on your device with this ADB command: dumpsys contexthub
(If nothing shows up, then your device does not support CHRE)

6 Likes

@oasisfeng, just tried this and got the result

C:\adb>adb shell dumpsys contexthub
Dumping ContextHub Service

=================== CONTEXT HUBS ====================

=================== NANOAPPS ====================

C:\adb>

Does this mean that the device does not support CHRE?

It means CHRE is not supported on your device/ROM.

Interesting, I think we have to look into this. I’m wondering how is the mic support done…

FYI: https://android.googlesource.com/platform/system/chre/+/refs/heads/master/chre_api/include/chre_api/chre/audio.h