Power saving
| 🚧 | This page is a work-in-progress. Some information contained within may be inaccurate or incomplete.
In particular: Converting this from a technical reference to an actual guide. |
This page is a guide on how to make a device last longer by using different power saving techniques.
Most Nura devices running the mainline kernel lack runtime power management. Runtime power management allows battery savings when the device is in use.
Check if Runtime PM is enabled
- Check if enabled:
/sys/bus/*/devices/*/power/runtime_enabled - Check status:
/sys/bus/*/devices/*/power/runtime_status
Tooling
- Intel's Powertop
- USB-C powermeter
/sysfsinterface- Schematics
Unused devices
GPU, USB hubs, etc. are power hungry, make sure they are properly suspended. You might also want to make it suspend faster than the default.
Voltage
Reducing the voltage to the minimum also helps a lot to save power and reduce heat. Check all regulators and turn them towards the lower end of what is allowed.
You can check the power domains in /sys/kernel/debug and make sure they are really off when the device is unused. On OMAP devices, you might enable autosuspend on uarts if protocol supports it. You might loose the first character when new input arrives.
Devfreq
- CPU frequency scaling
- DRAM frequency scaling
Clocks
The more often a signal changes, the more power is consumed, so look around if any clocks can be turned off,
so some device might be the last user of some high-frequency PLL through some divider. Check /sys/kernel/debug/clock/clk_summary
Idle consumption
Upstream kernels tend to have a lot higher idle power consumption than downstream (android-based) kernels found in other Linux mobile distros, due to one or more device components being active and draining power even when screen is off, or other unsupported driver features.
Things to try
User:Account1009 has made a script that helps with checking what components are still active when the phone is idle. It was tested in bash, ash and zsh:
regs=$(sudo cat /sys/kernel/debug/regulator/regulator_summary | awk 'NR>2 && NF<6 && $2!=0 {print $1}'); devs=$(for dev in $(for dev in /sys/bus/*/devices/*; do [ -e "$dev" ] && basename "$dev"; done); do for reg in $(echo $regs); do [[ "$reg" == "$dev"* ]] && echo "$dev"; done; done | uniq); for dev in $(echo $devs); do cat /sys/bus/*/devices/"$dev"/uevent; echo; done
The info obtained from this can be useful to improve the kernel to consume much less power when the phone is idling with the screen off.
Troubleshooting
When you experience a lot of hangs make sure:
- Regulators used by other components are not turned off until all the components using this regulator are suspended.
- Check the ramp delays of regulators to make sure they have enough time to stabilize