gateway: fix dropped audio by sharing one data-session per direction#9
Draft
Copilot wants to merge 1 commit into
Draft
gateway: fix dropped audio by sharing one data-session per direction#9Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Agent-Logs-Url: https://github.com/pexip/doppler/sessions/be8e6a52-5f9c-454c-b13f-571c891c797e Co-authored-by: havardgraff <1926313+havardgraff@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
havardgraff
May 19, 2026 13:42
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
pulse_gateway, audio frames were arriving on each leg's OUTPUT but never made it across to the other leg's INPUT, while video forwarded fine.Root cause
open_data_sessions()calledpulse_data_session_connect_input()twice on the samePULSE_MEDIA_CONTENT_MAINslot — once with an audio-only config, then once with a video-only config. Each MAIN slot holds exactly one input config (and one output config); the second call silently replaces the first. The input session ended up video-only, so every audiopush_frame()was dropped. Same shape of bug on the output side.Changes in
src/gateway.cppmake_input_config()/make_output_config()that describe audio and video together viaPULSE_DATA_SESSION_AUDIO_FROM_VALUES_VIDEO_FROM_VALUES(input) and..._VIDEO_FROM_CAPS(output).open_data_sessions()now issues exactly oneconnect_inputand oneconnect_outputper leg.PulseErrorreturns fromconnect_input,connect_output, andpush_frameare checked and logged to stderr (push errors are rate-limited 1-in-100). The original silent-drop would have been obvious from day one had these been checked.kVideoCapsand the audio config.The per-frame
update_configmechanism for video resolution changes is unchanged:PulseDataSessionFramecarriesaudioandvideoPulseDataSessionFrameDataside by side, so one shared session per direction is what the API actually expects.