9.7 KiB
Power optimization
Battery endurance and deep idle efficiency are first-class design requirements across the kernel, daemons, radios, display, audio, and storage stack in Geminux.
Kernel-level optimizations
Configured in kernel/configs/geminux-mt6797x.config and built into 7.3.5-geminux:
CONFIG_HZ_100=y: 100 Hz tick rate cuts periodic timer interrupt overhead compared to 250 Hz / 1000 Hz kernels while remaining responsive for interactive X11 workloads.CONFIG_RCU_LAZY=y: Batches RCU callbacks during idle periods to extend CPU C-state residency.CONFIG_SUSPEND=y: Enables deep Suspend-to-RAM (mem/deep) viamt6797-spm-sleep(sodi_idle=0 pmic_modes=0 timer_sec=600in etc/modprobe.d/geminux.conf) triggered on Gemini PDA lid close (SW_LID), battery idle timeout, or power button press. Keepingpmic_modes=0avoids assertingMT6351VCOREsleep voltage (0.600 V) while CPU0 remains powered inWFI,spm_enter()bounds silent PCM timer rollovers cleanly without.suspend_again,mtk-eintclears hardware debounce when switching wakeup pins such asSW_LID(EINT5) to edge-sensitive mode, andmtk-pmic-keysreportspm_wakeup_event()on wakeup keypresses.CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y: Uses scheduler utilization feedback (schedutil) across the MT6797X tri-cluster topology instead of staticperformancegovernors. etc/init.d/geminux-hwinit loadsclk-mt6797-mcusysandcpufreq-dtby default (GEMINUX_ENABLE_CPUFREQ="yes"in etc/conf.d/geminux-hwinit) independently of experimental Cortex-A72 bring-up (GEMINUX_ENABLE_A72="no"), enablingpolicy0(221..897 MHz) andpolicy4(325..1209 MHz) frequency scaling andsoc-thermalcooling throttling.mt6797-gate-unused: Loaded at the end ofgeminux-hwinit(GEMINUX_GATE_UNUSED_CLOCKS="yes") to gate ~25 unused bootloader peripheral leaf clocks (unusedSPI,UART,PWM,IRTX,ICUSB,ANC_MD32, etc.) left enabled due toclk_ignore_unusedwhile leaving active display/I2C clocks untouched.- Sensor IR LED gating:
stk3310is blacklisted in etc/modprobe.d/geminux.conf (GEMINUX_ENABLE_SENSORS="no") because its probe unconditionally enables continuous ALS and proximity IR LED polling with no userspace consumer. CONFIG_ZRAM_DEF_COMP_LZ4=ywith2 GiBLZ4zramswap (etc/conf.d/zram-init) andvm.swappiness=100(etc/sysctl.d/99-geminux-power.conf): avoids slow, power-hungry flash swap I/O on eMMC and pairs withcommit=60,noatimemount options (etc/fstab).CONFIG_CRYPTO_AES_ARM64_CE_BLK=ypaired with--allow-discardsin initramfs: runs optional LUKS2dm-crypt(aes-xts-plain64) encryption using ARMv8 hardware AES Cryptography Extensions with negligible battery overhead.
Zero-poll userspace daemons
All background system services avoid wake-up timers and polling loops:
geminux-powerd: Sleeps indefinitely inepoll_wait()over/dev/input/event*(SW_LID,KEY_POWER, keyboard/touch/pointer activity),KOBJECT_UEVENTnetlink (filtered strictly toinput,power_supply, anddrmsubsystems),/run/geminux/powerd.sock, and a lazy-rearmingtimerfd; caches applied CPUfreq/profile state to avoid redundant sysfs and/run/geminux/power-profilerewrites; implements two-stage screensaver dimming and auto-lock/blank or suspend strictly timed from the last active user input (dim_timeout_s/suspend_timeout_s). Before entering/sys/power/state, it unloadsmt6797_consys(and reverse dependentsbtmt6797,radio_mt6797,gnss_mt6797,mac) somt6797_consys_prepare()no longer refuses suspend with-EBUSYand theCONN/VCN*rails power down cleanly; on resume, it uses retry-hardened async CONSYS reload while preserving Bluetoothrfkillsoft-block state and verifiesSW_LIDbefore re-enabling the backlight. In hardware Airplane Mode (Fn+F/geminux-power-ctl airplane on, persisted under/var/lib/geminux/airplane-mode),geminux-powerdkeeps the CONSYS Wi-Fi/BT kernel modules unloaded and places MD1 inAT+CFUN=4flight mode while leavingusb0active.geminux-statusd: Usessignalfd(SIGUSR1),RTMGRP_LINKnetlink, filteredKOBJECT_UEVENT(power_supplyandnetonly),inotify, and a minute-alignedtimerfd; deduplicates rootWM_NAMEupdates (XStoreName) sodwmnever repaints when the bar text is unchanged, with zero child shell forks.- Display & terminal idle efficiency: 10-geminux-gpu.conf uses
AccelMethod "none"+ShadowFB "true"+TearFree "true"for rotatedSSD2092scanout, avoiding Glamor fence spin-waits, andstdisables its cursor-blink timeout when unfocused so idle XLibre CPU usage remains near0%. geminux-touchd: Event-driven XInput 2.2 multi-touch gesture recognizer with zero polling loops.geminux-ccci-daemon,geminux-modem-ctl&geminux-imsd: Event-drivenepoll_wait()over/dev/ccci_*, filteredccciuevents, AT port,/run/geminux/imsd.sock, SIP/ESP sockets, and netlink; enter completely idle sleep when no modem activity is pending, andgeminux-imsdarms its 20 ms RTPtimerfdstrictly during active calls.geminux-bt-obex,geminux-leds&geminux-lock: Event-driven GLib/GDBus andepoll_wait()+KOBJECT_UEVENTcontrol without periodic polling.geminux-ledskeeps the back AW9120 cover strip (rgb:indicator-1..5) off (0 mA) when idle or at 100% charge, lighting onlyrgb:indicator-6during active battery charging unless manually overridden.geminux-lockuses a15 srefresh interval once input is grabbed and redraws only when clock minute/date or battery status changes.
Cluster gating and profiles
geminux-power-ctl (and geminux-control) switches between three profiles managed in src/geminux-daemons/geminux-power-policy.c:
| Profile | Governor | A72 big cores (cpu8..9) |
A53 LL (policy0) / L (policy4) max freq |
Battery idle (dim -> lock+suspend) | AC idle (lock+blank screensaver) |
|---|---|---|---|---|---|
eco |
schedutil |
Offline (0) |
624 MHz / 832 MHz |
60 s -> 180 s |
180 s |
balanced |
schedutil |
Online (1) |
806 MHz / 1092 MHz (bat), 897 MHz / 1209 MHz (AC) |
120 s -> 300 s |
300 s |
performance |
schedutil |
Online (1) |
1547 MHz / 1846 MHz (clamped to DT cpuinfo_max_freq) |
180 s (lock+blank, no suspend) |
600 s |
All idle thresholds above are measured from the last active keyboard, touchscreen, pointer, or lid-open event (CLOCK_MONOTONIC) and are not reset by periodic battery power_supply uevents.
Closing the Gemini PDA clamshell (SW_LID = 1) suspends immediately to RAM (mem), unless inhibited by an active voice call (inhibit add call), an explicit inhibitor, or a connected external HDMI monitor (SiI9024).
Audio, radios, and storage defaults
- Audio: PipeWire uses
default.clock.min-quantum = 1024andquantum = 2048(10-geminux-power.conf); WirePlumber suspends idle ALSA and BlueZ nodes after3seconds (50-geminux-suspend.conf) so audio DSP clocks gate quickly. - Bluetooth: BlueZ disables automatic adapter enable and fast page scan (
AutoEnable = false,FastConnectable = falsein etc/bluetooth/main.conf), andgeminux-hwinitrunsrfkill block bluetoothafter loadingbtmt6797; users toggle Bluetooth on demand viageminux-net. - Wi-Fi & NTP: NetworkManager configures
wifi.powersave = 2(10-geminux-power.conf) to keep CONSYS Wi-Fi awake while associated so GTK rekeys, ARP, and DNS never stall;geminux-powerdpowers down CONSYS cleanly across system suspend. etc/chrony/sources.d/10-geminux.sources caps NTP pool peers (maxsources 2) and lengthens polling (minpoll 10 maxpoll 14), paired with an offline hook ondown|vpn-downin 30-geminux-chrony. - GTK / XSETTINGS / D-Bus: etc/profile.d/10-geminux-env.sh exports
NO_AT_BRIDGE=1so GTK3/webarchynever auto-activate AT-SPI accessibility bridge daemons, andgeminux-sessionrunsxsettingsdas an event-driven X11XSETTINGSselection daemon (SIGHUPon theme switch) with zero polling timers. - Storage:
noatime,commit=60inetc/fstabalongsidevm.dirty_writeback_centisecs=1500reduces eMMC write amplification and wakes; microSD mounts at/media/sdcardlikewise mount withnoatimeand rely purely oneudevhotplug events (95-geminux-sdcard.rules) with zero background polling when idle or empty.
Auditing on device
Run the bundled C11 audit utility at any time:
geminux-power-audit
geminux-power-audit --json
It prints the live power profile, battery capacity/voltage/current, online CPU count (including A72 cluster gating status), CPUfreq governor, policy0/policy4 max frequency caps, Bluetooth rfkill soft-block status, ZRAM compression algorithm, and supported /sys/power/mem_sleep modes. Live idle current draw and multi-hour standby battery endurance benchmarks must be measured on physical Gemini PDA (x27) hardware after flashing.