feat: fix voice join/leave, channel edit defaults, channel-update stream restart
Three bugs fixed across the full stack (proto/server/core/ABI/Win/macOS/iOS): 1. Join/Leave Voice now truly subscribes/unsubscribes from the voice plane. Previously the button only toggled the local mic — receiving was always on (gated by channel membership alone). Added a protocol-level voice subscription concept: new SubscribeVoiceRequest/UnsubscribeVoiceRequest/VoiceSubscriptionResult proto messages, User.voice_subscribed field, vc_join_voice/vc_leave_voice C ABI functions, VC_EVENT_VOICE_STATE event, server-side voice_subscribed flag checked by the SFU relay recipient filter, and core-client gating of remote-stream decoder setup. All three clients rewired to subscribe+mic on Join / unsubscribe on Leave. Text chat works regardless of voice subscription. 2. Channel edit dialog now shows the channel's actual current settings. The read struct vc_channel was missing sort_order and audio fields — only the write struct vc_channel_info had them. Extended vc_channel with both (additive, no ABI break), updated the session model and list_channels marshaling to populate them, and updated all three clients' edit callers to use actual channel info instead of hardcoded defaults. 3. Channel parameter updates now automatically restart everyone's streams. Previously editing a channel's audio config persisted and broadcast a ChannelEvent::UPDATED, but no layer restarted streams — encoders/decoders are frozen at announce time. handle_channel_event now detects audio-config changes on the user's current channel and stop->starts each active local stream. The server reads the updated config on re-announce; peers wire up fresh decoders at the new ssrc. All 29 CTest tests pass; Windows DLL + C# client build clean. Apple clients not yet compile-verified (Windows environment).
This commit is contained in:
32
PROGRESS.md
32
PROGRESS.md
@@ -10,6 +10,38 @@ up instantly. Newest status at the top.
|
||||
|
||||
## ▶ Where we left off / next action
|
||||
|
||||
- **Done (2026-06-24):** **Three bug fixes — voice join/leave, channel edit defaults, channel-update stream restart.**
|
||||
1. **Join/Leave Voice now truly subscribes/unsubscribes from the voice plane.** Previously
|
||||
"Join Voice" only started the local mic — receiving was always on (gated by channel
|
||||
membership alone). Added a protocol-level voice subscription concept: new
|
||||
`SubscribeVoiceRequest`/`UnsubscribeVoiceRequest`/`VoiceSubscriptionResult` proto messages
|
||||
(`core/proto/voicecat.proto`), `User.voice_subscribed` field, `vc_join_voice`/`vc_leave_voice`
|
||||
C ABI functions (`core/include/voicecat.h`), `VC_EVENT_VOICE_STATE` event, server-side
|
||||
`voice_subscribed_` flag on `ConnSession` checked by the SFU relay's recipient filter
|
||||
(`SessionRegistry::find_channel_sessions` excludes non-subscribers; `MediaRelay::on_udp_frame`
|
||||
also skips non-subscribed senders). The core client gates `sync_remote_streams` on
|
||||
`voice_subscribed_`, tears down all remote decoders + stops local streams on leave, and
|
||||
re-syncs from the session model on join. All three clients (Windows/macOS/iOS) rewired
|
||||
their Join/Leave Voice button to call `joinVoice`+start mic / `leaveVoice`+core stops mic.
|
||||
The configured input mode (PTT/VAD/AlwaysOn) takes effect on join — no extra mic button.
|
||||
Text chat works regardless of voice subscription. **Apple clients not yet compile-verified
|
||||
(Windows environment).**
|
||||
2. **Channel edit dialog now shows the channel's actual current settings.** The read struct
|
||||
`vc_channel` (`voicecat.h`) was missing `sort_order` and `audio` fields — only the write
|
||||
struct `vc_channel_info` had them. Extended `vc_channel` with both (additive, no ABI break),
|
||||
updated the session model (`session::Channel`) and `apply_snapshot`/`apply_channel_event`
|
||||
to populate them, and updated `vc_list_channels` marshaling. All three clients now build
|
||||
the edit descriptor from the actual channel info instead of hardcoded defaults.
|
||||
3. **Channel parameter updates now automatically restart everyone's streams.** Previously
|
||||
editing a channel's audio config (codec/bitrate/sample-rate/FEC/DTX/etc.) persisted and
|
||||
broadcast a `ChannelEvent::UPDATED`, but no layer restarted streams — encoders/decoders
|
||||
are frozen at announce time. `handle_channel_event` (`core/src/core/client.cpp`) now
|
||||
detects audio-config changes on the user's current channel and calls
|
||||
`restart_active_streams_for_channel`, which stop→starts each active local stream. The
|
||||
server reads the updated channel config on re-announce, and peers' `sync_remote_streams`
|
||||
wire up fresh decoders at the new ssrc. The `LocalStream` struct now retains the stream
|
||||
label across restarts. No server or protocol change needed.
|
||||
|
||||
- **[ ] Soon — jitter buffer should measure REAL arrival jitter (RFC 3550), not sender
|
||||
timestamps.** `JitterBuffer::push` (`core/src/audio/audio_engine.cpp:84-108`) estimates
|
||||
jitter from `gap = ts - last_push_ts_`, where `ts` is the **sender's timestamp** — which is
|
||||
|
||||
Reference in New Issue
Block a user