-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Labels
Description
Body:
Description
When calling room.disconnect() on Mac Catalyst, the app crashes with EXC_BAD_ACCESS in the WebRTC audio device
module. This does not occur on iOS - only Mac Catalyst.
Environment
- SDK Version: 2.10.1
- Platform: Mac Catalyst (iOS app running on Mac)
- macOS: Sequoia 15.x
- Xcode: 16.x
Crash Details
LiveKitWebRTC`___lldb_unnamed_symbol14016:
-> 0x104242384 <+0>: str xzr, [x0, #0x40]
0x104242388 <+4>: ret
worker_thread: EXC_BAD_ACCESS (code=1, address=0x40)
Console Output Before Crash
AudioHardware-mac-imp.cpp:773 AudioObjectGetPropertyData: no object with given ID 113
AVAEInternal.h:83 required condition is false: [AVAudioEngine.mm:1269:CheckCanPerformIO: (canPerformIO)]
AudioEngineDevice setVoiceProcessingEnabled error: (null)
Reproduction Steps
- Run iOS app on Mac via Catalyst
- Connect to a LiveKit room with audio
- Start a voice session (microphone enabled)
- Call
room.disconnect()or end the session - App crashes immediately
Minimal Code
// Simple disconnect - crashes on Mac Catalyst
await room.disconnect()
What I've Tried
- Adding delays before/after disconnect (100ms to 1000ms)
- Disabling microphone before disconnect
- Clearing room references before disconnect
- Using setRecordingAlwaysPreparedMode(true)
- SDK versions 2.8.1 and 2.10.1
None of these workarounds prevent the crash.
Analysis
The crash appears to be in the WebRTC audio device module trying to access an aggregate audio device (ID 113) that
has already been destroyed. The worker_thread is still running when the audio device cleanup occurs, causing a
dangling pointer access at offset 0x40.
Expected Behavior
room.disconnect() should cleanly disconnect from the room on Mac Catalyst without crashing.
Workaround
Currently none - the only option is to disable Mac Catalyst support.
---pblazej and hiroshihorie