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

@@ -4,8 +4,9 @@ This is songbird 0.6.1 from crates.io (https://github.com/serenity-rs/songbird,
README), used through `[patch.crates-io]` in `app/Cargo.toml` and `app/shell/Cargo.toml`.
The one change: RTP packets of an SSRC that Discord has not named yet are held for up to a second
instead of dropped, and processed once its Speaking op names it (`src/driver/tasks/udp_rx/held.rs`,
`udp_rx/mod.rs` `process_udp_message`; `ws.rs` sends the Speaking event before naming the SSRC so
instead of dropped, and processed once its Speaking op names it: before the next packet, or on the
next 20 ms playout tick when none follows (`src/driver/tasks/udp_rx/held.rs`, `udp_rx/mod.rs`
`process_udp_message` and `release_named`; `ws.rs` sends the Speaking event before naming the SSRC so
handlers see the name before the held packets). Discord's Speaking op comes after a speaker's first
packets, and unpatched songbird dropped DAVE packets it could not yet decrypt, so the first ~100 ms
of the first thing each person said after a join were lost (live 2026-11-18: "자비스 서울 날씨 어때"