big-author-39928
09/22/2025, 8:53 AMcom.apple.coreaudio.avfaudio: required condition is false: IsFormatSampleRateAndChannelCountValid(format)
Does this happen when mic can't be activated for some reason?
Seeing a similar issue in the Swift SDK: https://github.com/livekit/client-sdk-swift/issues/577refined-appointment-81829
09/22/2025, 3:23 PMbig-author-39928
09/22/2025, 3:37 PMbetter-house-11852
09/22/2025, 5:07 PMbig-author-39928
09/22/2025, 5:59 PM"livekit-client": "2.15.4",
"@livekit/react-native": "^.9.1",
"@livekit/react-native-expo-plugin": "1.0.1",
"@livekit/react-native-krisp-noise-filter": "0.0.2",
"@livekit/react-native-webrtc": "137.0.1"some-pilot-52613
09/22/2025, 6:55 PM"livekit-client": "^2.15.2",
"@livekit/react-native": "^2.9.1",
"@livekit/react-native-expo-plugin": "^1.0.1",
"@livekit/react-native-krisp-noise-filter": "^0.0.2",
"@livekit/react-native-webrtc": "^137.0.0",some-pilot-52613
09/22/2025, 7:41 PMbig-author-39928
09/23/2025, 9:23 AMbetter-house-11852
09/23/2025, 9:30 AM.playAndRecord when publishing mic: https://github.com/livekit/client-sdk-swift/blob/main/Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift#L43-L71big-author-39928
09/23/2025, 9:38 AMbig-author-39928
09/23/2025, 9:39 AMbetter-house-11852
09/23/2025, 9:41 AMbig-author-39928
09/23/2025, 9:54 AMsome-pilot-52613
09/23/2025, 10:12 AMbig-author-39928
09/23/2025, 10:13 AMsome-pilot-52613
09/23/2025, 10:31 AMsome-pilot-52613
09/23/2025, 10:32 AMbetter-house-11852
09/23/2025, 11:48 AMbig-author-39928
09/29/2025, 10:23 AMbetter-house-11852
09/29/2025, 10:34 AMbig-author-39928
10/03/2025, 9:45 AMsetAppleAudioConfiguration() wasn't throwing exceptions, so I rewrote our code to first use expo-audio to try and set playAndRecord, and abort call if it fails:
It seems to work, ie the app doesn't crash if we can't activate audio. It fails with OSStatus error 561017449 (Insufficient priority?). So now to the root cause, how do we make sure our app gets higher priority. I guess this error should only happen if a real phone call is in progress. Eg Spotify should be paused IMO. Any insight here would be appreciated! Thanks for all the great work.better-house-11852
10/03/2025, 9:56 AMbetter-house-11852
10/03/2025, 2:16 PMsetAppleAudioConfiguration will throw when it can't activate. I think some cases we simply can't activate due to priority (Apple apps such as Phone, Siri? running).
I think the react SDK was not calling setActive also, which could trigger other app to pause (Eg Spotify). attempt to get priority/activate.big-author-39928
10/03/2025, 2:19 PMbetter-house-11852
10/03/2025, 2:19 PM.mixWithOthers / .duckOthers etc.better-house-11852
10/03/2025, 2:22 PMexpo-audio only to configure ?big-author-39928
10/03/2025, 2:22 PMbig-author-39928
10/03/2025, 2:24 PMbig-author-39928
10/03/2025, 2:26 PMbig-author-39928
10/03/2025, 2:27 PMkeepAudioSessionActivebig-author-39928
10/03/2025, 2:27 PMbetter-house-11852
10/03/2025, 2:38 PM.mixWithOthers as default. It is impossible to cover all user's app specific use cases so, for advanced users, I think we should add the ability to Not configure the AVAudioSession automatically. And you could use something like expo-audio for advance configuration.
Currently it appears that always iosCategoryEnforce() is being invoked to hook getUserMedia() to always configure audio session, this could interfere with expo-audio. I think we should add an API/option to disable automatic audio session configuration, but you will need to ensure category is .playAndRecord when enabling mic.big-author-39928
10/03/2025, 2:39 PMsome-pilot-52613
10/03/2025, 2:40 PMbetter-house-11852
10/03/2025, 2:44 PMsome-pilot-52613
10/03/2025, 2:45 PMbetter-house-11852
10/07/2025, 5:27 PMawait AudioSession. setAppleAudioConfiguration({
audioCategory: 'playAndRecord',
audioMode: 'videoChat',
audioCategoryOptions: ['allowAirPlay', "allowBluetooth', "defaultToSpeaker"],
});
await AudioSession.startAudioSession(); // ā This will throw if session can't activate (already in a call etc.)
await room.connect(...)
I had some corrections for my previous comments āļø
⢠setMicrophoneEnabled / getUserMedia(audio) should throw if fail to activate session ā For this update, this will not happen yet.
⢠setAppleAudioConfiguration should call setActive ā We'll keep this only for config (Will not call setActive for iOS)big-author-39928
10/10/2025, 12:46 PMError setting category: The operation couldn't be completed. (OSStatus error 1836282486.)
await AudioSession.setAppleAudioConfiguration({
audioCategory: 'playAndRecord',
audioMode: 'voiceChat',
audioCategoryOptions: ['allowAirPlay', 'defaultToSpeaker'],
});
I am setting "playback" before, not sure how that relates. It works the 2nd time I call setAppleAudioConfiguration, which feels weird.
Any intel on error: 1836282486?plain-wall-1315
10/10/2025, 2:08 PMbig-author-39928
10/10/2025, 2:22 PMsome-pilot-52613
10/10/2025, 4:10 PMbetter-house-11852
10/10/2025, 5:03 PM// ā Attempt to configure, this could throw if something goes wrong
await AudioSession. setAppleAudioConfiguration({
audioCategory: 'playAndRecord',
audioMode: 'videoChat',
audioCategoryOptions: ['allowAirPlay', "allowBluetooth', "defaultToSpeaker"],
});
await AudioSession.startAudioSession(); // ā This will throw if session can't activate (already in a call etc.)
await room.connect(...) // ā Connect after successful configurationsome-pilot-52613
10/10/2025, 5:12 PMexpo-audio (which I think under the hood does the same?)
await AudioModule.setAudioModeAsync({
playsInSilentMode: true,
shouldPlayInBackground: false,
allowsRecording: true,
shouldRouteThroughEarpiece: false,
interruptionMode:
Platform.OS !== "android" ? "mixWithOthers" : undefined,
});
but I'll try with AudioSession insteadbetter-house-11852
10/10/2025, 5:23 PMawait setIsAudioActiveAsync(true); if using expo-audio .
š https://github.com/expo/expo/blob/9211c56ee86cbb52a6596c57e758acd599362779/packages/expo-audio/ios/AudioModule.swift#L475-L486big-author-39928
10/12/2025, 11:26 AM