Skip to content

Configure the audio session from the resolved voice processing state - #1086

Draft
hiroshihorie wants to merge 5 commits into
mainfrom
hiroshi/vp-resolved-session-mode
Draft

Configure the audio session from the resolved voice processing state#1086
hiroshihorie wants to merge 5 commits into
mainfrom
hiroshi/vp-resolved-session-mode

Conversation

@hiroshihorie

@hiroshihorie hiroshihorie commented Aug 13, 2026

Copy link
Copy Markdown
Member

willEnableEngine now carries isVoiceProcessingEnabled (webrtc-sdk/webrtc#275, shipped since 144.7559.12). The adapter hands it to AudioSessionEngineObserver before the observer chain runs, so the session mode is always configured from the state the ADM actually resolved, never a Swift-side guess. This is the simplification planned in #1072.

Deleted with that: updateExpectedPlatformVoiceProcessing including its simulator special case and the requestsPlatformEchoNoisePath && isPlatformVoiceProcessingAllowed mirror of the ADM's resolution, its call sites in setRecordingAlwaysPreparedMode, startLocalRecording, and LocalAudioTrack.setAudioProcessingOptions, and AudioProcessingOptions.requestsPlatformEchoNoisePath with its tests. Net -80 lines.

Kept: the direct push in setPlatformVoiceProcessingAllowed(false), since VPIO teardown there happens without an engine transition, so no callback would fire to update the session. The observer state is renamed from isPlatformVoiceProcessingExpected to isPlatformVoiceProcessingActive to match the resolved semantics.

No public API changes. Passing the state through the public AudioEngineObserver chain was deliberately deferred: adding a parameter to engineWillEnable breaks existing conformers, and a defaulted overload silently drops the value whenever a chain contains an old-style observer. A context-struct redesign is the right public evolution if consumers need the state.

webrtc-sdk PR 275 added isVoiceProcessingEnabled to the delegate
method, so frameworks built past 144.7559.11 fail protocol conformance
without this. The parameter is ignored for now, exposing it through
AudioEngineObserver is a separate API addition.
First framework release without the ADM's own blocking mic permission
request (webrtc-sdk PR 265). The SDK-side request landing via #1085 must
merge before this so fresh installs still get a prompt.

Closes #815
…state

The willEnableEngine delegate callback carries the resolved state since
144.7559.12 (webrtc-sdk PR 275), so the adapter hands it to the session
observer before the observer chain runs and the whole Swift-side
prediction is deleted: updateExpectedPlatformVoiceProcessing with its
simulator special case, the calls in setRecordingAlwaysPreparedMode and
startLocalRecording, the LocalAudioTrack.setAudioProcessingOptions push,
and AudioProcessingOptions.requestsPlatformEchoNoisePath with its tests.
This is the simplification planned in #1072.

The direct push in setPlatformVoiceProcessingAllowed(false) stays, since
VPIO teardown there happens without an engine transition, so no callback
would fire to update the session.

The observer state is renamed from isPlatformVoiceProcessingExpected to
isPlatformVoiceProcessingActive to match the resolved semantics.
@hiroshihorie hiroshihorie changed the title Update WebRTC to 144.7559.12 and configure the audio session from the resolved voice processing state Configure the audio session from the resolved voice processing state Aug 13, 2026
@hiroshihorie
hiroshihorie marked this pull request as ready for review August 14, 2026 06:51

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

…ession-mode

# Conflicts:
#	LiveKitClient.podspec
#	Package.swift
#	Package@swift-6.2.swift
#	Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift
@hiroshihorie
hiroshihorie marked this pull request as draft August 18, 2026 09:10
@hiroshihorie

Copy link
Copy Markdown
Member Author

Converting to draft for now, the delivery logic here may change (mid-capture VP toggles don't re-fire willEnableEngine, likely addressed via an upstream event in a future WebRTC build).

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.

2 participants