Skip to content

Development

TL;DR. This repository is the PICO 4's part of overpressure, cloned into devices/phoenix/ of an overpressure checkout. The headset stays in development mode, and a change reaches it with dev recovery, dev install (the headset builds its system) and dev check. The host tests run in seconds without hardware. This page covers the layout, the build host, the loop from a change to the headset and the Windows host; building: building.md; tests: tests.md; the headset-side runs: hardware-testing.md.

Build the headset builds its system itself at the install; the userspace build also runs in the build container (overpressure container run -- ...) for its package check; PICO OS's files come from the headset's backup at the install (building.md)
Test python -m unittest on the host; the installed system (dev install, dev check) is the integration test (tests.md)
Code this repository, in devices/phoenix/ of an overpressure checkout (layout); the generic package overpressure/ (overpressure's architecture)

The headset-side workflows (acceptance runner, acceptance cycle, development loop) are in hardware-testing.md. Paths are relative to this repository; commands run from the root of the overpressure checkout it is cloned into:

git clone https://github.com/overpressure/overpressure
cd overpressure
git clone https://github.com/overpressure/phoenix devices/phoenix   # never replaced by "headset add"

Repository layout

headset.json      codename, name, version, the overpressure headset interface (api); commit and date in a release
env.example       its keys in overpressure's .env (PICO4_), added to a new .env
tooling/          the PICO 4's host tooling (Python): overpressure COMMAND
  __init__.py       HEADSET, the index: its commands, the window's steps, the installer's workflows and questions,
                    its backup
  localconfig.py    the headset's settings from .env (PICO4_ keys)
  doctor.py         the PICO 4's checks for overpressure doctor
  prefetch.py       the pins of the downloads made on this computer before the install
  kernel.py         the pinned release of overpressure/linux: fetch, build, check, contracts
  installer/        the installer, on overpressure's roles and look
    install.py        its plans: install, upgrade, restore to stock, check, rescue (stages, timings, parts)
    texts.py          its words: where the headset is when a task stops, the asks, the notes
    look.py           the look at the headset on USB (PICO OS, its bootloader, EDL)
    rescue.py         PICO OS back without a backup, from PICO's own downloads over EDL
  development/      the development loop and the acceptance runs, on overpressure's executor
    devloop.py        the dev loop on overpressure's recovery client: its profile and hooks, dev check, the
                      release check, the support bundle
    device.py         the device commands' PICO 4 words: identity checks, engineering ABL, unlock token and unlock;
                      unlockfiles.py: their downloads
    cycle.py          the unattended acceptance cycle that ends on stock boot and ABL (on overpressure's edl.py)
    hardware_test.py  the PICO 4's acceptance runner: its words, its checks of the installed system
  stock/            what the system takes from PICO OS
    assets.py         every file, from the backup (overpressure/assets.py)
    stockfiles.py     PICO OS's files for the data partition, from the backup
    bootchain.py      each PICO OS build's boot chain against the verified build's, from PICO's OTAs
    image.py          the recovery boot image (build, inspect, match) on overpressure/recovery_ramdisk.py
    firmware.json     PICO's OTA builds (the recovery ramdisk image's firmware, bootchain)
  controllers/      controller data from PICO OS's libraries: ledmodel.py, aimgrip.py, leverarm.py,
                    controllermodel.py
  checks/           validators of the on-headset checks: userspace.py, graphics.py
initramfs/        the recovery: the PICO 4's values for overpressure's runtime (etc/overpressure/headset) and pico4-install
userspace/        stage 2: the SteamOS-compatible userspace
  packages.json     the release of overpressure/packages the image is built from: its definition, the
                    project's packages and the adaptation layer (its pico4-* packages)
  stock-links.txt   the image's links to PICO OS's files on the data partition and its partitions
kernel.json       the pinned release of overpressure/linux and the values its kernel is built with
src/              C sources outside the packages: reboot/ (pico4-reboot), splash/ (pico4-splash)
prebuilt/         static aarch64 pico4-reboot and pico4-splash, so the recovery builds without a compiler
scripts/          c-tests.sh (the C tests of src/), preflight-hook.sh (the PICO 4's part of overpressure's
                  preflight under PICO OS)
userspace/build.sh  this headset's part of the userspace build: its prefix, masks and adaptation hooks;
                  build-on-headset-hook.sh its part of the build on the headset (the fan). The builds themselves
                  are overpressure's build/ scripts, run with this folder
.github/          CI (against overpressure's main), the release, the weekly upgrade check
tests/            host tests (unittest), in the tooling's folders (installer/, development/, stock/,
                  controllers/, checks/), qemu/
docs/             documentation

What every headset shares is overpressure's, and this repository reaches it only through its headset interface, overpressure.api.v2 (the interface): .env settings, the doctor, the recovery builder, OTA handling, adb and fastboot, Qualcomm EDL, verified backups and their words in the window, the installer's stages and asks, processes and waits, SSH, recorded runs, the read-only storage policy, the formats (with the ext4 and FAT readers) and the Windows USB link. So is the executor this repository describes its steps for: the plans' building blocks (roles), the recovery's client (recovery, the Qualcomm one QualcommRecovery), the adb and EDL steps (edl), the device and dev command lines (devicecli, devcli), the acceptance runner (acceptance), the look (look) and the on-headset writer (overpressure-install, which pico4-install names). The window, the command line, the disclaimer, the power check and the build container are overpressure's own: this repository declares, they run it. overpressure's scripts/stock-lib.sh serves the kernel build (a file out of the stock vendor image, through its ext4 reader).

Private and generated, out of Git, at the overpressure checkout's root: backup/phoenix/ (identity and EDL backups), assets/phoenix/ (Firehose loader and engineering ABL), assets/ (GPU firmware, sensor data), cache/ (downloads), out/ (build output and test evidence; out/dev/ for the development loop) and .env (the headset's settings, see env.example).

