mirror of
https://github.com/TelegramMessenger/tgcalls.git
synced 2026-11-18 21:35:28 +00:00
A device log (2026-09-22) showed a tile frozen after its endpoint was requested again: two endpoints received zero RTP for 9 s and 48 s while every client-side step (transceiver, receive stream, demuxer entries, sink proxy, constraints resent 3-4 times over a healthy data channel) matched the earlier requests that worked. The fix for unsignaled receive streams (a029775) held: none of its log signatures appear. What differs from CustomImpl is the ReceiverVideoConstraints message. ReferenceImpl sent minHeight = maxHeight = 90/180/360 from maxQuality alone and no onStageEndpoints; CustomImpl sends minHeight from minQuality and maxHeight from maxQuality on the 180/360/720 layer scale, and puts Full endpoints on stage. The app always requests minQuality .thumbnail and a .thumbnail max for most grid tiles, so this engine asked for maxHeight 90, below the lowest simulcast layer. It now sends CustomImpl's message, and logs the whole JSON instead of a count, so the next such log shows exactly what was asked. Causation on the production SFU is inferred: the log carried no requested qualities. The testbench could not catch it. The Go SFU mapped heights on ReferenceImpl's own scale (90/180/else) and emitted idealHeight on it, and the harness always requested Full/Full. Now: - go_sfu: heights map onto layerHeights {180, 360, 720}, and a positive maxHeight below 180 forwards nothing (logged). Deliberately strict: a client sending an off-scale height fails the run. A request that maps to no layer also stops and removes the pair's LayerSelector; before, forwarding continued on the surviving selector, because forwardRTP prefers selectedLayer, so dropping an endpoint never stopped its video at the SFU. - cli: --video-quality thumbnail|medium|full requests that max with minQuality Thumbnail, the app's shape. Negative control: old engine + new SFU, --participants 0 --reference-participants 2 --video --video-quality thumbnail gives Video received 0/2 (SFU logs maxHeight 90 refused). With the fix 2/2. Also green: medium/full, mixed and custom-only thumbnail, mixed default, early request, 6-participant re-request (0/30 stalled, both default and thumbnail), sink churn, capture + own video, e2e, step-down-up, group-churn, late unmute; go test ./... Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commita024eaabf1) Already in dev/android (via 45fc400/120e384), left as is: CLAUDE.md tools/cli/main.cpp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>