Repowerd

repowerd is Ubuntu Touch’s power management daemon and handler for common functionality like Double-Tap-To-Wake. Like many other components of the Operating System it can be configured for the device in its deviceinfo.yaml configuration, including quirks that are specific to a certain set of devices, SoCs, etc.

Script-based performance booster

repowerd features an interesting performance boost mechanism called the ScriptPerformanceBooster. This performance booster allows a port maintainer to set CPU and GPU frequency scaling, adjust suspension behavior on devices without Opportunistic Autosuspend, and further kernel tweaks based on screen-on state and interactivity. This allows a device maintainer to implement sophisticated performance boosting strategies, enable suspension of user processes and services, and more. For example, this is also used on the JingPad A1 to implement freezing and thawing of user processes when the device is supposed to go into suspension, which it cannot natively do on its kernel with vendor-provided drivers.

Overview of all repowerd keys:

<devicename>:
  BacklightSysfsPath: </path/to/the/device>
  DoubleTapToWake:
    - </path/to/node>|<enable>|<disable>
    - ...

Device quirks

Key

Description

Value(s)

BacklightSysfsPath

File path to backlight device

File path

DoubleTapToWake

Configuration for toggling DT2W

List of formatted strings: <path>|<enable>|<disable>

RepowerdScriptPerfBoostLowPower

Command to execute when going into suspension

A regular binary or script executed via system(value), like: /opt/halium-overlay/boost-script.sh --low-power

RepowerdScriptPerfBoostScreenOff

Command to execute when turning screen off

Similar, like: /opt/halium-overlay/boost-script.sh --screen-off

RepowerdScriptPerfBoostSustained

Command to execute for setting screen-on policy

Similar, like /opt/halium-overlay/boost-script.sh --sustained

RepowerdScriptPerfBoostInteractive

Command to execute for user input/interactivity pulses

Similar, like /opt/halium-overlay/boost-script.sh --interactive

Examples

Device sample using:

  • Custom backlight sysfs path to disable autodetection of the path controlling the backlight

  • Double Tap to Wake (DT2W) configuration to allow double tapping to wake the device, specifing two potential paths
    • It is allowed to specify multiple entries, invalid or non-existant paths will be removed

  • ScriptPerformanceBooster set up to run scripts on screen-on and -off events

Config file:

$ cat /etc/deviceinfo/devices/sample.yaml
sample:
  BacklightSysfsPath: /sys/class/backlight/panel0-backlight
  DoubleTapToWake:
    - /proc/touchpanel/double_tap_enable|1|0
    - /sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input1/wake_gesture|on|off
  RepowerdScriptPerfBoostScreenOff:
    - /opt/halium-overlay/perf-scripts/screen-off
  RepowerdScriptPerfBoostSustained:
    - /opt/halium-overlay/perf-scripts/sustained