Repository navigation
feat: device-pulled remote audio playout - #14
Merged
Merged
Conversation
Applications that render remote audio themselves can now clock WebRTC from their output device instead of the synthetic device's 10 ms timer: - livekit::setExternalAudioPlayout(true) stops the internal timer pulls. - livekit::pullAudioPlayout() performs one 10 ms NeedMorePlayData on the caller's thread; remote track sinks (FreshAudioStream) complete before it returns, so the application reads the new frame immediately. One clock removes the drift and queue contention between the SDK timer and the device (dropped frames, extra 20 ms of priming). Default behaviour is unchanged; disabling external mode resumes the timer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Lets an application clock remote audio from its own output device (syrnike13-app issue #164).
livekit::setExternalAudioPlayout(bool)— stops/resumes the synthetic device's 10 ms timer pulls.livekit::pullAudioPlayout()— one synchronous 10 msNeedMorePlayDataon the caller's thread; remote track sinks (FreshAudioStream) complete before it returns.livekit_ffi_set_external_audio_playout,livekit_ffi_pull_audio_playout.Default behaviour is unchanged.
Verification (local, Windows):
cargo test -p libwebrtc --lib external_playout_delivers_remote_frames_before_return: 100 immediate reads on the caller thread, 0 queue drops, timer resumes after disabling.cargo test -p livekit --lib rtc_engine::lk_runtime::tests: one shared factory/ADM per process.ctest -R AudioSourceTest: 8 passed.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.