hey, what could be happening here? ``` We're seei...
# ask-ai
b
hey, what could be happening here?
Copy code
We're seeing macOS join failures on LiveKit SDK 2.7.2 (SwiftPM). Environment:

  - macOS 15.0 (24A335, "macOS 26" in System Settings)
  - MacBook Pro with built‑in microphone + Continuity iPhone microphone; no
  external audio software running.
  - App: Multitarget xcode project (builds and joins fine on iOS; macOS fails immediately).

  Repro steps:
  1. Launch the macOS app and attempt to join a room.
  2. WebSocket connects and we receive the join response, but the connection
  cancels instantly. No media ever starts.

  Console output (Debug build with `LiveKitSDK.setLoggerStandardOutput()`):


  🎙️ LiveKitVoiceClient configured AudioDeviceModule = platformDefault
  🎧 LiveKitVoiceClient initializing on macOS
  🎧 LiveKit Room instance: ObjectIdentifier(0x00000007e68700a0)
  🎧 LiveKit delegate added: ObjectIdentifier(0x00000007ea5e9180)
  🎙️ LiveKit available input devices: [default (MacBook Pro Microphone)
  [default], Mariano's iPhone Microphone [84], MacBook Pro Microphone [79],
  CADefaultDeviceAggregate-78496-0 [130]]
  🎙️ LiveKit selected default input device:  [default]
  🎧 LiveKitVoiceClient active on macOS)
  throwing -10877
  throwing -10877
  🎙️ VoiceCallManager.performJoin microphone permission result = true
  …
  2025-09-19T15:45:37+0200 info LiveKitSDK: [LiveKit]
  Room.connect(url:token:connectOptions:roomOptions:) Connecting to room...
  2025-09-19T15:45:37+0200 info LiveKitSDK: [LiveKit]
  Room.signalClient(_:didReceiveConnectResponse:) ServerInfo(edition:
  cloud, version: 1.9.1, protocol: 16, region: Germany, nodeID:
  NM_OFRANKFURT1A_HVHJnHb7FSxQ, debugInfo: )
  ❌ LiveKit connect failed with LiveKitError: Error Domain=io.livekit.swift-sdk
  Code=100 "Cancelled" …
  2025-09-19T15:45:37+0200 error LiveKitSDK: [LiveKit]
  SignalClient.requireWebSocket() WebSocket is nil
  2025-09-19T15:45:37+0200 error LiveKitSDK: [LiveKit]
  Room.transport(:didGenerateIceCandidate:) Failed to send iceCandidate …
  Invalid state(connectionState is .disconnected)


  We consistently see the CoreAudio errors `throwing -10877`,
  `HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload`,
  and `CMIOHardware.cpp:331 … Error: 2003332927` immediately before the
  cancellation. Mic permission (via `AVAudioApplication`) is granted.

  Tried both LiveKit audio modules:
  - `.audioEngine` (set before Room init) → same error
-
.platformDefault
(current build, with fallback to
.audioEngine
if init
Copy code
fails) → same error

  We also explicitly select the built-in microphone, reset Audio MIDI Setup to
  48 kHz, and disabled the iPhone Continuity microphone. The failure persists.
t
Thanks for reaching out, Mariano.btc. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're experiencing the CoreAudio error
-10877
while working with macOS and LiveKit SDK 2.7.2. Although this specific error isn't well documented, let's explore some steps together that might help resolve it: • Try increasing the
queue_size_ms
parameter in your audio source configuration. This often helps reduce audio capture frame errors. • Double-check that the
AVAudioSession
is set up correctly. While the SDK usually handles this automatically, it’s worth verifying the session category and mode settings to be sure. • Since you’ve noticed the issue with both
.audioEngine
and
.platformDefault
modules, testing with a minimal app setup might help isolate where the problem lies. • Resetting the Audio MIDI Setup to 48 kHz was a great move! Also, please ensure that no other audio software or devices are conflicting with your default input/output settings. If the problem keeps persisting, feel free to share more details like full error logs, your environment setup, and steps to reproduce the issue. I’m here to help you get this sorted out! Sources: Getting Help | livekit/livekit_composite | DeepWiki | README.md
b
thanks! I don’t see a queue_size_ms knob exposed anywhere in AudioCaptureOptions or on AudioManager / RTC.audioDeviceModule (I grepped the 2.7.2 source in client- sdk-swift and didn’t find that symbol). If it’s tucked away in the WebRTC bridge, could you let me know the exact API surface I should call from Swift? Happy to wire it up once I know where it lives. - Regarding the AVAudioSession setup: on iOS we leave the session to LiveKit (and that’s still working great). The failure here is macOS-only; there’s no AVAudioSession to configure on this platform. We already tried both audio modules (.platformDefault first, falling back to .audioEngine) and explicitly selected the built-in mic, but CoreAudio still throws: throwing -10877 HALC_ProxyIOContext:IOWorkLoop skipping cycle due to overload CMIOHardware.cpp331CMIOObjectGetPropertyData Error: 2003332927 Those errors appear right before LiveKit reports LiveKitError(.cancelled) and the room disconnects. If there’s a macOS-specific hook (e.g. sample-rate forcing, queue sizing, or another HAL tweak) you recommend, let me know and I can integrate it. Otherwise I’m happy to gather additional logs or try out a patched build.
t
Thank you for reaching out! I wanted to let you know that the
queue_size_ms
parameter isn’t directly accessible in the Swift SDK, and unfortunately, there isn’t a macOS-specific API available to adjust it at this time. This parameter usually comes into play with lower-level audio configurations, but it seems it’s not something we can tweak in the current SDK version. As for CoreAudio HAL tweaks, there isn’t any official guidance or API to modify HAL properties to help with join failures or boost performance on macOS. The SDK’s macOS audio start workarounds, introduced in version 2.7.0, don’t have much detail beyond that, and version 2.7.2 hasn’t brought additional audio-related updates. I completely understand how frustrating it can be when the issue continues despite your efforts. A good next step might be to gather more logs or try out a patched build. If you’d like, I’m more than happy to escalate this to our engineering team to dig deeper. Just let me know how you’d prefer to move forward—I’m here to help! Sources: Resolving "InvalidState - failed to capture frame" errors in AudioSource | Getting Help | livekit/livekit_composite | DeepWiki | Debugging Audio/Video Sync Issues in LiveKit Publishing | webrtc-sys/src/audio_track.cpp | CHANGELOG.md
b
Since we still see -10877 with both modules, could you please escalate this to engineering? Helpful details to pass along: - Environment: macOS 15.0 (“macOS 26” in Settings), MacBook Pro (built-in mic + Continuity iPhone mic available). iOS builds work fine; only macOS fails. - SDK: livekit/client-sdk-swift 2.7.2 via SwiftPM. - Flow: Room.connect succeeds, join response arrives, but immediately afterwards CoreAudio emits HALC_ProxyIOContext:IOWorkLoop skipping cycle due to overload / CMIOHardware.cpp:331 … Error: 2003332927 and the SDK throws LiveKitError(.cancelled), dropping the websocket before any media starts. - We set the audio module to .platformDefault first, fall back to .audioEngine on failure, and explicitly select the built-in mic. Logs look like: 🎙️ LiveKitVoiceClient configured AudioDeviceModule = platformDefault 🎙️ LiveKit available input devices: [default (MacBook Pro Microphone) [default], …] 🎙️ LiveKit selected built-in input device: MacBook Pro Microphone […] … throwing -10877 … ❌ LiveKit connect failed with LiveKitError: … “Cancelled” 2025-09-19 … SignalClient.requireWebSocket() WebSocket is nil 2025-09-19 … Room.transport(_didGenerateIceCandidate) Invalid state(connectionState is .disconnected) - The failure reproduces every time with the plain built-in mic (no third- party audio drivers). Audio MIDI Setup is set to the default 48 kHz.
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!