Build host

overpressure doctor --development (Check dependencies in the app's Advanced mode) checks this computer for development and says how to fix what is missing (without the flag only what an owner must have: the installer records the serials, the identity and the backup and downloads the tools and the unlock files itself); overpressure tools fetches adb, fastboot and edl-ng (tooling/doctor.py, overpressure's settings).

Task Needs
Recovery ramdisk image, assets, host tests, headset commands Python 3.12+ on Windows, Linux or macOS: the app's own, or a checkout's through uv run (uv sync adds the pinned pyusb and libusb-package); platform-tools and OpenSSH for the headset
The userspace build on the PC, Valve's kernel, the QEMU test kernel the build container (overpressure's steps): Docker or Podman on any host. Its image has every tool, LLVM 20 and qemu-user-static, and registers the aarch64 binfmt handler (F flag) on an x86-64 engine that has none
Windows NCM initialization (a recovery on the stock kernel: the acceptance runner's) UsbDk; pyusb and libusb-package

On an arm64 engine (Apple silicon, an arm64 Linux host) the build environment runs natively.

Native compilers instead of an arm64 build machine

The build environment is an arm64 root file system. On x86-64 its programs run under QEMU user emulation, roughly ten times slower than natively, except the compilers: the host's x86-64 clang and lld run directly and compile for aarch64-unknown-linux-gnu with the environment as sysroot (its glibc, GCC 15 runtime and libraries). makepkg, CMake and Meson configuration, code generators, pacman and its hooks still run emulated. Packages built by clang use lld and no LTO (LTO's bitcode objects would need LLVM's archiver in every build system). overpressure/packages' releases are built natively on arm64 with the environment's GCC, so a local build on x86-64 is for trying a change, not the release's bytes.

Clean package builds with the host's clang on a 12-core i7-12700KF (20 threads) under WSL2:

Package Build time
pico4-basalt 2.9 min
pico4-monado 2.8 min
sm8250-hexagonrpc 1.0 min
overpressure-gtk2 (GTK 2.24.33, libraries and modules; Autotools under QEMU) 14 min

A Raspberry Pi 5 compiles at about the speed of this host's emulation. Faster arm64 hosts: Apple silicon, Snapdragon X, Ampere and Graviton cloud instances. Mind the private data rules before building on someone else's machine.

From a change to the headset

The headset stays in development mode: the engineering ABL, the dev image in recovery and the installed system, both on Valve's kernel (hardware-testing.md, installed-system.md). Commands that touch the headset ask the disclaimer first; --accept-disclaimer (or OVERPRESSURE_ACCEPT_DISCLAIMER=1) accepts it for an unattended run.

  1. Change the code. A change to a package is made in a checkout of overpressure/packages and tried with dev install --packages DIR; once it is released there, userspace/packages.json pins the new tag. make userspace (or the userspace build) checks the build on the PC first, incremental.
  2. overpressure dev recovery (it stays until dev normal), then overpressure dev install: the headset builds the system into super (installed-system.md) and starts it.
  3. overpressure dev check; dev installed reconnects after a reboot.

A changed recovery ramdisk image is built with overpressure build and written with dev image and dev flash; the installed system's boot image holds no recovery. A new kernel goes through dev boot-image, dev recovery and dev install --boot PATH (installed-system.md). A task ends in development mode; returning to stock is a separate step, for when PICO OS is needed (hardware-testing.md).

Power while tethered

Tethered work needs a charging USB port (CDP), a USB-C port or a wall charger. Through a USB-C to USB-A adapter the headset's charger sets its input by BC1.2 detection; Type-C's "high current" there is the adapter's pull-up resistor, which the charger rightly ignores. On a USB-C port the port's own current counts: the input limit follows it, and the charger's AICL finds what the port gives. A USB PD charger negotiates a contract.

Port Charger input Battery
Standard port (real_type USB) 0.49 A at 4.74 V, about 2.3 W drains during a session, 0.29–0.78 A
Charging downstream port (USB_CDP) settles at 1.5 A and draws 1.49 A at 4.49 V, about 6.7 W session stopped: +1.13 A; Valve's session in standby: +0.78 A; rendering: drains, about 0.37 A
USB-C port advertising 3 A limit 3 A, AICL settles at 1.4–1.95 A at 4.1–4.4 V Valve's session running: charges
USB PD charger (5/9 V, 3 A) 5 V, then 9 V once the input is current-limited: 14.2 W on average on the table, 18.6 W while playing on the table 26 to 37 % in 15 minutes; while playing 38 to 47 % in 17 minutes

On a CDP the input is the limit (input_current_limited 1, input_current_settled 1.5 A): 6.7 W is about what Valve's session draws while it renders. The charger reports "Charging" also while the battery drains; the battery's current_now (positive while charging) tells. pico4-userspace-check reports port type, input limit, input current, VBUS and the battery's state (power); dev check warns on a standard port, when the battery drains while tethered, and when it charges at less than 200 mA below 95 % (power_warnings in tooling/checks/userspace.py).

Windows host

  • From Git Bash, set MSYS_NO_PATHCONV=1; otherwise /abs/paths in arguments and environment values become C:/Program Files/Git/....
  • Run project PowerShell scripts with pwsh (7); Windows PowerShell 5.1 aborts on native stderr.
  • overpressure tools fetches adb and fastboot into cache/tools; PICO4_PLATFORM_TOOLS can name an Android SDK's own (%LOCALAPPDATA%\Android\Sdk\platform-tools) instead.
  • Line endings: .gitattributes checks out userspace/, initramfs/, scripts and sources with LF; PKGBUILD checksums depend on it. Python on Windows writes CRLF unless told newline="\n".
  • Windows' real-time scan reads every freshly written boot image once, about a quarter of a second each; the host tests share one image for that reason.
  • The build roots live in the build container's volume (/var/tmp, a Linux file system); the repository's bind mount from Windows is much slower, so build trees do not go under /work.

Conventions

overpressure's CLAUDE.md has them: Python on the standard library and the packages overpressure's pyproject.toml pins, each with a fallback; set -euo pipefail in shell scripts; SPDX headers in C (BSL-1.0 for Monado code); external sources pinned by commit or hash, patches as .patch files next to their PKGBUILD with regenerated sha256sums; the project's own sources in src/, SKIP in the recipes; documents state facts; conventional commits.