diff --git a/AGENTS.md b/AGENTS.md index e38b1d6..f8d8f6f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,10 +23,11 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, ` - Run `./scripts/check-rebuild.sh`, relevant `scripts/test-*.py` tests, `./scripts/sync-prebuilt-overlay.sh --check`, and `git diff --check` before claiming a source, artifact, docs, or release change is complete. - Cross-compile inside rootless Docker. Main builders are `scripts/build-sxmo-x11.sh`, `build-dmenu.sh`, - `build-bananarchy-daemons.sh`, `build-kernel-audio.sh`, `build-lk2nd-beatles.sh`, `build-games.sh`, + `build-dwm-plugins.sh`, `build-bananarchy-daemons.sh`, `build-kernel-audio.sh`, `build-lk2nd-beatles.sh`, `build-games.sh`, `build-fcitx5-t9.sh`, and `build-xlibre.sh`. -- Use `scripts/build-dmenu.sh` for dmenu-only changes. Do not run a full `build-sxmo-x11.sh` casually: the shipped `dwm` - binary contains cover IPC strings absent from source, so a full rebuild drifts `dwm`; restore or reconcile it. +- Use `scripts/build-dmenu.sh` for dmenu-only changes and `scripts/build-dwm-plugins.sh` for NeoUI/plugin rebuilds. Do + not run a full `build-sxmo-x11.sh` casually: the shipped `dwm` binary contains cover IPC strings absent from source, + so a full rebuild drifts `dwm`; restore or reconcile it. - Rootfs/image tools are `scripts/bootstrap-rootfs.sh`, `scripts/apply-bananarchy-overlay.sh`, `scripts/compile-gsettings-schemas.sh`, `rebuild-image.sh`, `scripts/sync-beatles-bootfs.py --check`, `prepare-release.sh`, and `flash-edl.sh`. @@ -102,13 +103,16 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, ` - The shipping cover backend is `backend = kernel`: keep `bananarchy-cover-dpms.sh reinit`, the gpio13 mux claim, the centered 240x240 X11/`/dev/fb0` cover frame, the 1 s repaint against Xorg, `kernel_backlight_invert = 0`, `kernel_internal_sleep = 0`, `kernel_backlight_level = 14`, shared **Config -> Screen blank** timeout reload, - `scripts/test-cover-kernel.py`, and the `spidev`/`fb`/`none` rollback backends. + closed-flip `CALL` cover UI (`cover_hold_awake`, `BUTTON VOLUP`/`VOLDOWN` -> `mute-ring`, `BUTTON POWER` -> `hangup-call`, + delayed `CALL muted` guard), clean `SIGTERM` cover blanking, live timezone refresh (`ba_refresh_tz` / `REFRESH`), + `scripts/test-cover-kernel.py`, `scripts/test-time-timezone-sync.py`, and the `spidev`/`fb`/`none` rollback backends. The daemon must restore the internal panel on `LID OPEN` even after a stale high gpio13 survives a restart. - Keep the 2720 Flip lid handling event-driven and instant: sticky hall state, immediate hall re-read on `EV_SW` edges, 20 ms debounce, `SW_LID` mirroring (`sync_sw_lid`) so `dwm` tracks the hall sensor, and synchronous lid-state/lock/backlight/DPMS writes in `bananarchy-lid.c`. Closing locks - the desktop; opening must keep the lock flag and wake to the passcode lockscreen, never auto-unlock. Every - main-panel wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover. + the desktop; opening must keep the lock flag and wake to the passcode lockscreen (never auto-unlock) while sending + `RAISE` to `callscreen` and keeping `sxmo_hook_lock.sh` / `locker.so` from hanging up incoming/active calls (`UNGRAB`). + Every main-panel wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover. `sxmo_state.sh set unlock` is gated too because `dwm` calls it directly. `apply-bananarchy-overlay.sh` writes `/usr/share/bananarchy/lid-profile` per target (`slider` on `nokia-argon`, `flip` on `nokia-beatles`, `none` elsewhere) and disables `bananarchy-{lid,cover-display,volume-keys}`, cover udev/config, and mux modprobes on @@ -121,8 +125,8 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, ` recovery-mode 2720 boots need Volume Up. Keep the signed per-device Firehose programmers and do not mix them. - Keep first-boot access intact: `keys/phone_id_ed25519.pub` for `user`/`root`, PAM/sshd configs, USB-only SSH fallback, keypad udev/Xorg rules, BusyBox applet lists, and `scripts/set-bananarchy-hostname.sh`. -- The Power menu label is **Reboot to loader** and still calls `sxmo_power.sh bootloader`. Keep the compact label in - `dmenu.c`, `dmenu.so`, `sxmo_appmenu.sh`, and the context-menu hook. +- The Power menu label is **Reboot to loader** and still calls `sxmo_power.sh bootloader`; `Logout` is removed from + `dmenu.c`, `dmenu.so`, `sxmo_appmenu.sh`, and `sxmo_hook_contextmenu.sh`. Keep the compact Power menu layout synchronized. - Bluetooth HOGP config and plugin load are verified, but full hardware sign-off still needs a wake-up paired keyboard and **Connect Device** to confirm real HID key events. diff --git a/BATTERY-OPTIMIZATION-ANALYSIS.md b/BATTERY-OPTIMIZATION-ANALYSIS.md index 7e05342..bed9ecc 100644 --- a/BATTERY-OPTIMIZATION-ANALYSIS.md +++ b/BATTERY-OPTIMIZATION-ANALYSIS.md @@ -1287,17 +1287,20 @@ display controller active continuously without `CONFIG_SUSPEND`: `ci_ulpi_resume()`'s `ULPI_SYNC_STATE` viewport poll when `CI_HDRC_OVERRIDE_PHY_CONTROL` is set so cable hotplug resumes cleanly before `CI_HDRC_CONTROLLER_RESET_EVENT` powers the ULPI PHY. -4. **Default dual-port `MODEM_DRX_MODE=6` and dark-screen `dsds-daemon` sleep**: - `bananarchy-power-policy.conf` defaults to `MODEM_DRX_MODE=6` while keeping - `DSDS_SECONDARY_MODE=active` so both SIMs stay reachable; - `msm-modem-uim-selection` adds `at all` multi-port support and `screen_is_idle()` - in `dsds-daemon` (`poll_timeout = None` whenever locked, cover-lit, or - backlight off); and `bananarchy-power-policy.sh` serializes AT port access - with `flock`, waits past `ModemManager`'s startup port probe at boot, and - re-applies `AT$QCDRX=6` across all `/dev/wwan0at*` ports on `modem-ready` +4. **Dual-port `AT$QCDRX` infrastructure and dark-screen `dsds-daemon` sleep + (`MODEM_DRX_MODE=0` safe shipping default)**: + `bananarchy-power-policy.conf` defaults to `MODEM_DRX_MODE=0` while keeping + `DSDS_SECONDARY_MODE=active` so both SIMs stay reachable via MPSS's native + DSDS paging scheduler (`Slot 2` UMTS + `Slot 1` GSM) without competing with + `ModemManager` (which holds both `/dev/wwan0at0` and `/dev/wwan0at1` open); + `6-9` remain opt-in. `msm-modem-uim-selection` adds `at all` multi-port + support and `screen_is_idle()` in `dsds-daemon` (`poll_timeout = None` + whenever locked, cover-lit, or backlight off); and + `bananarchy-power-policy.sh` serializes AT port access with `flock` and + applies `AT$QCDRX` across `/dev/wwan0at*` ports on `modem-ready` (`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch - registration) with per-port devtmpfs inode caching in - `/run/bananarchy-power-policy/drx.`. + registration) when `MODEM_DRX_MODE != 0`, with per-port devtmpfs inode + caching in `/run/bananarchy-power-policy/drx.`. 5. **MIPI DCS `DISPOFF` + `SLPIN` on `panel-mipi-dbi` DPMS off**: `panel_mipi_dbi_disable()` sends `0x28` (`msleep(20)`) and `0x10` (`msleep(50)`) under `drm_dev_enter()` after `backlight_disable()`, halting @@ -1438,12 +1441,12 @@ vMPM timer programming or last-man L2 SAW2 shutdown. fixes SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked L2 readback guards, guards `qcom_mpm_handler()` against `NULL` `irq_desc` mappings for pre-enabled MPM pins (`49`, `58`, `62`), keeps per-CPU SPM in - `PM_SLEEP_MODE_SPC` even when `l2_sleep=0`, and teaches - `cpuidle-qcom-spm` to enter APSS RPM/vMPM sleep (`rpm_sleep=1`, - `rpm_min_residency_us=3000`) and L2 SAW2 collapse (`l2_sleep=1`, - `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) when the last online CPU enters idle, gated on + `PM_SLEEP_MODE_SPC` even when `l2_sleep=0`, and supports opt-in + `cpuidle-qcom-spm` APSS RPM/vMPM sleep (`rpm_sleep`, `rpm_min_residency_us=3000`) + and L2 SAW2 collapse (`l2_sleep`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) when the last + online CPU enters idle, gated on `/sys/module/cpuidle_qcom_spm/parameters/screen_off` (toggled by - `bananarchy-display-power-sync` and `bananarchy-power-policy.sh`) plus + `bananarchy-display-power-sync` only when `rpm_sleep=Y`) plus `qcom_msm8909_gdsc_is_active()` in `gcc-msm8909.c` so RPM/L2 collapse never fires while `oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc` or the panel are active, uses `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` to @@ -1478,13 +1481,28 @@ vMPM timer programming or last-man L2 SAW2 shutdown. and `50-device-*.conf` fragments so `blsp1_uart1_apps_clk` no longer holds `gpll0` (`enable_count = 0`). 4. **Runtime policy & telemetry additions (`bananarchy-power-policy.conf` / - `.sh`)**: added `CPU_RPM_SLEEP=1`, `CPU_L2_SLEEP=1`, - `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes unsolicited IPv6 RAs on `wlan0` during - screen-off whenever `wlan0` already holds an IPv4 address, restored on wake), - and opt-in `WIFI_STANDBY_RAT=keep|gsm` (parks QMI NAS mode preference to GSM - after 30 s dark while `wlan0` is `up`, restored on wake), plus `status` - readouts for `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats/*`, and - `/sys/kernel/debug/qcom_rpm_master_stats/*`. + `.sh`)**: added `CPU_RPM_SLEEP=0`, `CPU_L2_SLEEP=0`, and `MODEM_DRX_MODE=0` + safe shipping defaults alongside `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes + unsolicited IPv6 RAs on `wlan0` during screen-off whenever `wlan0` already + holds an IPv4 address, restored on wake), opt-in `WIFI_STANDBY_RAT=keep|gsm` + (parks QMI NAS mode preference to GSM after 30 s dark while `wlan0` is `up`, + restored on wake), plus `status` readouts for `cpuidle_qcom_spm`, + `/sys/kernel/debug/qcom_stats/*`, and `/sys/kernel/debug/qcom_rpm_master_stats/*`. + Live telemetry on a dual-SIM `nokia-beatles` (`2720 Flip`) showed that + with `# CONFIG_SUSPEND is not set`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF` collapsed + L2, SCU, and the APSS GIC while `apss_master_stats` stayed at `Count: 0`; + because `vMPM` does not route internal SoC GIC SPIs (`GIC-0 57 smd-edge`, + `GIC-0 166 ci_hdrc_msm`, `GIC-0 178 wcn36xx_rx`), `L2_OFF` black-holed + closed-flip incoming call interrupts until the flip opened (`gpio36` -> `mpm`) + and delayed USB/Wi-Fi traffic until minute-aligned timers. Meanwhile, + `ModemManager` holds both `/dev/wwan0at0` and `/dev/wwan0at1` open, so + `AT$QCDRX` writes from `bananarchy-power-policy.sh` contended with + `ModemManager`'s AT parser. Keeping `CPU_RPM_SLEEP=0`, `CPU_L2_SLEEP=0`, and + `MODEM_DRX_MODE=0` default preserves `< 0.2 ms` per-core `SPC` (`L2_ON`) + wakeup on every GIC SPI and MPSS native DSDS paging while keeping + `wcn36xx` `screen_off_offload`, IPv6 RA mute, Adreno `0 KB/s` BIMC/GDSC + idle, `wcd-digital` runtime autosuspend, unclaimed PM8909 LDO cleanup, and + `ttyMSM0` disable active. 5. **Compiled C11 autostart daemons (`bananarchy-dsds`, monitors, session)**: replaced `python3 - dsds-daemon`, `sxmo_modemmonitor.sh`, `sxmo_soundmonitor.sh` (`evtest`), `sxmo_notifs.sh monitor` (`inotifywait`), diff --git a/CHANGELOG.md b/CHANGELOG.md index d896e23..1e077ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,16 +20,16 @@ Upcoming release build (`a1114` / `carbonara` via `scripts/version.sh`) targetin - **MSM8909 ICC `-ENXIO`, CPU OPP `schedutil` latency, USB PHY `l13`, and Q6ASM/`VoiceMMode1` fixes (`0011`)**: marked XPU-protected MSM8909 PCNOC nodes (`mas_spdm`, `mas_dehr`, `slv_spdm`, `slv_dehr_cfg`, `slv_qdss_cfg`, `slv_imem_cfg`, `slv_bimc_cfg`) `.qos.ap_owned = true` with `NOC_QOS_MODE_INVALID` in `drivers/interconnect/qcom/msm8909.c` so `qcom_icc_set()` commits bus clocks instead of aborting on `-6`; moved `clock-latency-ns = <100000>` (`<0x186a0>` on `nokia-beatles`) from parent `cpu-opp-table` into all eight `opp-*` child nodes across `qcom-msm8909.dtsi` and all six standalone `devices/` DTS files so `cpuinfo_transition_latency` reports `100 us` instead of `CPUFREQ_ETERNAL` (`6.44 s` `schedutil` rate limit) and converted `qcom-cpufreq-nvmem.c`'s `Failed to set OPP config` log to `dev_err_probe()`; guarded fixed-voltage `pm8909_l13` (`3.075 V`) in `drivers/phy/qualcomm/phy-qcom-usb-hs.c` with `regulator_is_supported_voltage(uphy->v3p3, 3300000, 3300000) > 0`; handled asynchronous `ASM_DATA_CMD_WRITE_V2`/`READ_V2` (`0x10dab`/`0x10dac`) responses in `q6asm.c` without clobbering `ac->result` while routing `ASM_DATA_CMD_EOS` with `ASM_DATA_CMD_REMOVE_TRAILING_SILENCE`; and disabled unrouted `dai-link-multimedia3` in DTS while updating both `/usr/share/q6voiced/q6voiced.conf` and `/etc/conf.d/q6voiced` to `q6voice_device=3` (`hw:0,3`) to match the shifted `VoiceMMode1` PCM index. - **BusyBox applet symlinks, ZRAM swap activation, NetworkManager dispatcher guard, and session cleanup**: added `scripts/busybox-usr-bin-applets.txt` (`53` applets, excluding `pkill`) and `scripts/busybox-usr-sbin-applets.txt` (`23` applets) plus `/bin` additions (`cttyhack`, `kbd_mode`, `vmstat`) in `scripts/busybox-applets.txt` and `scripts/apply-bananarchy-overlay.sh`, updated `/usr/bin/zramstart` to read `MemTotal` from `/proc/meminfo` (with `free -m` fallback) so `/dev/zram0` swap (`580 MB`) activates reliably on boot, guarded `PrimaryConnection`/`Ip{4,6}Config == "/"` in `/usr/lib/NetworkManager/dispatcher.d/50-dns-filter.sh`, synchronized `schedutil/rate_limit_us = 40000` across both non-flip and flip branches of `bananarchy-display-power-sync`, removed remaining `pkill`/`pgrep -f` uses across `bananarchy-x11-session.sh`, `sxmo_hook_start.sh`, and `sxmo_modemaudio.sh`, cleaned `/tmp/at_resp_*.txt` via `trap` in `msm-modem-uim-selection`, and verified zero occurrences across all six error signatures live after reboot on `nokia-argon`. - **Pass 1 + Pass 2 RPM sleep (`vMPM` + L2 SAW2), BIMC PLL / WCD-digital / LDO cleanup, Adreno 304 active-display guard, and UART disable (`0010`)**: - - **Last-man APSS RPM (`vMPM`) and L2 SAW2 standby collapse (`0010`)**: enabled `CONFIG_QCOM_RPM_MASTER_STATS=y`, wired `qcom,mpm` (`sram@60000` sub-slices `0x150`/`0x1d0`/`0x1150`/`0x2150`, TLMM `wakeup-parent`, `qcom,msm8916-rpm-stats`, `rpm-master-stats`) and L2 SAW2 (`power-manager@b012000`, `qcom,msm8909-saw2-v3.0-scu` linked via `l2-cache` `qcom,saw`) across kernel and all six device DTS files; fixed SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked L2 readback guards; guarded `qcom_mpm_handler()` against `NULL` `irq_desc` mappings on pre-enabled MPM pins (`49`, `58`, `62`); gated `cpuidle-qcom-spm` last-man APSS RPM (`rpm_sleep=1`, `rpm_min_residency_us=3000`) and L2 collapse (`l2_sleep=1`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) on both `qcom_msm8909_gdsc_is_active()` (`oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc`) and `cpuidle_qcom_spm/parameters/screen_off` (toggled by `bananarchy-display-power-sync` and `bananarchy-power-policy.sh`) so active displays/GPUs never suffer L2/shared-clock collapse; and switched the next-timer check to `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` (`tick_nohz` warning fixed) with `# CONFIG_SUSPEND is not set` and module `vermagic` unchanged. + - **Opt-in APSS RPM (`vMPM`) and L2 SAW2 standby collapse (`0010`), BIMC PLL / WCD-digital / LDO cleanup, Adreno 304 active-display guard, and UART disable (`0010`)**: enabled `CONFIG_QCOM_RPM_MASTER_STATS=y`, wired `qcom,mpm` (`sram@60000` sub-slices `0x150`/`0x1d0`/`0x1150`/`0x2150`, TLMM `wakeup-parent`, `qcom,msm8916-rpm-stats`, `rpm-master-stats`) and L2 SAW2 (`power-manager@b012000`, `qcom,msm8909-saw2-v3.0-scu` linked via `l2-cache` `qcom,saw`) across kernel and all six device DTS files; fixed SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked L2 readback guards; guarded `qcom_mpm_handler()` against `NULL` `irq_desc` mappings on pre-enabled MPM pins (`49`, `58`, `62`); gated `cpuidle-qcom-spm` opt-in APSS RPM (`rpm_sleep=0`, `rpm_min_residency_us=3000`) and L2 collapse (`l2_sleep=0`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) on both `qcom_msm8909_gdsc_is_active()` (`oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc`) and `cpuidle_qcom_spm/parameters/screen_off` (toggled by `bananarchy-display-power-sync` only when `rpm_sleep=Y`) while keeping per-core SPC (`L2_ON`) active by default so `APSS GIC` never drops internal `smd-edge` modem call wakeups during closed-flip idle; and switched the next-timer check to `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` (`tick_nohz` warning fixed) with `# CONFIG_SUSPEND is not set` and module `vermagic` unchanged. - **Adreno 304 `gfx-mem` interconnect scaling, `qcom_iommu` non-genpd resume/TLB fix, GDSC recovery cycle, WCD-digital runtime PM, and PM8909 LDO seeding (`0010`)**: wired `bimc`/`pcnoc`/`snoc` nodes and Adreno 304 `gfx-mem` interconnect (`MAS_OXILI -> SLV_EBI`) in `qcom-msm8909.dtsi` and all six device DTS files, moved `a3xx_gpu_init()`'s static `icc_set_bw()` into `msm_gpu_pm_resume()` / `msm_gpu_pm_suspend()` (`Bps_to_icc(gpu->fast_rate) * 8` while active, `0` when runtime-suspended so BIMC still drops to `19.2 MHz` XO when idle without starving Adreno 304 during `powersave`/DPMS transitions), guarded blocking `qcom_iommu_map()` calls with runtime PM, saved/restored non-secure context bank registers + `ARM_SMMU_CB_S1_TLBIASID` in `qcom_iommu_resume()` for non-genpd `VDD_CX` SMMUs (`1f08000.iommu`), exposed `qcom_msm8909_gdsc_is_active()` in `gcc-msm8909.c`, added `dev_pm_genpd_synced_poweroff()` + `pm_runtime_put_sync()`/`pm_runtime_get_sync()` in `adreno_recover()` so `oxili_gdsc` resets cleanly on ringbuffer lockups, added `.idle_bias_on = 0` + `REGCACHE_FLAT` + `200 ms` runtime autosuspend (`RUNTIME_PM_OPS`) in `msm8916-wcd-digital.c`, and seeded `vreg->is_enabled = 1` for PM8909 `l14`, `l15`, and `l18` in `qcom_smd-regulator.c`. - - **Disable `ttyMSM0` (`serial@78af000`) and extend runtime power policy**: disabled `serial@78af000` + cleared `chosen/stdout-path` in all DTS files and removed `console=ttyMSM0,115200` from all `kernel-cmdline.conf` and `50-device-*.conf` fragments; added `CPU_RPM_SLEEP=1`, `CPU_L2_SLEEP=1`, `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes unsolicited `wlan0` IPv6 RAs while dark on IPv4 networks, restored on wake), opt-in `WIFI_STANDBY_RAT=keep|gsm`, and `cpuidle_qcom_spm` / `qcom_stats` / `qcom_rpm_master_stats` telemetry to `bananarchy-power-policy.conf` and `bananarchy-power-policy.sh`. + - **Disable `ttyMSM0` (`serial@78af000`) and extend runtime power policy**: disabled `serial@78af000` + cleared `chosen/stdout-path` in all DTS files and removed `console=ttyMSM0,115200` from all `kernel-cmdline.conf` and `50-device-*.conf` fragments; added `CPU_RPM_SLEEP=0`, `CPU_L2_SLEEP=0`, `MODEM_DRX_MODE=0` (opt-in `rpm_sleep`/`l2_sleep`/`AT$QCDRX` while preserving per-core `SPC` `< 0.2 ms` wakeup on `smd-edge` and avoiding `ModemManager` AT port contention), `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes unsolicited `wlan0` IPv6 RAs while dark on IPv4 networks, restored on wake), opt-in `WIFI_STANDBY_RAT=keep|gsm`, and `cpuidle_qcom_spm` / `qcom_stats` / `qcom_rpm_master_stats` telemetry to `bananarchy-power-policy.conf` and `bananarchy-power-policy.sh`. - **Compiled C11 autostart daemons (`bananarchy-dsds` and monitors)**: replaced `python3 - dsds-daemon`, `sxmo_modemmonitor.sh`, `sxmo_soundmonitor.sh` (`evtest`), `sxmo_notifs.sh monitor` (`inotifywait`), `sxmo_run_aligned.sh` (`sxmo_aligned_sleep`), and the `bananarchy-x11-session.sh` tail loop with 0%-CPU compiled C11 ARM ELF binaries (`bananarchy-dsds`, `bananarchy-modemmonitor`, `bananarchy-soundmonitor`, `bananarchy-notifmonitor`, `bananarchy-run-aligned`, `bananarchy-session-loop`) plus thin `exec` compatibility shims, `doas` rule, and `superd` service units, leaving zero Python or `/bin/sh` daemons on autostart; guarded by `scripts/test-dsds-daemon.py` and `scripts/check-rebuild.sh`. - **MSM8909 RPM interconnect bus scaling (`CONFIG_INTERCONNECT_QCOM_MSM8909=y`)**: enabled `CONFIG_INTERCONNECT_QCOM=y`, `CONFIG_INTERCONNECT_QCOM_MSM8909=y`, and `CONFIG_INTERCONNECT_QCOM_SMD_RPM=y`, marked `msm8909_bimc`, `msm8909_pcnoc`, and `msm8909_snoc` `.keep_alive = true` (`19.2 MHz` active floor, `0` in `QCOM_SMD_RPM_SLEEP_STATE`), initialized `qp->bus_clk_rate[*]` to `U32_MAX` in `qnoc_probe()` so `icc_sync_state` clears `clk_smd_rpm_handoff()`'s `INT_MAX` sleep-set vote in RPM, wired `interconnect@400000`, `interconnect@500000`, `interconnect@580000`, `cpus` `interconnects`, and `cpu-opp-table` `opp-peak-kBps` across all six MSM8905/MSM8909 DTS files, and lowered the `199999951 Hz` idle CPU OPP `opp-peak-kBps` floor from `<0xc3500>` (`100 MHz` BIMC) to `<0x25800>` (`153,600 kBps` = `19.2 MHz` XO floor) (`0009`) while preserving `vermagic` across all 580 `.ko.zst` modules. - **Unblock `fw_devlink` `sync_state` (`CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y`) and release unclaimed `clk-smd-rpm` votes (`0009`)**: enabled `CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y` with `fw_devlink` post-init relaxation in `drivers/base/core.c` so driverless `/cpus/cpu@0..3` no longer deadlock `rpmpd_sync_state()` (`VDD_CX`/`VDD_MX` stuck at `SUPER_TURBO`) or `icc_sync_state()`, and added `late_initcall_sync(rpm_smd_clk_late_cleanup)` in `drivers/clk/qcom/clk-smd-rpm.c` to drop active votes on unclaimed `QDSS`/`QPIC` clocks and clear RPM `SLEEP_STATE` boot-handoff votes on all unclaimed clocks without altering `BB_CLK1`/`RF_CLK1` active votes. - **Live WCN3620 screen-off firmware offloads, BET, and `HOST_SUSPEND_IND` (`0008` + `0009`)**: `wcn36xx` now assigns both `hw->max_listen_interval` and `hw->conf.listen_interval` from `listen_interval` (clamped `1..10`, default `5`) before `ieee80211_register_hw()`, and exposes `/sys/module/wcn36xx/parameters/screen_off_offload` (toggled by `bananarchy-display-power-sync`). When screen-off offload is active, `wcn36xx` enables firmware ARP offload (when a single IPv4 address is assigned, preserving DHCP), IPv6 NS offload, GTK rekey offload, `ignore_dtim = true`, `dynamic_ps_timeout = 40 ms`, Beacon Early Termination (`enable_bet = 1`, `bet_interval = listen_interval`), aligned `dtim_period = listen_interval`, `bcast_mcast_filter = 3`, and `WCN36XX_HAL_HOST_SUSPEND_IND` / `HOST_RESUME_REQ` while keeping `rx_irq`/`tx_irq` armed for immediate inbound unicast delivery. - **ChipIdea USB runtime PM and unplugged HS PHY shutdown (`ci_hdrc_msm`)**: enabled `CI_HDRC_SUPPORTS_RUNTIME_PM`, wrapped `ci_hdrc_msm_por_reset()` in `pm_runtime_resume_and_get()`/`pm_runtime_put()`, gated `iface_clk` (`100 MHz`) and `core_clk` (`80 MHz`) via `RUNTIME_PM_OPS` whenever `vbus_extcon` is disconnected, skipped `ULPI_SYNC_STATE` viewport polling in `ci_ulpi_resume()` when `CI_HDRC_OVERRIDE_PHY_CONTROL` is set, and in `0009` added `200 ms` runtime autosuspend on both `ci_hdrc_msm` and `ci_hdrc`, held parent runtime PM across `ci_hdrc_add_device()`, and called `usb_phy_shutdown()`/`usb_phy_init()` across unplugged suspend/resume so `pm8909_l13` (`3.075 V`), `pm8909_l7` (`1.8 V`), and `xo` drop cleanly while preserving USB RNDIS (`172.16.42.1`) hotplug. -- **Default dual-port DSDS `MODEM_DRX_MODE=6` and dark-screen `dsds-daemon` sleep**: `bananarchy-power-policy.conf` now defaults to `MODEM_DRX_MODE=6` while keeping `DSDS_SECONDARY_MODE=active` so both SIMs remain reachable; `msm-modem-uim-selection` adds `at all` multi-port queries and `screen_is_idle()` in `dsds-daemon` (`poll_timeout = None` whenever locked, cover-lit, or backlight off); and `bananarchy-power-policy.sh` serializes AT access via `flock`, waits past `ModemManager`'s startup AT port probe, and re-applies `AT$QCDRX=6` across every `/dev/wwan0at*` port on `modem-ready` (`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch registration) with per-port inode caching in `/run/bananarchy-power-policy/drx.`. +- **Dual-port DSDS infrastructure and dark-screen `dsds-daemon` sleep (`MODEM_DRX_MODE=0` safe shipping default)**: `bananarchy-power-policy.conf` defaults to `MODEM_DRX_MODE=0` and `DSDS_SECONDARY_MODE=active` so both SIMs stay reachable on MPSS's native DSDS scheduler without contending on `ModemManager`'s open `/dev/wwan0at*` ports (opt-in `6-9` supported); `msm-modem-uim-selection` adds `at all` multi-port queries and `screen_is_idle()` in `dsds-daemon` (`poll_timeout = None` whenever locked, cover-lit, or backlight off); and `bananarchy-power-policy.sh` serializes AT access via `flock` and applies `AT$QCDRX` across `/dev/wwan0at*` ports on `modem-ready` (`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch registration) when opted in, with per-port inode caching in `/run/bananarchy-power-policy/drx.`. - **MIPI DCS `DISPOFF` + `SLPIN` on `panel-mipi-dbi` DPMS off and `drm_mipi_dbi.ko.zst` rebuild (`0008` + `0009`)**: rebuilt both `panel-mipi-dbi.ko.zst` (`panel_mipi_dbi_disable()` issuing `0x28` (`msleep(20)`) + `0x10` (`msleep(50)`) under `drm_dev_enter()` after `backlight_disable()` and before `mipi_dbi_pipe_disable()`) and `drm_mipi_dbi.ko.zst` (previously unbuilt in `scripts/build-kernel-audio.sh` and omitted from `rebuild-image.sh` / `apply-bananarchy-overlay.sh`), halting the GC9305/ST7789V boost converter and 60 Hz GRAM scan during DPMS off while preserving the 2720 Flip closed-only `backend = kernel` cover path. - **Unconditional `net/wwan0` BAM-DMUX registration for `ModemManager` and primary-SIM QMI VOICE USSD fallback**: fixed `error: couldn't find modem` when running USSD or `mmcli` operations on Wi-Fi-only setups without a saved `type=gsm` NetworkManager profile. Because `MMPluginQcomSoc` sets `base-modem-data-net-supported = TRUE` and `base-modem-data-tty-supported = FALSE`, `ModemManager` drops `/org/freedesktop/ModemManager1/Modem/0` whenever `net/wwan0` is absent, while `bam-dmux.c` already runtime-suspends after `1000 ms` of inactivity (`pc_state=0`, DMA channels released) at zero standby cost. `etc/init.d/msm8909-modem-wwan-port` and `msm-modem-uim-selection` (`provision_slot()` / `bananarchy-dpm.sh open`) now open `--dpm-open-port=hw-data-ep-type=bam-dmux,...` unconditionally and wait for `/sys/class/net/wwan0` (running `mmcli -S` if opened after `ModemManager` startup), `10-bananarchy-dpm.sh` no longer closes the DPM port on interface `down`, and `msm-modem-uim-selection ussd` resolves `mm_modem` via `mmcli -L` and falls back to direct `AF_QIPCRTR` QMI VOICE USSD (`QMI_SERVICE_VOICE = 9`, `sub = 0`) on the primary SIM alongside `sub = 1` on the secondary SIM. @@ -37,7 +37,8 @@ Upcoming release build (`a1114` / `carbonara` via `scripts/version.sh`) targetin - **2720 Flip event-driven idle daemons and dynamic TLMM `gpiochip` resolution (`nokia-beatles`)**: replaced `bananarchy-lid`'s continuous `20 ms` (`50 Hz`) `poll()` loop, `10 Hz` `/sys/kernel/debug/gpio` full SoC GPIO register dump, and `2 s` `/dev/input` `glob` + `/run/bananarchy/cover.sock` broadcast with `/dev/input` `inotify` watching plus hardware `EV_SW` IRQ sleep (`poll(..., -1)` at `0` steady-state wakeups/s after the `20 ms` edge debounce and one `+2 s` post-transition confirmation check), and synchronized CPU `scaling_governor`, `schedutil/rate_limit_us` (`40000`), and Adreno 304 `governor` directly in `on_transition()`. Replaced `bananarchy-volume-keys`'s `1 s` `poll()` + `2 s` `/dev/input` `glob` loop with `/dev/input` `inotify` + `poll(..., -1)`. Updated `bananarchy-cover-idle` (`gpiochip_device = auto` via `BA_GPIO_GET_CHIPINFO` / `hw_ensure_gpiochip()`) and `bananarchy-cover-diagnose.sh` to resolve MSM8909 TLMM (`1000000.pinctrl`, e.g. `/dev/gpiochip2`) dynamically across `/dev/gpiochip*` so PMIC/TLMM probe-order shifts from strict `fw_devlink` + `qcom,mpm` no longer leave external cover button wakes in `backend=none`. - **Shared GPU `devfreq`, `schedutil`, statusbar, eMMC, and Bluetooth idle fixes (`nokia-argon` and `nokia-beatles`)**: granted `video`-group `0664` permissions to `/sys/class/devfreq/1c00000.gpu/governor` in `10-power-save.start`, synced `1c00000.gpu/governor` (`powersave` while dark or cover-lit, `simple_ondemand` when the main panel wakes) in `bananarchy-display-power-sync` and `locker.so`, and restored `schedutil/rate_limit_us = 40000` on `FORCE=1` transitions as well as normal udev events. `sxmo_hook_statusbar.sh` skips `sxmo_hook_icons.sh` on `time` ticks and updates `099-time` directly in-shell without spawning `sxmo_status.sh` and duplicate `mkdir -p` forks every minute; `sxmo_wm.sh display off` skips rewriting `~/.config/sxmo/brightness` on ext4 when unchanged; `sxmo_hook_screenoff.sh` skips spawning `sxmo_autosuspend.sh` when `/etc/bananarchy-no-deep-standby` is present; and `bananarchy-bt-obex` replaces its `1.0 s` D-Bus/RFCOMM poll and `1.5-2.0 s` `/dev/input` gamepad scan with a signal self-pipe, `ctypes` `inotify`, and blocking `select.select(..., None)` (`0` idle wakeups/s when Bluetooth is enabled, `<5 ms` gamepad hotplug). -- **Image persistence and upcoming release archives**: rebuilt both `images/bananarchy-nokia-argon.img` (SHA-256 `d913b7fe328b3d8c0be242e5d2666d6f03453c565ddc1120ef59698f4445e079`) and `images/bananarchy-nokia-beatles.img` (SHA-256 `d290476ba796abc4eb36eeacb0f6312fe3e33623f7a38b2c607a609808fe4f5e`, with standalone `images/boot-bananarchy-nokia-beatles.img` SHA-256 `7920fae28fa3389602be16a02ad7311b50e61c9c205be48f160307d594f65eb6` and unchanged display lk2nd `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d`) stamped as `a1114` / `carbonara` with `--mkinitfs`, pinned in `scripts/check-rebuild.sh`, and packaged into `bananarchy-nokia-argon-a1114-carbonara.zip` (`8408ec4d99cb7685c7e7bd03051883885b72d710cc2d59a939634367516de812`) and `bananarchy-nokia-beatles-a1114-carbonara.zip` (`deec84db35b9bebd8215546c9393b306581f5c02dc1d756e21e0c9fe33aedbfe`). +- **2720 Flip closed-flip call wakeups, call preservation, closed-flip cover call controls, live timezone sync, and Power menu cleanup**: disabled runtime `CPU_RPM_SLEEP`/`CPU_L2_SLEEP` (`QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) by default (keeping per-core `SPC` active so closed-flip incoming calls wake APSS via `smd-edge` in `< 0.2 ms` instead of stalling until flip-open), gated `bananarchy-display-power-sync`'s `spm/screen_off` write on `rpm_sleep=Y`, serialized `sxmo_modem.sh` `checkforincomingcalls`/`checkforfinishedcalls` under `sxmo_modem.voicecalls.lock` with a live `ringing-in|waiting` check before ringing + 8 s `sxmo_hangup_requested` expiry + `incoming_call_menu` dedup when `xcallscreen` is active, suppressed `bananarchy-idle-lock.sh` while the flip is closed or a call is ringing/active (and cancelled pending idle-lock timers in `bananarchy-lid` on flip transitions), prevented `locker.so` idle/already-closed-blanked `HANGUP_CLOSE` side effects and idle `HANGUP_CLOSE` `/tmp/sxmo_hangup_requested` / fallback `cid=1` QMI hangups in `callscreen.so` (along with duplicate `INCOMING` `ringMuted` reset and `RAISE` stale-call verification); opening the 2720 Flip during a live call keeps `/tmp/bananarchy_screen_locked` set while bypassing `locker.so` activation (`UNGRAB`) and `sxmo_hook_lock.sh` hangup (`! HANGUP_CLOSE`) and raising `callscreen.so` (`RAISE`) cleanly on top; closed-flip incoming calls wake and hold `bananarchy-cover-idle` lit (`cover_hold_awake`), display contact/number and `[SIM n]` tag via `bananarchy-cover-event.sh`, mute the ringer on `BUTTON VOLUP`/`VOLDOWN` (`mute-ring`), hang up on external `BUTTON POWER` (`hangup-call`) with a late async `CALL muted` guard, and blank cleanly on `SIGTERM`; `bananarchy-time-sync.sh` waits for `chronyd` sync completion on `boot`/`network-up`/`force`/`sync`, and `setup-timezone` / `sxmo_timezonechange.sh` / `dmenu` immediately propagate timezone changes across `099-time`, `locker.so` (`REFRESH_TIME`), `bananarchy-cover-idle` (`ba_refresh_tz` / `REFRESH`), `bananarchy-dsds`, `callscreen.so`, and `bananarchy-run-aligned` (`SIGUSR1`) without rebooting (`scripts/test-time-timezone-sync.py`); the non-functional `Logout` entry is removed from the Power menu (`dmenu.c`, `dmenu.so`, `sxmo_appmenu.sh`, `sxmo_hook_contextmenu.sh`) while keeping **Reboot to loader** (`sxmo_power.sh bootloader`); and all `sxmo_calls` live-call readers (`phone_data.h`, `callscreen.so`, `dmenu.so`, `libneoui.so`, `xdrawer.so`, `bananarchy-dsds`, `sxmo_appmenu.sh`) ignore post-call markers (`discardedcall`, `hangedupcall`, `terminated`, `blockedcall`, standalone `mutedring`) while `sxmo_modemcall.sh` reaps orphan markers when `/Call/` is absent (`scripts/test-dsds-daemon.py`) so `XF86PowerOff` always opens the Power menu when no call is live. +- **Image persistence and upcoming release archives**: rebuilt both `images/bananarchy-nokia-argon.img` (SHA-256 `7b39e0ef4cbfc169a4fa0eeda5641ed59df7644b5e5265f8f3f5b25e7f3a8e41`) and `images/bananarchy-nokia-beatles.img` (SHA-256 `19f605dbb5a80ca073895a7ed41149a1a7692c79f12f399bff1e61d497daf069`, with standalone `images/boot-bananarchy-nokia-beatles.img` SHA-256 `7920fae28fa3389602be16a02ad7311b50e61c9c205be48f160307d594f65eb6` and unchanged display lk2nd `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d`) stamped as `a1114` / `carbonara` with `--mkinitfs`, pinned in `scripts/check-rebuild.sh`, and packaged into `bananarchy-nokia-argon-a1114-carbonara.zip` (`0e45d5c892bdfdb33a696235a86993ce48bc92d0dac8f8a9a853661410a47297`) and `bananarchy-nokia-beatles-a1114-carbonara.zip` (`59810d8af4982c4bf43908d76303aa88f701721c909c7bf8207f585bcae71bd0`). --- diff --git a/MANUAL.md b/MANUAL.md index 7d44f4a..eb1bfae 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -110,11 +110,11 @@ sudo dd if=./images/bananarchy-.img of=/dev/sdX bs=4M status=progress co | **2720 Flip outer side keys (closed)** | `KEY_VOLUMEUP` / `KEY_VOLUMEDOWN` / `KEY_POWER` | While the flip is closed, wake the external `240x240` cover display (centered clock, date, battery, and network indicators) for the configured **Screen blank** duration while keeping the internal panel dark | > **Screen blanking, idle blanking, RPM idle standby, passcode locking (`xlocker`), waking, and brightness persistence**: -> While unlocked (and with the lid open), the display blanks automatically after the configured **Screen blank** timeout — **5 minutes by default** — via `dwm`'s own evdev input timer and `bananarchy-idle-blank.sh`. Change it in **Config -> Screen blank** (`Off`, 30 s, 1/5/10/30 min), which writes `~/.config/sxmo/idle_blank_timeout`; `bananarchy-idle-timeout.sh get|label|set ` does the same from the shell, and `SXMO_UNLOCK_IDLE_TIME` or `~/.cache/sxmo/sxmo.noidle` still override/disable it. Closing the slider/lid or locking from the **Power** menu blanks the panel **immediately** (both `Lock` and `Lock (Screen off)` now use `xlocker screenoff`), and an incoming call or SMS/notification turns it back on **immediately** via `bananarchy-screen-wake.sh`, which also resets `dwm`'s idle timer so it cannot blank again right away. Any keypad, lid or power key also restores the display; if it arrives before the idle-lock delay elapses, the desktop stays unlocked. Blanking now arms the screenlock daemon: `bananarchy-idle-blank.sh` calls `bananarchy-idle-lock.sh arm`, which starts the trusted `sxmo_state.sh set screenoff` transition (`xlocker screenoff` -> `LOCK_BLANK` on `locker.so`) after **30 seconds** of dark panel by default. Set `~/.config/sxmo/idle_lock_delay` with `bananarchy-idle-lock.sh set 0` to lock immediately on blank, any other number of seconds to change the grace period, or `set off` to keep the old blank-without-passcode behaviour. `bananarchy-idle-lock.sh get|label|cancel` reports and cancels the pending lock; `bananarchy-screen-wake.sh`, `bananarchy-idle-blank.sh on` and `sxmo_hook_unlock.sh` cancel it on every wake, and the transition only fires while the panel is still dark. X11 screensaver timeouts stay at `0 0 0`; DPMS is driven by the backlight state. Traditional Linux **`mem` suspend (`/sys/power/state`)** stays disabled (`# CONFIG_SUSPEND is not set` + `/etc/bananarchy-no-deep-standby`) to keep the pmaports module ABI and instant hardware wakeups (stock firmware lacks PSCI `SYSTEM_SUSPEND`); instead, `cpuidle_qcom_spm` enters hardware XO/RPM sleep (`vMPM`) and L2 SAW2 retention/collapse (`CPU_RPM_SLEEP=1`, `CPU_L2_SLEEP=1`) directly from deep idle while `serial@78af000` (`console=ttyMSM0`) is disabled so UART clocks never pin XO or `gpll0`. Locking the phone (`Power -> Lock`, `Power -> Lock (Screen off)`, `2x End / Power`, or closing the physical slider) activates the fullscreen `240x320` **Passcode Locker (`xlocker` / `locker.so`)**, which verifies your numeric system password (`147147` by default, checked against `/etc/shadow` via `/usr/bin/bananarchy-verify-passcode`). While locked, there is no keypad, softkey, slider, or power-button bypass (`dmenu`, `xdrawer`, terminal spawning, and desktop shortcuts are blocked, and only incoming calls can temporarily overlay `xcallscreen`). Screen and keypad brightness levels configured in **XDrawer** or **Config -> Brightness** are persisted in `~/.config/sxmo/brightness` and `/tmp/sxmo_saved_brightness` and restored on every wake. +> While unlocked (and with the lid open), the display blanks automatically after the configured **Screen blank** timeout — **5 minutes by default** — via `dwm`'s own evdev input timer and `bananarchy-idle-blank.sh`. Change it in **Config -> Screen blank** (`Off`, 30 s, 1/5/10/30 min), which writes `~/.config/sxmo/idle_blank_timeout`; `bananarchy-idle-timeout.sh get|label|set ` does the same from the shell, and `SXMO_UNLOCK_IDLE_TIME` or `~/.cache/sxmo/sxmo.noidle` still override/disable it. Closing the slider/lid or locking from the **Power** menu blanks the panel **immediately** (both `Lock` and `Lock (Screen off)` now use `xlocker screenoff`), and an incoming call or SMS/notification turns it back on **immediately** via `bananarchy-screen-wake.sh`, which also resets `dwm`'s idle timer so it cannot blank again right away. Any keypad, lid or power key also restores the display; if it arrives before the idle-lock delay elapses, the desktop stays unlocked. Blanking now arms the screenlock daemon: `bananarchy-idle-blank.sh` calls `bananarchy-idle-lock.sh arm`, which starts the trusted `sxmo_state.sh set screenoff` transition (`xlocker screenoff` -> `LOCK_BLANK` on `locker.so`) after **30 seconds** of dark panel by default. Set `~/.config/sxmo/idle_lock_delay` with `bananarchy-idle-lock.sh set 0` to lock immediately on blank, any other number of seconds to change the grace period, or `set off` to keep the old blank-without-passcode behaviour. `bananarchy-idle-lock.sh get|label|cancel` reports and cancels the pending lock; `bananarchy-screen-wake.sh`, `bananarchy-idle-blank.sh on` and `sxmo_hook_unlock.sh` cancel it on every wake, and the transition only fires while the panel is still dark. X11 screensaver timeouts stay at `0 0 0`; DPMS is driven by the backlight state. Traditional Linux **`mem` suspend (`/sys/power/state`)** stays disabled (`# CONFIG_SUSPEND is not set` + `/etc/bananarchy-no-deep-standby`) to keep the pmaports module ABI and instant hardware wakeups (stock firmware lacks PSCI `SYSTEM_SUSPEND`); instead, per-core `cpuidle_qcom_spm` Standalone Power Collapse (`L2_ON`) stays active with `< 0.2 ms` wakeup on all GIC SPIs while `serial@78af000` (`console=ttyMSM0`) is disabled so UART clocks never pin XO or `gpll0`. Locking the phone (`Power -> Lock`, `Power -> Lock (Screen off)`, `2x End / Power`, or closing the physical slider) activates the fullscreen `240x320` **Passcode Locker (`xlocker` / `locker.so`)**, which verifies your numeric system password (`147147` by default, checked against `/etc/shadow` via `/usr/bin/bananarchy-verify-passcode`). While locked, there is no keypad, softkey, slider, or power-button bypass (`dmenu`, `xdrawer`, terminal spawning, and desktop shortcuts are blocked, and only incoming calls can temporarily overlay `xcallscreen`). Screen and keypad brightness levels configured in **XDrawer** or **Config -> Brightness** are persisted in `~/.config/sxmo/brightness` and `/tmp/sxmo_saved_brightness` and restored on every wake. > **Runtime power policy (`/etc/bananarchy-power-policy.conf`)**: -> `WIFI_LISTEN_INTERVAL` (1-10, default 5) sets the `wcn36xx` beacon listen interval (`max_listen_interval` and `conf.listen_interval`) via `/etc/modprobe.d/10-bananarchy-power.conf`, while `bananarchy-display-power-sync` toggles `/sys/module/wcn36xx/parameters/screen_off_offload` to enable WCN3620 ARP/IPv6-NS/GTK, BET, and DTIM offloads (`HOST_SUSPEND_IND`) while the main panel is dark without suspending host RX. `WIFI_SCREEN_OFF_IPV6_MUTE=1` (default) mutes unsolicited IPv6 router advertisements (`accept_ra=0`) on `wlan0` while dark if `wlan0` already holds an IPv4 address and restores the previous value on wake. `WIFI_STANDBY_RAT=keep` (default; set `gsm` to opt in) optionally parks QMI NAS mode preference to GSM after 30 s of darkness while `wlan0` is `up`, restoring the saved RAT preference on wake. `CPU_RPM_SLEEP=1` and `CPU_L2_SLEEP=1` (both default `1`) control runtime `/sys/module/cpuidle_qcom_spm/parameters/{rpm_sleep,l2_sleep}` cluster RPM (`vMPM`) and L2 SAW2 sleep handoff when all online CPUs go idle. `MODEM_DRX_MODE` (default `6`) applies the Qualcomm `AT$QCDRX` DRX mode across all `/dev/wwan0at*` channels at boot and on screen transitions (cached per AT port inode); `6` enables the standard ~1.28 s low-power paging cycle across active SIMs, `7-9` are progressively longer undocumented paging cycles, and `0` leaves the firmware default untouched. The standard `AT+CPSMS` / `AT+CEDRXS` PSM/eDRX commands are not supported by this modem firmware. `DSDS_SECONDARY_MODE=eco` (default `active`) deactivates the secondary SIM's GW provisioning session after `DSDS_PARK_DELAY` seconds (default 300) of a dark panel and restores it on wake; **SIM2 is unreachable while parked**. This uses QMI provisioning sessions, not SIM power-off, so a PIN-locked SIM stays locked. Edit the file as root and run `doas /usr/bin/bananarchy-power-policy.sh apply`, or reboot; `doas /usr/bin/bananarchy-power-policy.sh status` reports the effective values across AT ports, `wcn36xx`, `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats`, and `/sys/kernel/debug/qcom_rpm_master_stats`. See `BATTERY-OPTIMIZATION-ANALYSIS.md` §§15, 20-22. +> `WIFI_LISTEN_INTERVAL` (1-10, default 5) sets the `wcn36xx` beacon listen interval (`max_listen_interval` and `conf.listen_interval`) via `/etc/modprobe.d/10-bananarchy-power.conf`, while `bananarchy-display-power-sync` toggles `/sys/module/wcn36xx/parameters/screen_off_offload` to enable WCN3620 ARP/IPv6-NS/GTK, BET, and DTIM offloads (`HOST_SUSPEND_IND`) while the main panel is dark without suspending host RX. `WIFI_SCREEN_OFF_IPV6_MUTE=1` (default) mutes unsolicited IPv6 router advertisements (`accept_ra=0`) on `wlan0` while dark if `wlan0` already holds an IPv4 address and restores the previous value on wake. `WIFI_STANDBY_RAT=keep` (default; set `gsm` to opt in) optionally parks QMI NAS mode preference to GSM after 30 s of darkness while `wlan0` is `up`, restoring the saved RAT preference on wake. `CPU_RPM_SLEEP=0` and `CPU_L2_SLEEP=0` (both default `0`) control opt-in runtime `/sys/module/cpuidle_qcom_spm/parameters/{rpm_sleep,l2_sleep}` cluster RPM (`vMPM`) and L2 SAW2 sleep handoff; keep `0` by default because per-core SPC with L2 retention already wakes in `< 0.2 ms` on every GIC SPI without collapsing APSS GIC and dropping `smd-edge` modem wakeups during closed-flip standby. `MODEM_DRX_MODE` (default `0`) leaves the firmware's native DSDS paging scheduler untouched without contending with `ModemManager` on open `/dev/wwan0at*` ports; values `6-9` remain opt-in to apply Qualcomm `AT$QCDRX` across all `/dev/wwan0at*` channels (`6` enables ~1.28 s DRX, and `7-9` are progressively longer undocumented paging cycles). The standard `AT+CPSMS` / `AT+CEDRXS` PSM/eDRX commands are not supported by this modem firmware. `DSDS_SECONDARY_MODE=eco` (default `active`) deactivates the secondary SIM's GW provisioning session after `DSDS_PARK_DELAY` seconds (default 300) of a dark panel and restores it on wake; **SIM2 is unreachable while parked**. This uses QMI provisioning sessions, not SIM power-off, so a PIN-locked SIM stays locked. Edit the file as root and run `doas /usr/bin/bananarchy-power-policy.sh apply`, or reboot; `doas /usr/bin/bananarchy-power-policy.sh status` reports the effective values across AT ports, `wcn36xx`, `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats`, and `/sys/kernel/debug/qcom_rpm_master_stats`. See `BATTERY-OPTIMIZATION-ANALYSIS.md` §§15, 20-22. #### 3.1.1 Window tiling modes and switching combos By default, `dwm` uses the **vertical bottom-stack (`bstack`, `TTT`)** layout so multiple `st` terminals stack **vertically (one under another)** to preserve full line width on the `240x320` portrait screen. @@ -139,7 +139,7 @@ All twenty-five phone applications are compiled as shared-object plugins (`/usr/ 1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**: - **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close. - - **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Logout**, **Reboot**, **Reboot to loader**, and **Poweroff**; use the lk2nd Fastboot menu for **EDL**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes. + - **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Reboot**, **Reboot to loader**, and **Poweroff**; use the lk2nd Fastboot menu for **EDL**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes. - **Script compatibility**: any script piping items into `/usr/bin/dmenu` or `sxmo_dmenu.sh` communicates with the resident daemon over `/tmp/dwm_plugin_dmenu.sock`. 2. **Global phone controls (`xdrawer.so` / `xdrawer`)**: @@ -458,8 +458,8 @@ Three native X11 games (`/usr/bin/snake`, `/usr/bin/tetris`, and `/usr/bin/scoun - **Wi-Fi and Bluetooth missing**: both radios depend on the shared WCNSS remote processor. `msm-firmware-loader` must start in sysinit before udev and mount the stock `modem` and `persist` partitions under `/run/msm-firmware-loader/mnt`; it then exposes `wcnss.mdt` and the factory `WCNSS_qcom_wlan_nv.bin` through the kernel firmware path. Check `rc-service msm-firmware-loader status`, `cat /sys/class/remoteproc/remoteproc1/state`, and `dmesg | grep -Ei 'wcnss|remoteproc|firmware'`. A `Direct firmware load for wcnss.mdt failed` message means the loader package or its sysinit link is missing, not that the Wi-Fi and Bluetooth drivers are absent. After a successful boot, `wlan0` and `hci0` enumerate automatically; Bluetooth userspace still starts on demand from the Networks/Bluetooth UI to save power. - **X startup and keypad**: OpenRC starts independent services in parallel; `etc/init.d/local` replaces its stock `after *` dependency, which deadlocked with parallel startup on this image. `udev_settle_timeout=2` stops missing modem firmware from holding the display manager behind a long `udevadm settle`, and `bananarchy-sshd-debug` starts independently of `local.d`. A boot-open flip reads `/run/bananarchy/lid-state` and starts in `state=unlock` with no passcode screen, so the keypad is live as soon as `dwm` starts. If the keypad is dead, check `rc-service bananarchy-lid status`, `cat /run/bananarchy/lid-state`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked`, `DISPLAY=:0 xwininfo -id 0xa00001` and `DISPLAY=:0 xinput list`. - **Display distortion above 71% brightness**: the internal panel uses 25 MHz SPI on `nokia-beatles`, rather than the 50 MHz timing used by the other targets. This keeps the link stable when the MPP2 backlight PWM duty rises above the level-10/14 operating point. The brightness range remains 1–14 with no artificial cap, and panel offsets/init registers are unchanged. The timing can be checked with `dtc -I dtb -O dts /boot/qcom-msm8905-nokia-beatles.dtb | grep -A8 'display@0'`. -- **Closing the flip**: `bananarchy-lid` keeps a sticky hall reading, re-reads gpio36/gpio92 immediately on every `EV_SW` edge, and uses a 20 ms debounce/loop. On close it writes `/run/bananarchy/lid-state`, `/tmp/bananarchy_screen_locked`, `sxmo.state`, both backlights and DPMS synchronously before spawning any hook, then runs `sxmo_state.sh set screenoff` through a generation-guarded wrapper. On open it releases the cover's shared SPI bus, restores the main panel and **keeps the desktop locked**: it writes state `lock`, sends `LOCK` to `locker.so` and runs `sxmo_state.sh set lock`, so the passcode lockscreen appears instead of an auto-unlocked desktop. A close is ~45-90 ms and an open ~10-130 ms. `bananarchy-lid-state.sh` drops stale hook spawns by lid state and generation. Check `rc-service bananarchy-lid status`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked` and `grep -E " gpio(36|92) " /sys/kernel/debug/gpio`. If the hall polarity is inverted, set `BANANARCHY_LID_GPIO_FILE` to a different debugfs GPIO file. -- **Cover display status and behaviour**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl` (`PING`, `STATUS`, `LID CLOSED|OPEN`, `BUTTON`, `NETWORK`, `BATTERY`, `NOTIFY`, `BLANK`/`UNBLANK`, `TEST`, `SET`, `PROBE`); the native `bananarchy-coverd` is retained only for diagnostics. With the flip open the daemon does not touch the shared QUP5 SPI bus; initial closed-flip activation requires `card0-SPI-1/dpms = Off`. The shipping single-panel DTB uses `backend = kernel`: the KaiOS 3.10 DTS and kernel driver show that the two GC9305s share CS0, gpio110 D/C and one active-high PMIC MPP2 PWM backlight (`kernel_backlight_invert = 0`, `kernel_backlight_level = 14`), while gpio13 selects the panel (high = cover, low = internal), gpio23 is the external reset and gpio21 is TE. Because the internal 240x320 TN panel is normally-white while the external 240x240 panel is normally-black, a closed-flip button event wakes DRM with gpio13 low, paints an X11 `override_redirect` cover window and `/dev/fb0` solid black while leaving the internal GC9305 scanning black GRAM (`kernel_internal_sleep = 0`) so it blocks the shared backlight, switches gpio13 high, pulses gpio23, replays the exact vendor 240x240 init through `/sys/kernel/debug/dri/0/command`, and presents a centered 240x240 clock/date/status frame once per second. `/run/bananarchy/cover-backlight` contains `0` during dark GRAM preparation, `1` while the cover is lit, and is unlinked when dark; `bananarchy-display-power-sync` holds the matching brightness, `bl_power` and DPMS state (honouring `/run/bananarchy/cover-runtime.conf` for runtime `SET` overrides). `STATUS` reports `backend=kernel`, `mux=cover`; `BLANK` turns the shared backlight off, sleeps both controllers, parks gpio13 low and forces DPMS Off; `LID OPEN` sleeps the external panel, restores gpio13 low, brightness 14, `bl_power=0`, DPMS On and re-initialises the internal panel to the passcode lockscreen. The outer panel stays off until a trusted side-key `BUTTON` / `WAKE` arrives, and blanks dynamically after the same **Config -> Screen blank** timeout (`blank_timeout = auto`, reading `~/.config/sxmo/idle_blank_timeout` and `sxmo.noidle`). The legacy `spidev`, 8/9-bit, `PROBE`, `SET mux_closed_level 0|1`, `SET kernel_backlight_invert 0|1`, `SET kernel_internal_sleep 0|1` and `SET backend none` paths remain for rollback. `bananarchy-cover-diagnose.sh` reports the debugfs hook, backlight marker, GPIO lines, DPMS, firmware and daemon state. `scripts/test-cover-idle.py`, `scripts/test-cover-spidev.py`, `scripts/test-cover-kernel.py`, `scripts/test-cover-dt.py` and `scripts/test-lid-gate.py` guard the state machine, both backends, DT layouts and lid gate on the host. The opt-in two-panel `spi-mux` DT remains experimental because its separate gpio21 D/C wiring contradicts the vendor DTS and a live test darkened the main panel; `scripts/build-beatles-no-cover-dtb.py` builds the shipping rollback DTB. +- **Closing the flip**: `bananarchy-lid` keeps a sticky hall reading, re-reads gpio36/gpio92 immediately on every `EV_SW` edge, and uses a 20 ms debounce/loop. On close it writes `/run/bananarchy/lid-state`, `/tmp/bananarchy_screen_locked`, `sxmo.state`, both backlights and DPMS synchronously before spawning any hook, then runs `sxmo_state.sh set screenoff` through a generation-guarded wrapper. On open it releases the cover's shared SPI bus, restores the main panel and **keeps the desktop locked**: it writes state `lock`, sends `LOCK` to `locker.so`, runs `sxmo_state.sh set lock`, and sends `RAISE` to `callscreen.so` when `/tmp/sxmo_call_ringing` or `/tmp/sxmo_active_call` is present. `sxmo_hook_lock.sh` and `locker.so` preserve active calls without triggering `HANGUP_CLOSE` when activating on lock or flip open, so opening the flip during an incoming or active call brings up `callscreen` above the locked desktop without hanging up. A close is ~45-90 ms and an open ~10-130 ms. `bananarchy-lid-state.sh` drops stale hook spawns by lid state and generation. Check `rc-service bananarchy-lid status`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked` and `grep -E " gpio(36|92) " /sys/kernel/debug/gpio`. If the hall polarity is inverted, set `BANANARCHY_LID_GPIO_FILE` to a different debugfs GPIO file. +- **Cover display status and behaviour**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl` (`PING`, `STATUS`, `LID CLOSED|OPEN`, `BUTTON`, `NETWORK`, `BATTERY`, `NOTIFY`, `CALL`, `REFRESH`, `BLANK`/`UNBLANK`, `TEST`, `SET`, `PROBE`); the native `bananarchy-coverd` is retained only for diagnostics. With the flip open the daemon does not touch the shared QUP5 SPI bus; initial closed-flip activation requires `card0-SPI-1/dpms = Off`. When a call arrives while closed (`CALL incoming|...|...|...`), the cover wakes automatically and stays lit past the normal blank timeout showing caller name/number, SIM tag, and side-key hints; pressing external **Volume Up/Down** (`BUTTON VOLUP`/`VOLDOWN` -> `bananarchy-cover-event.sh mute-ring`) mutes the ringer while keeping call state visible, and pressing external **Power**/camera (`BUTTON POWER` -> `bananarchy-cover-event.sh hangup-call`) hangs up without opening the flip. The shipping single-panel DTB uses `backend = kernel`: the KaiOS 3.10 DTS and kernel driver show that the two GC9305s share CS0, gpio110 D/C and one active-high PMIC MPP2 PWM backlight (`kernel_backlight_invert = 0`, `kernel_backlight_level = 14`), while gpio13 selects the panel (high = cover, low = internal), gpio23 is the external reset and gpio21 is TE. Because the internal 240x320 TN panel is normally-white while the external 240x240 panel is normally-black, a closed-flip button event wakes DRM with gpio13 low, paints an X11 `override_redirect` cover window and `/dev/fb0` solid black while leaving the internal GC9305 scanning black GRAM (`kernel_internal_sleep = 0`) so it blocks the shared backlight, switches gpio13 high, pulses gpio23, replays the exact vendor 240x240 init through `/sys/kernel/debug/dri/0/command`, and presents a centered 240x240 clock/date/status or call frame once per second (with live timezone reloads via `ba_refresh_tz()`). `/run/bananarchy/cover-backlight` contains `0` during dark GRAM preparation, `1` while the cover is lit, and is unlinked when dark; `bananarchy-display-power-sync` holds the matching brightness, `bl_power` and DPMS state (honouring `/run/bananarchy/cover-runtime.conf` for runtime `SET` overrides). `STATUS` reports `backend=kernel`, `mux=cover`; `BLANK` (and clean `SIGTERM` shutdown) turns the shared backlight off, sleeps both controllers, parks gpio13 low and forces DPMS Off; `LID OPEN` sleeps the external panel, restores gpio13 low, brightness 14, `bl_power=0`, DPMS On and re-initialises the internal panel to the passcode lockscreen (raising `callscreen` above it if a call is active or ringing). The outer panel stays off until a trusted side-key `BUTTON` / `WAKE` or incoming `CALL` arrives, and blanks dynamically after the same **Config -> Screen blank** timeout (`blank_timeout = auto`, reading `~/.config/sxmo/idle_blank_timeout` and `sxmo.noidle`). The legacy `spidev`, 8/9-bit, `PROBE`, `SET mux_closed_level 0|1`, `SET kernel_backlight_invert 0|1`, `SET kernel_internal_sleep 0|1` and `SET backend none` paths remain for rollback. `bananarchy-cover-diagnose.sh` reports the debugfs hook, backlight marker, GPIO lines, DPMS, firmware and daemon state. `scripts/test-cover-idle.py`, `scripts/test-cover-spidev.py`, `scripts/test-cover-kernel.py`, `scripts/test-cover-dt.py`, `scripts/test-lid-gate.py` and `scripts/test-time-timezone-sync.py` guard the state machine, both backends, DT layouts, lid gate and live timezone/network sync on the host. The opt-in two-panel `spi-mux` DT remains experimental because its separate gpio21 D/C wiring contradicts the vendor DTS and a live test darkened the main panel; `scripts/build-beatles-no-cover-dtb.py` builds the shipping rollback DTB. - **Camera app frozen / UI unresponsive**: check `top` for `bananarchy-volume-keys`. The daemon must be a single instance at 0% CPU; stale evdev fds are pruned by `prune_devices()`/`drop_device()` and guarded by `flock`. `rc-service bananarchy-volume-keys status` and `bananarchy-keypad-diagnose.sh` report its state. `xcamera` should return immediately and `bananarchy-photo ` should write a 600x800 JPEG. - **Camera**: `/dev/video0` is provided by the out-of-tree `msm8905-cam` module, loaded at boot by `/etc/modules-load.d/bananarchy-hardware.conf` and `etc/local.d/10-bananarchy-hardware.start`. Check with `v4l2-ctl --list-devices`; a missing node means the module did not load (previously caused by a missing `/bin/sed` breaking the `modules` service). diff --git a/README.md b/README.md index e16e0df..3b78e16 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs - **Tox / Trifa P2P messenger and audio call client (`xtox` / `tox.so`)**: encrypted P2P messenger (`Friends`, `Chat`, `My Tox ID`) built on `c-toxcore` (`libtoxcore.so.2`) with DHT + TCP relay bootstrap, friend requests, persistent message history, and `ToxAV` 48 kHz Opus voice calls integrated with `xcallscreen`. - **Kopher SmallWeb browser (`xkopher` / `kopher` / `xsmallweb` / `smallweb.so`)**: multi-protocol SmallWeb client for **Gopher** (`gopher://`) with optional TLS (`gophers://`), **Gemini** (`gemini://`), **Spartan** (`spartan://`), and **Nex** (`nex://`), featuring WAP-style default keypad controls from [Kopher](https://code.luxferre.top/luxferre/kopher.git), user-adjustable keybindings (`~/.config/sxmo/smallweb_controls.tsv`), 10 bookmarks, custom homepage support, and link focus that always scrolls the viewport to the focused link in both wrapped and unwrapped modes. - **Webarchy Web browser (`webarchy` / `xwebarchy` / `webarchy.so`)**: full-featured HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS`, WebGL, accelerated 2D canvas, and 512 MB RAM pressure tuning), default KaiOS 4.0 User-Agent (`Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0`) with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace browser fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline HTML5 `