这是indexloc提供的服务,不要输入任何密码
Skip to content

Audio capture latency reduction #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 29, 2025
Merged

Conversation

ladvoc
Copy link
Contributor

@ladvoc ladvoc commented May 27, 2025

This PR aims to solve the outstanding audio capture latency issue. Recently, #122 fixed an issue related to video capture that was causing broader performance impacts, leading to high audio latency over time when both video and audio were enabled. Currently, audio samples are read using OnAudioFilterRead, enqueued, and then dequeued and captured via FFI on a dedicated thread. Based on the code history, it seems this might have been introduced as a fix for audio delay. With the issue from #122 fixed, this PR evaluates the performance of capturing directly from OnAudioFilterRead with no additional queuing on the Unity side; my initial testing on iOS and macOS shows this works well, delivering noticibly lower audio latency that does not increase over time.

I would like to discuss potential impacts of this change and test across more platforms. Also, it is worth noting since the last discussion about this in #62, the queue_size_ms option has been added by livekit/rust-sdks#425 but has not been adopted yet.

Related PRs and discussion in chronological order:

@ladvoc ladvoc requested a review from cloudwebrtc May 27, 2025 11:26
Copy link
Contributor

@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ladvoc ladvoc requested a review from bcherry May 27, 2025 23:13
@ladvoc ladvoc merged commit 14762d8 into main May 29, 2025
14 checks passed
@ladvoc ladvoc deleted the ladvoc/audio-latency-reduction branch May 29, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants