-
Notifications
You must be signed in to change notification settings - Fork 46
fix(llc): pause audio playout when leaving call to release iOS audio session #1155
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
fix(llc): pause audio playout when leaving call to release iOS audio session #1155
Conversation
📝 WalkthroughWalkthroughPauses iOS audio playout during RTC manager disposal so the iOS audio session is released when leaving a call, preventing the microphone from remaining unusable for other audio packages. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
Hi @Umair-Syed, thanks for taking the time to contribute this! If you’re okay spending a bit more time on it, I think the If you’d prefer not to spend any more time on this, just let us know—we can open a separate PR that builds on your changes. Thanks again! |
Thanks! Sure, I’ll take care of it and update as soon as I get the time. |
56b3a61 to
ce34c92
Compare
ce34c92 to
d6f3151
Compare
@Brazol I updated the PR as per your suggestions. Please check and let me know if there is anything else. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1155 +/- ##
========================================
- Coverage 6.44% 6.44% -0.01%
========================================
Files 600 600
Lines 41975 41978 +3
========================================
Hits 2705 2705
- Misses 39270 39273 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Brazol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎯 Goal
Fixes #1151 - iOS: Microphone becomes unusable for other audio packages after leaving a call with 2 participants.
When another participant speaks during a call, WebRTC's Audio Device Module (ADM) starts audio playout. When the call ends, the ADM's playout Audio Unit continues to hold a reference to AVAudioSession, blocking other audio packages (like
record,flutter_sound) from accessing the microphone. This results in silent recordings (0.00 amplitude) with no microphone indicator appearing.🛠 Implementation details
Added
pauseAudioPlayout()call in the_clear()method to stop the ADM's audio playout before disposing other resources.On iOS,
AVAudioSessionis a shared resource that manages both input (microphone) and output (speaker). When remote audio is played, the ADM creates an Audio Unit that holds an active reference to the audio session. Without explicitly stopping this playout viapauseAudioPlayout()(which calls[adm stopPlayout]on the native side), the Audio Unit continues to "own" the audio session even after the call ends.The fix ensures the audio output is properly stopped, releasing the audio session so other packages can take over.
🎨 UI Changes
No UI changes - this is an internal audio session management fix.
🧪 Testing
Steps to reproduce the issue (before fix):
stream_video_flutterand another audio recording package (e.g.,record)Steps to verify the fix:
Test patch for verification