fix(voice): release held packets within 20 ms once the speaker is named

Held packets were only processed before the same SSRC's next packet, so
a short first utterance that ended before Discord's Speaking op came was
dropped after a second. The UDP task now also releases every newly named
SSRC's held packets on its 20 ms playout tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-18 16:22:30 +09:00
parent 2a95f58a0e
commit 9199ccbd0e
4 changed files with 63 additions and 12 deletions

View File

@@ -140,7 +140,8 @@ and the late "left" update cancelled the new join (seen on real Discord).
it could not yet decrypt, which cut the first ~100 ms off the first thing each person said after a
join (live 2026-11-18: "자비스" heard as "아비"). The app therefore uses songbird 0.6.1 with a patch
(`app/vendor/songbird`, `JARVIS-PATCH.md`): packets of an SSRC not named yet are held, at most one
second and 50 packets for each of at most 32 SSRCs, and processed in arrival order once it is named;
second and 50 packets for each of at most 32 SSRCs, and processed in arrival order once it is named
(before its next packet, or within 20 ms when none follows, as after a short first utterance);
the Speaking event goes out first, so the core knows the speaker before their held packets come.
The core takes each decrypted RTP packet with songbird's exact payload bounds:
- Packets go through a per-speaker reorder window in sequence-number order. A missing packet is