Skip to content

Removing mic perms check logic - #204

Closed
hiroshihorie wants to merge 1 commit into
m137_releasefrom
hiroshi/remove-blocking-mic-check
Closed

Removing mic perms check logic#204
hiroshihorie wants to merge 1 commit into
m137_releasefrom
hiroshi/remove-blocking-mic-check

Conversation

@hiroshihorie

Copy link
Copy Markdown
Member

Perhaps we should move this logic to the SDK side with extra logic.

@hiroshihorie

Copy link
Copy Markdown
Member Author

Superseded by #265, which forward-ports this change to m144_release (the line currently shipped: webrtc-xcframework is on 144.7559.x and the Swift SDK pins it). m137_release is no longer built, so closing this in favor of #265.

hiroshihorie added a commit that referenced this pull request Jul 9, 2026
…eck (#265)

Forward-port of #204 (originally targeting `m137_release`) to
`m144_release`, which is the line currently shipped by the LiveKit Swift
SDK (`main` pins `144.7559.10`). The blocking call was never ported
forward, so it still lives on `m144_release`.

## Problem

`EnsureMicrophonePermissionSync()` blocks the WebRTC worker thread on a
semaphore (`dispatch_semaphore_wait(…, DISPATCH_TIME_FOREVER)`) until
the user answers the mic permission dialog. When the app is woken in the
background (e.g. an incoming CallKit call), no dialog can appear, so
`setEngineAvailability` hangs indefinitely.

Ref: livekit/client-sdk-swift#815

## Change

Replace the blocking request with a passive
`IsMicrophonePermissionAuthorized()` check in the AudioEngine pre-enable
path. When the mic is not authorized it returns
`kAudioEngineErrorInsufficientDevicePermission` instead of blocking. The
(dead) `IsMicrophonePermissionGranted()` is renamed into that check; it
had no other callers.

Only the `.notDetermined` case changes behavior: previously it prompted
and blocked the worker thread; now it returns an error immediately.
`authorized` and `denied`/`restricted` are unchanged.
cloudwebrtc pushed a commit that referenced this pull request Jul 16, 2026
…eck (#265)

Forward-port of #204 (originally targeting `m137_release`) to
`m144_release`, which is the line currently shipped by the LiveKit Swift
SDK (`main` pins `144.7559.10`). The blocking call was never ported
forward, so it still lives on `m144_release`.

## Problem

`EnsureMicrophonePermissionSync()` blocks the WebRTC worker thread on a
semaphore (`dispatch_semaphore_wait(…, DISPATCH_TIME_FOREVER)`) until
the user answers the mic permission dialog. When the app is woken in the
background (e.g. an incoming CallKit call), no dialog can appear, so
`setEngineAvailability` hangs indefinitely.

Ref: livekit/client-sdk-swift#815

## Change

Replace the blocking request with a passive
`IsMicrophonePermissionAuthorized()` check in the AudioEngine pre-enable
path. When the mic is not authorized it returns
`kAudioEngineErrorInsufficientDevicePermission` instead of blocking. The
(dead) `IsMicrophonePermissionGranted()` is renamed into that check; it
had no other callers.

Only the `.notDetermined` case changes behavior: previously it prompted
and blocked the worker thread; now it returns an error immediately.
`authorized` and `denied`/`restricted` are unchanged.
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