14. Version History · MRRC Passport terminal · design record (SDD)

English · 简体中文

14. Version History

Newest first. This is an evidence ledger, not a changelog: the user-facing release notes are in ../docs/CHANGELOG.md, and they deliberately do not contain hypotheses, dead ends or counter numbers. Each row here does, because the useful part of a fix is the part that shows what other explanations were eliminated.

Row shape (chapter 00 §V4): symptom → what was believed → what the measurement showed → root cause (file:function) → fix → measured result → boundary, i.e. what was not done.

Version Date Author Changes
SDD V0.2 2026-11-23 pi The design record gets its structure: chapters 03, 06, 09, 11, 13, 14 (batch 2). ① Symptom: the repository had the content of a design record and none of its form — numbers inside 893 lines of narrative, constraints as a numbered list, incident history only in a user-facing changelog; nothing could be cited by ID and nothing could be tested. ② What was believed: that docs/optimization-notes.md was already the design record, because it held the numbers. Measurement of the document showed otherwise: 0 traceable IDs, 0 verification columns, 0 statements of what was rejected, and no place where a wrong belief was recorded as wrong. ③ Root cause: prose has no schema, so nothing forced a claim to carry its conditions. ④ Fix: chapter 00 (V1–V9) as a normative local amendment, then 31 requirements with numeric targets and verification methods (05), 8 decisions with alternatives and costs (08), the transmit model (15), and now success criteria (03), use cases (06), runtime shape (09), module invariants (11), risks/assumptions/issues (13) and this ledger. ⑤ Enforcement: 10 structural tests in the guardian selftest (43 total) plus the sdd: ref grammar, so brief main/mrrc_net.c returns AD-004/NFR-015/§15.3 instead of prose. The tests rejected 6 of my own draft rows on first run — targets written as text (“Up to three”), 5 untraced requirements, and a citation of the then-unwritten chapter 14 — all corrected in place. ⑥ Boundary: chapters 01/04/12 remain unwritten and are marked pending, not stubbed; the ledger below back-fills the engineering rounds from the notes, it does not add new measurements.
2026-11-22 2026-11-22 pi Transmit died a few seconds in; the key was innocent (AD-004). ① Symptom: press PTT, the TX indicator goes out after a few seconds while the key is still held. ② What was believed: a key/debounce fault — three rounds of key handling were examined first. The button log refuted it: one press, held=16549425us, no release event until the operator let go. ③ What the measurement showed: tx: frames=78 sendfail=71, esp_transport_write() returned 0, timeout_ms=1000, then /WSterminal error → disconnected and a reconnect every ~2 s, while the receive side stayed clean (err=0 drop=0, i2s 46.5 f/s). So one direction was dead, not the key. ④ Root cause: the server fanned the radio’s RX audio to the terminal socket regardless of PTT; during transmit that one TCP carried 32 KB/s up against 30 KB/s down, the downlink saturated the window, the uplink write blocked for a second, and esp_websocket_client treats a write failure as fatal. ⑤ Fix: server skips downlink for the keyed socket (half duplex, not counted as a drop); device uplink timeout 500 → 100 ms (mrrc_net.c). ⑥ Result: one 30.5 s transmission — frames=1500 sendfail=0 readfail=0, 50.0 frames/s, send_max=27857us, slow=0, zero W/E lines in the window. Boundary: the mobile link itself (6.5–12% loss, RTT 6–10 s) is not fixable and is not claimed fixed; Mic gain was left at 36 dB in that run, so peak=32768 clipping is recorded separately (chapter 15 §15.4).
2026-11-22 2026-11-22 pi The repaint, not the panel, was the CPU (chapter 05 §5.4). ① Symptom: taskLVGL 56–61%, IDLE 7–14% — far above what a 240×320 panel at 5.26 Hz should cost. ② What was believed: the panel SPI bandwidth, then the waterfall. Two instruments answered instead: bsp_display_flush_stats() showed 526 KB/s (3.5 screens/s) and bsp_display_flush_bands() localised it to per-segment cost. ③ What the measurement showed: freezing the trace dropped 25 CPU points while removing only a quarter of the flushed area — per-segment, not per-pixel. ④ Root cause: 240 single-pixel-ish segments per sweep in mrrc_ui.c, each with its own LVGL housekeeping. ⑤ Fix: 120 vertices 2 px apart at width 3; flush 526 → 344 KB/s, flushes 85 → 56/s, taskLVGL 42 → 28–30%, IDLE 29 → 42–45%. ⑥ Result: budget headroom for the network work that followed. Boundary: width 2 measured identically, so the line is not the remaining cost; the S-meter and chips were left alone because freezing them moved ≤5 points each.
2026-11-22 2026-11-22 pi Waterfall memory: 8-bit palette indices (AD-005). ① Symptom: 19 200 B of .bss in s_wf_buf — the largest single block — against a 16 KB handshake floor and largest at 27–42 KB. ② What was believed: that the history had to shrink to buy memory. ③ Measurement: the history is 40 rows × 240 px; RGB565 costs 2 B/px, an index costs 1 B/px plus a 1 024 B palette. ④ Root cause: pixel format, not history length. ⑤ Fix: uint8_t indices + lv_canvas_set_palette, heat_init() fills the ramp before the first consumer. ⑥ Result: 19 200 → 10 624 B, free 48 → 57–59 KB, largest 27–42 → 38–48 KB, cost 1–2 CPU points. Boundary: the trace path still uses RGB565 (a 240 Hz refresh of 4 B points is cheap); unifying the two formats would reintroduce the 19 200 B.
2026-11-22 2026-11-22 pi Several networks, chosen by audio health (AD-007). ① Symptom on a train, tethered to a phone: 6.5–12% packet loss, RTT peaks 6–10 s, 26–41 pings over one second in four minutes; audio stuttered and the session dropped. ② What was believed: that buffering would carry it, and that RSSI was a usable proxy. Both were refuted: ten seconds of 32 KB/s is 320 KB against 400 KB of SRAM, and an access point at −25 dBm was measured dropping ~10% of packets. ③ Root cause: one configured AP per station interface, and no metric that reflects audio health. ④ Fix: three (SSID, password) pairs from NVS/Kconfig, boot prefers the last known-good, switching triggered by sustained audio degradation. ⑤ Result: session survives where it previously dropped; frames are lost, the socket is not. Boundary: continuity is not claimed — the documented goal is graceful degradation; hysteresis thresholds are the open question and live in the code, not in this table.
2026-11-21 2026-11-21 pi Steady stutter in both directions: five independent causes (this is the round that produced docs/transport-tuning.md). ① Symptom: continuous stutter, initially blamed on the link. ② What was believed: insufficient TCP window and a slow CPU — both disproved (window 5760 vs 16384 measured the same; IDLE was already 38–46%). ③ Measurement, with a reference client on the same AP: the reference client received 31.3 KB/s audio / 50.2 KB/s total while the device received 25.6–28.6 KB/s. ④ Root causes, each fixed separately: receive queues behind the window full (LWIP_TCP_RECVMBOX_SIZE 6→8, OOSEQ 4→8, RX_BA_WIN 6→16, window 5760→11520); playback starting from an empty ring (160 ms pre-buffer, 200 ms re-buffer: ring-empty wakeups 3–5/s → 0–2/s); server pump stall 5791 ms → 3 ms once the device kept up; Nagle on the uplink (setsockopt never called — 100/323 sends >30 ms, worst 89 ms → 0–3/389–497 after TCP_NODELAY + send buffer 11520, worst 9–17 ms); a software TX gain stacked on the analog PGA (tx_mic_db 12 → 0: clipped samples 5% → 0, peak 100% → 40%). ⑤ Result: device throughput equal to the reference client. Boundary: the 5791 ms stall was a symptom of the receive queues, not a server bug; and the useful negative result is recorded — lowering the server gain to +3 dB increased clipping 5.0% → 5.8%, proving the ceiling was the ADC.
2026-11-20 2026-11-20/21 pi CPU and memory round: draw buffer, tick rate, fonts, bin size. ① Symptom: taskLVGL 58%, IDLE 14%, largest 44 KB and falling as features landed. ② What was believed: that a faster tick meant a better waterfall. ③ Measurement: the 10 Hz tick discarded 38% of the radio’s sweeps and interpolated 60% of the waterfall content — faster was less truthful, not better. ④ Fix: 190 ms tick (5.26 Hz) matched to the radio’s own sweep rate; draw buffer 8 → 24 lines (8 lines = 58% CPU; 32 lines = largest 18 KB, too little); fonts 3 faces (12/14/28) → 2 (12/44); statistics tick hook removed. ⑤ Result: taskLVGL 58 → 33–42% with a 1.6× higher truthful refresh, free 49–55 → 58–60 KB, largest 44 → 27–28 KB, bin 0x177de0 → 0x15b250 (114 KB smaller). Boundary: largest ended 16 KB below the start and that was accepted only because AD-005 later recovered 11 KB — the two changes are not independent and must not be read separately.
2026-11-19 2026-11-19 pi PCM16 replaces Opus (AD-002). ① Symptom: the receiver needed bitrate headroom that the CPU could not support. ② What was believed: that 12 kbps was worth the decoder cost. ③ Measurement: ≈24 KB heap and ≈60% of the core while decoding, against free 49–55 KB / largest 44 KB at the time. ④ Decision and ⑤ result: PCM16 at 256 kbps/direction; measured achievable throughput 31.3 KB/s audio — the codec was never the bottleneck. Boundary: a server that only speaks Opus cannot serve this terminal; that incompatibility is documented rather than patched around.
2026-11-18 2026-11-18 pi Hardware facts established (AD-003, chapter 09). ① Symptom: “the microphone is too quiet” — three days of software gain and filter work. ② What was believed: a weak microphone. ③ Measurement: the same capture code at 48 kHz peaks at 468/32767, at 16 kHz at 12 708 — a factor of 27, so the codec was nearly deaf at 48 kHz and the rate was the fault. ④ Fix: codec fixed at 16 kHz with 3:1 software bridges both ways; bsp_audio_set_format never called at runtime. Also measured the same day: no APLL, so MCLK from PLL_F160M ÷ 39 gives 16.03 kHz (0.16% fast — a 30-minute property, unprovable in a short session); no PSRAM, so a full framebuffer (153.6 KB) is impossible and largest is the binding constraint. Boundary: uplink aliasing above 8 kHz is accepted; the radio’s own TX bandwidth filter is far below it.

What this ledger is not

  • Not a release history. Tags, user-visible features and upgrade notes live in ../docs/CHANGELOG.md; this table would be a bad changelog and a good changelog makes a bad ledger.
  • Not complete. Rows exist for rounds that produced a measurement worth not re-deriving. An unremarkable change does not get a row, and the absence of a row is not evidence that nothing happened.
  • Not editable in place. A wrong row is corrected by appending to it with the new date and the measurement that superseded it (chapter 00 §V4); the old number stays visible, because the fact that we once believed it is part of the record.