Skip to content

Head IMU

TL;DR. The head IMU, a TDK ICM-42688, hangs off the sensor DSP (SLPI), which runs Qualcomm's Sensor Core. remoteproc-boot starts the DSP, hexagonrpcd serves it its configuration and this headset's registry, and the driver reads the IMU at 1 kHz over QMI on QRTR.

How it works

The IMU hangs off the SLPI, a Hexagon DSP running Qualcomm's Sensor Core:

  1. Firmware. remoteproc-boot starts slpi.mdt (from the modem partition of PICO's public package) through remoteproc. The kernel provides QRTR's name service and the PD mapper.
  2. File server. hexagonrpcd (linux-msm/hexagonrpc, sm8250-hexagonrpc) attaches to the sensors process (sensorspd) and serves it the sensor configuration and this headset's registry over FastRPC. This project's patches: it serves sns_reg_version; -P NAME starts a static process (the ADSP's audio process, audio.md); it answers ftell; and it takes the DSP's registry rewrites (temp.json, renamed over each group) and drops them, so persist stays read-only and the factory calibration stays in effect.
  3. Client. pico4-imu is a dependency-free Python client of the SNS client service (QMI service 0x190, protobuf inside QMI). The driver's pico4_ssc.c is a C port of it; its unit test checks the encoder against the Python client's messages byte for byte.

Behaviour of the DSP:

  • Persistent listener. If a FastRPC listener dies, the sensors process keeps it registered: a new hexagonrpcd cannot attach until the SLPI restarts.
  • Rate selection. The SSC runs a sensor at the next supported rate at or above the request: 500 Hz runs the ICM-42688 at 512 Hz, 512 or 1000 Hz at 1024 Hz.
  • Timestamps. QTimer ticks (19.2 MHz), the same counter as the AP's arch timer.
Unit (all in pico4-sensors.target) Runs
pico4-slpi.service remoteproc-boot slpi
pico4-sensorspd.service hexagonrpcd on a runtime copy of /usr/share/qcom/pico4 with the stock kernel's socinfo names; restarted whenever it ends, because it ends successfully when the DSP restarts
pico4-imu-ready.service pico4-imu wait --timeout 120: until the sensor service lists the accelerometer and gyroscope

pico4-session.service and pico4-monado.service start after the target: a driver that probes before the IMU is listed falls back to Monado's simulated headset, whose display SteamVR cannot find. The units start only where /sys/class/remoteproc and the sensor data exist (not in QEMU).

DSP restarts. An SLPI restart (or a second without IMU samples) makes the driver report the head pose untracked, orientation still valid, while its IMU thread reconnects in short steps (a service stop never waits for the DSP). The station and cameras stay as they are; the stream returns once the restarted DSP lists the IMU again.

Running it

The sensor units start at boot.

pico4-imu list accel gyro mag          # sensors and attributes the DSP reports
pico4-imu stream --seconds 10 --check --orientation [--csv imu.csv] [--rate 1000]
pico4-imu raw ble_mcu                  # any sensor type, events decoded generically

stream requests 500 Hz unless --rate says otherwise. --check (for a headset lying still) fails unless both streams deliver half the expected samples, the DSP configured at least 95% of the requested rate, the measured rate is within 5% of it, no timestamp goes backwards, |g| is within 0.5 m/s² of 9.81 and each mean angular rate component is below 0.05 rad/s.

overpressure dev check (hardware-testing.md) records the sensor units and pico4-imu list accel gyro, requires pico4-imu stream --rate 500 --seconds 10 --check, and continues with Valve's session (session.md).

Verified results

On the headset on Valve's kernel, lying still.

Check Result
Sensors reported ICM-42688 accel/gyro 12.8–512 Hz, ICM-42688 temperature, AK0991x magnetometer 10–100 Hz
pico4-imu stream --check, 500 Hz, 10 s 5,066 samples per stream at 511.95 Hz, 0 gaps, 0 non-monotonic timestamps; |g| 9.796–9.797 m/s²; mean |ω| 0.005–0.006 rad/s
1 kHz request DSP configures 1000 Hz, measured 1023.9 Hz
pico4-imu orientation roll/pitch within 0.8° of the accelerometer's; uncorrected heading drift about −0.07°/s; a guided 90° turn reads +90.3 to +90.5°