Calls: spec 15.30, video that steps down for a weak connection and back up
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+126
−0
docs/superpowers/specs/2026-09-07-meet-design.md+126 −0
diff --git a/docs/superpowers/specs/2026-09-07-meet-design.md b/docs/superpowers/specs/2026-09-07-meet-design.md| index 7b184b3..1fcd68d 100644 |
| --- a/docs/superpowers/specs/2026-09-07-meet-design.md |
| +++ b/docs/superpowers/specs/2026-09-07-meet-design.md |
| @@ -3101,3 +3101,129 @@ get there first), and `TestNativeMacIceBrowser` (both, the app as an old |
| one, the browser's recovery off). An 80 s block checks the minute-later |
| sentence and "may be on an old version". |
| + |
| +### 15.30 §15.19, §15.26, §5.4 — video that steps down for a weak connection, and back up (2026-10-28) |
| + |
| +**Why.** A Dublin–London call: the guest on café Wi-Fi in Safari, relayed, |
| +round trips of 840–1300 ms, and 0–7 freezes every thirty seconds in Paul's |
| +video on the guest's side. Audio mattered most, and nothing gave way to it. |
| +Paul, 2026-10-28, approved: "Low-bandwidth with auto-switching up and down." |
| + |
| +**Decision: receiver-driven, per sender.** The call is a mesh, so every pair |
| +has its own sender, and the one who can see a picture suffering is the |
| +person receiving it. Each receiver watches what arrives from each sender |
| +and asks that sender for one of four levels; the sender sets that one |
| +connection's sender parameters (`maxBitrate`, `maxFramerate`, |
| +`scaleResolutionDownBy`, `active`, and for a screen the degradation |
| +preference). Sender parameters only: nothing renegotiates. Audio is never |
| +reduced, and keeps Opus's in-band FEC, whose packet-loss expectation |
| +libwebrtc already takes from the receiver's own reports (neither WebRTC |
| +build offers a sender parameter for it). |
| + |
| +| Level | Camera | Shared screen | |
| +|---|---|---| |
| +| normal | as before (§5.4's cap beside a screen) | as before (§5.4, §15.27) | |
| +| reduced | at most 640×360, 15 fps, 350 kbit/s; while sharing, as minimal | its size kept, 10 fps, at most 1.2 Mbit/s | |
| +| minimal | at most 320×180, 8 fps, 120 kbit/s; while sharing, none | 5 fps, at most 500 kbit/s, long side at most 1280 | |
| +| audio | none to this receiver (`active=false`) | as minimal: never paused | |
| + |
| +The camera is fitted by its long and short sides, so a portrait camera is |
| +boxed 360×640. A screen gives up frame rate first and holds resolution |
| +under pressure (`maintain-resolution`), because a screen is for reading; |
| +the apps' level fit for H.264 (§15.21, §15.27) is kept wherever it is the |
| +larger scale. If a screen cannot fit, the camera goes first. |
| + |
| +**The watch** (room.js `adapt*`, the apps' `VideoAdapt`, twins with the |
| +same named constants and unit tests on a fake clock either side). Once a |
| +second, from the stats walk each client already makes for the quality |
| +report, one sample per sender: camera freezes and their duration, the |
| +keyframes this side asked for the camera (PLI and FIR), packets and loss |
| +across audio, camera and screen, the selected pair's round trip, the audio |
| +jitter buffer's mean delay, frames decoded and dropped. Freezes and |
| +keyframe asks count only while the camera is watched — on, and the page or |
| +app in front: a still screen's gaps, and a hidden tab's unpainted frames, |
| +are not freezes. A second with nothing arriving and nothing measured is no |
| +news either way (a connection that is down is §15.28's). |
| + |
| +- *Trouble*, over the last 10 s at the current level: 2 or more freezes, |
| + 2 s or more frozen, 3 or more keyframe asks, more than 5% loss, a median |
| + round trip of 600 ms or more with a freeze, a jitter buffer of 500 ms or |
| + more, or a quarter of frames dropped (at least ten). *Severe*: 5 freezes, |
| + 4 s frozen, or more than 15% loss. |
| +- *Down*: one level once the window at a level has been trouble for 10 s; |
| + two at once for severe trouble after 5 s. The watch starts again from |
| + nothing at each new level. |
| +- *Up*: one level after 45 s of clean seconds in a row (no freeze, no |
| + keyframe ask, loss at most 2%, round trip under 400 ms, jitter buffer |
| + under 300 ms), as a probe. Trouble within 20 s of a probe (judged on at |
| + least 5 s of it) steps straight back and doubles the wait before the |
| + next, to at most 5 minutes; a probe that holds puts the wait back to 45 s. |
| +- Available incoming bitrate is not used: no browser and neither app |
| + exposes it (send-side estimation). |
| + |
| +The gate measured, on a 60 kbit/s downlink cap (an encoded transform |
| +dropping what does not fit, `lowbandwidth`): normal to minimal 3 s after |
| +the cap (severe), the camera at 180 lines, audio arriving throughout; |
| +minimal to reduced 57 s after the cap was lifted (a freeze 9 s after the |
| +lift restarted the clean run). |
| + |
| +**The person's own choice.** "Video quality" in the Devices panel, on the |
| +web, the Mac and the iPhone, remembered (the browser's device preferences; |
| +the apps' `videoQuality` default): *Auto* (the default), *Low bandwidth* |
| +(minimal from everyone, or lower if the watch says so), *Audio only* |
| +(audio from everyone, and this client's own camera to nobody, reported as |
| +camera off). |
| + |
| +**Signalling.** §15.19's `media` report gains one more optional member, |
| +`video`: an object of peer id to `"reduced"`, `"minimal"` or `"audio"`, |
| +listing only the peers asked for less than normal. Validated as |
| +`noSoundFrom` is held, by a token walk: an object (never `null`, never an |
| +array), well-formed peer ids, none repeated, at most fifteen, each value |
| +one of the three strings; anything else 400. Ids are checked for shape, |
| +not presence. `{}` and absent are both "normal from everyone" and compare |
| +equal; a change in any entry is a change. Re-encoded last, keys in order |
| +(`muted`, `cameraOff`, `audioBlocked`, `noSoundFrom`, `screenStalled`, |
| +`hearing`, `video`). The raw payload cap is 4 KB: every list and the map |
| +full is about 2,450 bytes. A sender reads its own id in each report it is |
| +given — the roster's and every `media` event — and applies the level to |
| +that connection, and to a connection made later, once it settles. |
| + |
| +**What is shown.** |
| + |
| +- On the receiver, the tile of anyone this client asks for less: a quiet |
| + "Low bandwidth" badge by the name (the vendored badge on the web), its |
| + title and the tile's VoiceOver label saying why ("Asking Ana for less |
| + video while your connection is weak", or "…as your Video quality setting |
| + says"). At audio only, the camera-off cover's shape with "Video paused to |
| + keep audio clear". |
| +- On the sender, once per change for the worse and for eight seconds: "Sending |
| + reduced video to David (their connection is weak)" — "Sending only audio |
| + to …" when it is all audio — the web's quiet status line, the apps' |
| + toast, said politely to a screen reader. Nothing is said on the way back |
| + up. |
| + |
| +**Mixed versions.** Old clients ignore the member (§15.19's decoders drop |
| +unknown keys; the apps' `PeerMedia` reads it leniently, so a malformed one |
| +costs nothing). A server from before this section refuses a report |
| +carrying it (400): the browser drops every extra for the page (§15.20), and |
| +the apps' core drops `video` first and resends the report, keeping |
| +`hearing`, then the rest as before. An app from before 0.4.14 receives the |
| +asks and ignores them, so it cannot be made to send less: a receiver at |
| +audio only still covers its picture (saving this device's work, not the |
| +connection), and the cover adds "Their app can't send less video, so it's |
| +only hidden here". A browser is always new. |
| + |
| +**Telemetry.** §15.26's per-peer `events` gain `askedSeconds` (how long |
| +this client asked the peer for reduced, minimal and audio, in that order) |
| +and `sentSeconds` (how long it sent the peer less because the peer asked): |
| +exactly three numbers each, bounded as seconds are, arrays rather than six |
| +members because the largest line has to fit the platform's 8 KB (now 8,084 |
| +bytes). The call's `events` gain `videoSetting` (`low`, `audio`; absent for |
| +Auto). The `calls: quality` line carries `videoAsked` and `videoSent` (the |
| +sums) and `videoSetting` on its top level, only when not zero or Auto; |
| +`quality-summary` prints them per person and per direction ("bbbbbb asked |
| +aaaaaa for Minimal for 4m0s"). |
| + |
| +**Not logged, not stored.** As §15.19; the levels are logged on the device |
| +(the browser's console, the apps' `connection` log) with six characters of |
| +the peer id. |