AVAudioSession

RSS for tag

Use the AVAudioSession object to communicate to the system how you intend to use audio in your app.

Posts under AVAudioSession tag

200 Posts

Post

Replies

Boosts

Views

Activity

AVAudioSession ioBufferDuration always default to 512 samples on MacOS27 no matter what is requested
Hello, I develop an audio processing demo app that has been working fine on iOS/iPad and on Mac ("developed for iPad") until I upgraded to MacOS27. The app is demonstrating low latency / high temporal resolution audio spectral analysis. I am using AVAudioSession, I request the audio IO buffer to be 32 samples. This still works fine on iOS/iPadOS, but it seems that when running on MacOS27 the buffer size always defaults to 512 samples no matter what I request (smaller or larger). This applies to the "Designed for iPad" version running on MacOS and any version running in the iPhone and iPad simulators on MacOS. The app seems to be working as intended on physical iPhones and iPads. I made a catalyst version and used AudioObjectSetPropertyData to force the IO bugger sizes to 32 samples on the system's active hardware device. This seems to succeed but still results in incorrect behaviour in my app; I am still diagnosing but I believe it's because this leaves AVAudioSession with incorrect data, and I am using AudioKit which relies on AVAudioSession (not confirmed). Regardless, is this change in behaviour intentional in MacOS27? Is there a way around it? The whole point of my app is to demonstrate efficient audio processing with very low latency - I need small input buffer size for that. Thank you for any help with this
1
0
276
3d
AVAudioSession blocks 20–36s on A2DP→HFP switch while another AudioUnit is rendering (iOS 27.0.1, AirPods Spatial Audio)
While an AVAudioPlayer/AudioUnit is rendering to AirPods over A2DP with system Spatial Audio + Head Tracking enabled, switching the shared AVAudioSession to playAndRecord + voiceChat (A2DP → HFP) blocks the main thread for tens of seconds on synchronous AVAudioSession APIs (setCategory / setMode / channel getters / setPreferred*). iOS hang detection reports a Severe Hang of 41.02 s. Stopping playback and deactivating the session before the identical switch completes in ~87 ms. Feedback: FB25324099 Environment iPhone 15 Pro (iPhone16,1), iOS 27.0.1 (24A446) AirPods worn; Spatial Audio + Head Tracking on AVFoundation-only repro (no third-party SDK): https://github.com/shinobuwz/ios27-spatial-audio-stall-repro Info.plist: LSApplicationCategoryType = public.app-category.games, LSSupportsGameMode = YES; does NOT set AVGameBypassSystemSpatialAudio (those two keys are required for system Spatial Audio on this path) Steps Wear AirPods with Spatial Audio + Head Tracking enabled Launch the repro app; allow mic (or use auto-repro) Play 440 Hz (BluetoothA2DP, spatial=1) After ~2 s, run Repro: keep playing and switch to PlayAndRecord + VoiceChat Compare with Control: stop playback + setActive:NO, then the same switch Expected: each call returns in ms; whole reconfiguration ≪ 50 ms Actual (cold launches): configuration total 20.8–28.9 s (options=13); with options=237 ≈ 36.2 s; first input buffer ~40–58 s from switch start. Control ≈ 87 ms. Evidence in the repo: docs/MEASUREMENTS-2026-10-26.md, evidence/*.log, hangs.xml, main-thread stacks in avas::client::SessionCore (sync XPC to the audio daemon). Even inputNumberOfChannels / outputNumberOfChannels getters stall for seconds. Question: Is this a known regression on iOS 27? Any workaround besides stopping all rendering AudioUnits before the HFP switch? Happy to attach sysdiagnose / Instruments / screen recording if useful.
0
0
353
4d
AVAudioRecorder loses earlier audio after Siri with iOS 27 lifecycle notifications
I’m migrating to the new notifications described in Handling audio interruptions. On an iPhone 14 running iOS 27.0.1 (24A446), I call pause() when the system deactivates the session. On .shouldResume, I await successful session.activate() and call record() on the same recorder. It returns true, but the saved file contains only the audio recorded after Siri. To reproduce: record for five seconds, invoke and dismiss Siri, record for another five seconds, then stop and play. The earlier five seconds are missing. A legacy-notification control preserved both portions on the same phone. Is another step required to preserve the recording with the new notifications, or is this a known issue? I found this similar report, although it uses the legacy API. Minimal reproduction Built with Xcode 27.1. Create a SwiftUI iOS app targeting iOS 27, replace its generated App.swift with the code below, and add these Info.plist entries: NSMicrophoneUsageDescription: Test audio recording UIBackgroundModes: an array containing audio import SwiftUI import AVFoundation @main struct RecorderReproApp: App { var body: some Scene { WindowGroup { RecorderReproView() } } } @MainActor struct RecorderReproView: View { private let session = AVAudioSession.sharedInstance() private let file = URL.documentsDirectory.appendingPathComponent("recording.m4a") @State private var recorder: AVAudioRecorder? @State private var player: AVAudioPlayer? @State private var running = false @State private var interrupted = false @State private var status = "Ready" var body: some View { VStack(spacing: 24) { Button("Start") { Task { await start() } }.disabled(running) Button("Stop") { running = false interrupted = false recorder?.stop() status = file.path }.disabled(!running) Button("Play") { do { player = try AVAudioPlayer(contentsOf: file) status = "Saved duration: \(player!.duration) seconds" player?.play() } catch { status = error.localizedDescription } }.disabled(running) Text(status) } .padding() .task { for await notification in NotificationCenter.default.notifications( named: AVAudioSession.didBecomeInactiveNotification, object: session ) { guard running, let context = notification.userInfo?[AVAudioSession.deactivationContextKey] as? AVAudioSession.DeactivationContext, context.source == .system else { continue } recorder?.pause() interrupted = true status = "Interrupted" } } .task { for await notification in NotificationCenter.default.notifications( named: AVAudioSession.resumptionRecommendationNotification, object: session ) { guard running, interrupted, let context = notification.userInfo?[AVAudioSession.resumptionContextKey] as? AVAudioSession.ResumptionContext else { continue } guard context.recommendation == .shouldResume else { interrupted = false continue } do { guard try await session.activate(), running, interrupted else { continue } status = "Resumed: \(recorder!.record())" interrupted = false } catch { status = error.localizedDescription } } } } private func start() async { guard await AVAudioApplication.requestRecordPermission() else { return } do { try session.setCategory(.playAndRecord) guard try await session.activate() else { return } recorder = try AVAudioRecorder(url: file, settings: [ AVFormatIDKey: kAudioFormatMPEG4AAC_HE, AVSampleRateKey: 44_100, AVEncoderBitRateKey: 32_000, AVNumberOfChannelsKey: 2 ]) running = recorder!.record() status = "Recording: \(running)" } catch { status = error.localizedDescription } } }
0
0
428
1w
CallKit never calls didActivateAudioSession because callservicesd fails to create the audio session (SessionID 0x0) on iOS 24A446
Summary On iOS build 24A446, an incoming CallKit VoIP call is reported and answered, but the system never creates or activates the CallKit audio session, so CXProviderDelegate provider:didActivateAudioSession: is never called. Both directions of call audio stay silent. The failure is inside callservicesd / audiomxd, before the app starts its audio unit. Once it starts, later calls from the same processes keep failing until the app process is killed. App and device Bundle ID: us.zoom.videomeetings OS build: 24A446 (iPhone) Log: sysdiagnose_2026.10.16_11-15-45-0700_iPhone-OS_iPhone_24A446 Sample call: 2026-10-15 13:29:06–13:29:22 PDT Processes in that window: Zoom PID 816, callservicesd PID 2474, audiomxd PID 115 How the user hits it The app is not in the foreground. A VoIP push wakes it and we call reportNewIncomingCallWithUUID:update:completion:. The user answers from the system incoming-call UI (phone locked or unlocked). The ringtone plays. After answer there is no call audio. The same failure then happens on later calls, including a call started from inside the app, until the Zoom process is killed. Signing out or rebooting only clears it temporarily. We cannot reproduce it in our lab. It became much more frequent after devices moved to this OS. What the app does We configure one CXProvider (PlayAndRecord is applied when the system activates the session). We fulfill CXAnswerCallAction when the user answers. We start the voice audio unit only from provider:didActivateAudioSession:. We do not call AVAudioSession setActive: during this answered call. Our log line "ZMCallKitManager::didActivateAudioSession" is not present for this call. System log for the sample call 13:29:06 — incoming call reported Zoom log: Provider was asked to report a new incoming call At that moment Zoom's existing primary session is sid:0x7304f, Zoom(816), 'prim', and the app is BackgroundRunning. callservicesd then fails while creating the CallKit session: audiomxd AVAudioSessionXPCServer.mm:231 -[AVAudioSessionRemoteXPCClient createProxySession:reply:] failed due to session lookup failure for SessionID 0x0 callservicesd AVAudioSession_iOS.mm:643 Creating proxy session failed, session ID = 0x0, NSOSStatusErrorDomain -50, "Session lookup failed" audiomxd ServerSessionManager.mm:192 Sibling session creation failed. Source sessionID: 0x0. SessionID is not valid. Source PID: 2474 audiomxd AVAudioSessionXPCServer.mm:1287 Session creation failed callservicesd SessionCore_Create.mm:92 AudioSession creation failed, NSOSStatusErrorDomain 2003329396, "Session creation failed in server" callservicesd Audio session not found for call. Returning nil The ringtone still plays. That audio is callservicesd's own session sid:0x732fa, category Ringtone/Default, which activates at 13:29:06.650. It is not the call session. 13:29:15 — user answers callservicesd: Performing answer request / Perform answer call callservicesd: No provider returned for descriptor callservicesd: Audio session not found for call. Returning nil callservicesd: Answer call action fulfilled callservicesd: Error retrieving AVAudioSession provider with ID 0 Sibling session creation fails again with Source sessionID 0x0, Source PID 2474. The ringtone session is stopped. From 13:29:15 to 13:29:22 there is no "action":"activate" for a CallKit call audio session, and no provider:didActivateAudioSession: notification to Zoom. Zoom's primary session 0x7304f is still inactive. Its category is updated to PlayAndRecord / VoiceChat, but it is not activated while this call is up. 13:29:22 — call ends Provider was asked to report that call ended with reason 2 callservicesd: Setting disconnected reason to remote hangup because ended reason is 2 sid:0x732fa callservicesd going inactive The call lasted about 7 seconds with no call audio session ever created. 13:29:33 — following call, same stuck state About 11 seconds later a CXStartCallAction is fulfilled. Zoom's own session then activates: sid:0x7304f, Zoom(816), 'prim' PlayAndRecord_WithBluetooth / VoiceChat, NonMixable, going active callservicesd still cannot build its session: "No existing proxy AVAudioSession interruption provider for ID 0, creating a new one" Session creation failed in server Error retrieving AVAudioSession provider with ID 0 Audio session not found for call So an app-side setActive: after the failed call does not repair the CallKit provider. The system session id remains 0x0. How often it happens in this sysdiagnose Filtering the archive for the hard failure (not the generic "Audio session not found" line, which also appears on earlier days): "Sibling session creation failed. Source sessionID: 0x0": 93 hits, grouped into 57 bursts First burst: 2026-10-15 09:52:11 PDT Last burst: 2026-10-16 11:14:30 PDT (about a minute before this sysdiagnose was taken) "Error retrieving AVAudioSession provider with ID 0": 34 hits "Session creation failed in server": 93 hits Every one of these sibling-session failures is Source PID 2474. callservicesd stays PID 2474 and audiomxd stays PID 115 across the whole window, including overnight. The bad session id is stuck in those daemons, not in one Zoom call object. There is no log line in this archive showing callservicesd successfully activating a provider audio session for these calls. Request Please confirm this is the known CallKit failure where didActivateAudioSession is not delivered because callservicesd cannot create the audio session (Session lookup failed / Session creation failed in server, session ID 0x0). Related public reports: Feedback FB19429215, "CallKit does not activate audio session after iOS 18.4.1", and the iOS 27 thread "iOS 27 CallKit didActivateAudioSession". DTS previously advised apps not to call setActive: themselves, because the CallKit session has higher priority and an app activation can fail or disturb system state. This log matches that: the session is never created, so there is nothing for the system to activate. Please also advise which of these is safe on 24A446 when provider:didActivateAudioSession: does not arrive: Call CXProvider setConfiguration: again (same configuration) before every reportNewIncomingCallWithUUID:update:completion:. On a timeout, fail the unanswered CXAnswerCallAction so the CallKit state machine resets, without invalidating or recreating the CXProvider. Anything else that clears the stuck session ID 0x0 inside callservicesd without a device reboot. I can provide another sysdiagnose if you need a logging profile installed before the next reproduction.
3
0
1.1k
1w
Intermittent EXC_BAD_ACCESS in AURemoteIO::IPC_Uninitialize when launching an Inter-App Audio app
I'm investigating an intermittent crash in an iOS audio app when launching it through an Inter-App Audio (IAA) host Audiobus and AUM. The crash occurs during the host connection/startup process. The app begins initializing its audio engine, successfully creates and registers an ABAudioSenderPort, starts its output audio unit, and then crashes. Crash details Crash Report Exception: EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x50 Backtrace: #0 _dispatch_sync_f #1 caulk::concurrent::details::dispatch_receiver::~dispatch_receiver #2 std::__1::__shared_weak_count::__release_shared #3 caulk::concurrent::messenger::~messenger #4 CADeprecated::CAAutoDelete<caulk::concurrent::messenger>::set #5 AURemoteIO::IPC_Uninitialize #6 AURemoteIO::IPC_Uninitialize #7 AUWrappedOutputUnit::AUUninitialize #8 _XUninitialize #9 IPCAudioUnit_server #10 dispatch_mig_server #11 _dispatch_client_callout #12 _dispatch_continuation_pop #13 _dispatch_source_latch_and_call #14 _dispatch_source_invoke #15 _dispatch_lane_serial_drain #16 _dispatch_lane_invoke #17 _dispatch_root_queue_drain_deferred_wlh #18 _dispatch_workloop_worker_thread #19 _pthread_wqthread Repro: Quit Audiobus completely. Relaunch Audiobus. Launch the app from Audiobus. The app begins initialization, but crashes during or shortly after the initial host connection. Interestingly, if Audiobus remains open and I attempt to launch the app again, the crash doesn't appear to occur. Reloading the app via AUM is also reproducing the crash. A number of other apps are able to launch via Audiobus, so I think it must be how we are initialising our engine, but I haven't been able to find where we are going wrong. The app configures its audio session as follows: Category: AVAudioSessionCategoryPlayback Mode: AVAudioSessionModeDefault Preferred sample rate: 48000 Hz Preferred I/O buffer duration: approximately 5.3 ms Reported buffer size: 256 frames Input channels: 0 Output channels: 2 Audio-unit initialization The engine creates and initializes its audio unit successfully: AudioComponentInstanceNew: status = 0 AudioUnitInitialize: status = 0 AudioOutputUnitStart: status = 0 The app then creates an ABAudioSenderPort, configures its client format, and registers it with ABAudiobusController. These operations also complete successfully. The engine's RemoteIO audio unit and the sender port's audio unit are separate instances. I haven't yet worked out which instance is being uninitialized when the crash occurs. This seems to be happening across multiple iPhone and iPad models, back to at least iOS 17, and my test environment, Xcode 26.6 and iPadOS 26.5.2. Questions Has anyone encountered this caulk::concurrent::messenger::~messenger / AURemoteIO::IPC_Uninitialize crash when using IAA, Audiobus, AUM? Could this indicate a race or invalid lifecycle transition in Apple's RemoteIO/IAA IPC implementation? Are there known requirements concerning the order of audio-unit initialization, sender-port registration, host connection, and uninitialization that could explain this behavior? What additional diagnostics would help determine which audio-unit instance is being uninitialized and what triggers the failure? Any suggestions or reports of similar behavior would be greatly appreciated.
0
0
107
1w
What "System-supplied signal processing" is applied when using AVAudioSession.Mode.default or .videoRecording vs .measurement?
The documentation for AVAudioSession.Mode.measurement says that this mode will "minimize the amount of system-supplied signal processing to input and output signals" https://developer.apple.com/documentation/avfaudio/avaudiosession/mode-swift.struct/measurement Is there any documentation regarding specifically what processing is applied in the .default or .videoRecording modes and how it is different in .measurement mode? If my app adds its own signal processing, is it best practice to always use .measurement mode? What should I use for an app that applies its own signal processing to the audio in a video recording? Is it possible to "minimize system-supplied signal processing" while recording a video?
0
0
556
2w
audiomxd terminated for memory limit during short audio playback with background music
Hello, I need guidance on diagnosing an intermittent audio failure on an iPhone 12 running iOS 26.6.2. My app, Timer Workout Fitness, plays short bundled MP3 voice recordings for countdowns, repetition numbers and workout announcements. It uses React Native / Expo SDK 57 and expo-audio. The native playback implementation uses AVQueuePlayer, AVPlayerItem and AVURLAsset. Users can listen to Spotify while the app plays spoken cues, with ducking of the background music. Observed behavior: Playback can work correctly for an entire workout. Audio sometimes fails after background/foreground transitions, pausing Spotify, or completing one workout and starting another. The exact sequence is not consistently reproducible. The app may remain navigable while recorded audio becomes unavailable. Force-quitting does not always restore reliable playback. Restarting the iPhone has restored it in our tests. Speech-based voices have generally behaved more reliably before the failure. Evidence from a device Console capture: At 15:03:35 on October 12, the kernel reported termination of audiomxd with reason "per-process-limit" and a recorded footprint of 66866 KB. ReportSystemMemory confirmed the jetsam termination. Shortly before this, the Console contained AudioConverter construction messages associated with our app through mediaplaybackd. Our app subsequently reported media-services loss/reset and errors including: "Server was dead" OSStatus 1836282486 We have not established whether our playback implementation causes an accumulation of native resources, a temporary peak, or another issue. We do not assume that this is an iOS defect. The implementation originally retained up to 56 players for individual recordings and loaded them concurrently. We recently changed it to load only the recordings required by a workout: 15 players for 10 repetitions and 35 for 30 repetitions. Failures have still occurred in development testing, but we have not measured the corresponding native memory footprint. We also have a custom native patch affecting activation/deactivation and handling of media-services loss/reset. Current Expo Go tests do not include that patch; our TestFlight builds do. We can provide the patch for review. What is the recommended way to: Attribute audiomxd memory usage to our app’s playback resources? Verify that AVQueuePlayer items and associated decoding resources are released? Capture useful diagnostics for this service termination? Choose an appropriate playback architecture for frequent short local voice clips alongside background music? We have device Console logs and application diagnostic traces. We do not yet have a minimal native Xcode reproduction project and would appreciate guidance on what it should include.
0
0
122
2w
Issues with AVRoutePickerView channel switching
We are developing a voice call application that uses AVRoutePickerView, allowing users to switch between an iPhone, a speaker, and Bluetooth earphones. However, we have encountered an intermittent issue: when switching from the speaker to Bluetooth earphones, the earphones remain in a loading state, and the audio channel subsequently switches back to the speaker. How can we resolve this issue? Here is the sample code: let session = AVAudioSession.sharedInstance() do { try session.setCategory(.playAndRecord, mode: .default, options: [.allowBluetooth]) try session.overrideOutputAudioPort(isBluetoothConnected ? .none : .speaker) try session.setPreferredSampleRate(48000) try session.setPreferredIOBufferDuration(0.02) try session.setActive(true, options: []) INFO(" >>> start: hasBluetooth=\(isBluetoothConnected), inputs: \(session.currentRoute.inputs.map { $0.portType }) outputs: \(session.currentRoute.outputs.map { $0.portType })") } catch { ERROR("(error.localizedDescription)") }
5
0
2k
3w
AVSpeechSynthesizer audio pauses when the device locks, despite an active background AVAudioSession
My App announces a place name aloud via AVSpeechSynthesizer (through expo-speech) while a background location task detects the user has entered a new town. This works correctly in the foreground. In the background, with the device screen locked, speech that has already started reliably pauses mid-utterance the moment the screen locks, and resumes and completes the moment the screen is unlocked — even though: The app has UIBackgroundModes: ['audio', 'location'] declared. A genuinely active, native-confirmed AVAudioSession is already running continuously in the background (a looping AVAudioPlayer via expo-audio, separate from the speech itself). AVSpeechSynthesizer.usesApplicationAudioSession is at its default (true), so the synthesizer shares that same active session rather than managing its own. This is not a crash, and AVSpeechSynthesizer never reports onError, the utterance simply stalls and then continues later, which looks exactly like a pause/resume cycle tied to the screen lock event itself rather than any audio session interruption we can detect. What is implemented app.config.js declares the audio and location background modes, and expo-audio's config plugin with enableBackgroundPlayback: true. At app launch, expo-audio's setAudioModeAsync is called once with: { playsInSilentMode: true, shouldPlayInBackground: true, interruptionMode: 'duckOthers' } (We also tested interruptionMode: 'doNotMix' see below.) For the duration of a tracked journey, a silent/near-silent AVAudioPlayer-backed loop is started via expo-audio's createAudioPlayer(), specifically so the app has genuine continuous audio output (not just a configured session) for the whole background session. The player is also registered as the active Now Playing session via setActiveForLockScreen() (expo-audio's wrapper around MPNowPlayingInfoCenter / MPRemoteCommandCenter). When a new place is detected (from a background expo-location task), we call Speech.speak() with the place name. onStart, onDone, onStopped, and onError callbacks are all logged for diagnostics. 5. We listen to the player's native playbackStatusUpdate event to know, from real OS-reported status (not just "the .play() call didn't throw"), whether the keep-alive loop is actually playing. Observed behavior: field test evidence Device log example (stationary repeated test): 08:29:01.948 onStart 08:29:02.092 keep-alive loop confirmed playing (native status) 08:29:07.666 onDone That's a 5.7s onStart-to-onDone gap for a phrase that normally takes under 2s — consistent with the utterance pausing mid-speech when the screen locked, then resuming on unlock. A separate test that stayed unlocked completed the same kind of phrase in 1.9s. On a real 68-minute drive, locked cycles showed 9.4-12.5s gaps; some builds with more aggressive session-reactivation never completed at all (onStart with no onDone/onStopped/onError). Throughout, the background AVAudioPlayer loop's native status still reports playing: true, and Control Center shows the app as Now Playing. So the AVAudioSession is confirmably alive — only the speech utterance itself stalls on lock. What we've ruled out: usesApplicationAudioSession already defaults to true (confirmed via WWDC 2020 session 10022), the synthesizer already shares our configured session, this isn't a missing option. Tried both doNotMix and duckOthers interruption modes. Neither stops the pause-on-lock. duckOthers additionally stops the app showing as Now Playing in Control Center (doNotMix does show it). Keep-alive liveness: native playback status confirms the background AVAudioPlayer reaches playing: true within 100-800ms every time — the session itself isn't failing to activate. We can't observe AVAudioSessionInterruptionNotification directly from our React Native audio libraries, only each library's own polled status — so we can't confirm whether a real interruption notification fires at the moment of lock. That's one of our questions below. Questions: Is it expected that AVSpeechSynthesizer, with usesApplicationAudioSession=true and an already-active background AVAudioSession (.playback category, UIBackgroundModes including audio), still pauses an in-progress utterance when the screen locks and resumes on unlock? If so, is there a supported way to prevent that for a navigation/voice-prompt app? Does locking the screen alone generate an AVAudioSessionInterruptionNotification for an app in this configuration, and if so what interruption type is reported? We can't observe this through our current libraries and want to know what native behavior to expect. Apple's "Audio Guidelines By App Type" doc gives two sets of guidance that both partly apply to us: navigation apps (activate the session only when a prompt is needed, deactivate after, use duckOthers) vs. playback apps (don't stream silence to avoid suspension, use a background task instead). Is there a recommended pattern for an app needing short, infrequent spoken prompts to continue through a locked screen, triggered by a background location task rather than continuous media playback?
0
0
444
3w
UX pain point - iOS - Stopping foreground apps from cutting audio - Neurodivergent users
TL;DR Requesting a system-level iOS feature or API to prioritize background audio over foreground app interruptions for enhanced neurodivergent accessibility. Granular Audio Session Priority and Control Center Override For users who rely on parallel cognitive processing - such as neurodivergent individuals managing attention through sensory layering like jumping across apps - abrupt audio interruptions are deeply disruptive. One scenario - a user is deep in cognitive flow listening to audio via Apple Music. They then switch to Instagram to check a text or post as natural neurodivergent attention switching and a video automatically fires up audio and instantly cuts the track playing on Apple Music. Regaining the audio stream requires manual intervention and therefore a breaking of focus. Proposal - I would love and suggest a native iOS feature or Control Center overlay allowing users to define audio hierarchy across apps, e.g. by locking background media as primary; open for ideas of course. This may as well be useful in therapeutical setups to easily silence potential notifications of lower priority over audio media designed to sensorically set guidelines for a session. Scope - while potentially helpful to users in the audio engineering and music playing scene running third-party-apps like Ableton and such, the feature request is intended to assist a basic and non-teh-savvy iOS user. Technical Question - is there any undocumented or upcoming capability within ⁠AVAudioSession⁠ categories/modes that could allow a developer to gracefully intercept or suppress automatic audio ducking/interruption from third-party foreground apps? PS First post. Nothing similar found on the forum. Nice request. Would love feedback or a technical review on feasibility.
0
0
369
3w
watchOS 27 TTS/Bluetooth Issue
When playing TTS on a watchOS 27 device while AirPods or a Bluetooth headset are connected to both the Apple Watch and the iPhone: Playback begins by calling the setActive function of AVAudioSession. A successful response is received, but... ...AVAudioSession.currentRoute.outputs lists only the built-in speaker, with no entry for the Bluetooth headset or earphones. After a brief delay, an AVAudioSession.routeChangeNotification is received, and playback then switches to the AirPods. If TTS is stopped and playback is attempted again: Playback frequently fails. In this state, AVAudioSession.currentRoute.outputs still shows no Bluetooth headset or earphones. However, checking the Bluetooth settings on the Apple Watch confirms that the AirPods or Bluetooth headset are properly connected. If the app is restarted—or if you exit and re-enter the TTS playback screen—the first attempt succeeds (albeit with a delay), but subsequent attempts after stopping fail. Sometimes, playback fails right from the start. Even in this case, the AirPods remain properly connected. The issue is resolved if the AirPods are disconnected from the iPhone and connected solely to the Apple Watch. When connected only to the watch, AVAudioSession.currentRoute.outputs correctly includes the Bluetooth headset or earphones from the start, and playback issues do not occur when repeatedly stopping and restarting. Playback worked fine with simultaneous Bluetooth connections up to watchOS 26, but a strange issue has started occurring since watchOS 27. We suspect this is a bug or error introduced in watchOS 27; could you please fix it? The same issue persists even after the recent update to version 27.0.1. Alternatively, please let us know if there is a way to resolve this within the app itself. It seems impossible to fix this in the current code because there is no way to programmatically trigger a popup on the Apple Watch that forces the selection of a currently connected Bluetooth headset or AirPods. Also, it does not appear to be an issue with the TTS API.
0
0
451
4w
iPad (9th gen) headphone output ~2.5 to 4.5 dB quieter on iPadOS 27 (FB24980117)
Since iPadOS 27, the 3.5 mm headphone output on iPad (9th generation) is 2.4 to 4.5 dB quieter than on iPadOS 26, depending on frequency, with the same content, system volume and headphones. It's still present in iPadOS 27.2 beta 2 (24B5089g). It isn't app-specific. It reproduces in Safari: Connect wired headphones to the 3.5 mm jack and set system volume to 100%. Open https://www.szynalski.com/tone-generator/, set 3000 Hz, set the generator volume to 50%, and play. Measure with a sound level meter. At 3 kHz we see 2.5 to 2.9 dB less on iPadOS 27 than on iPadOS 26, across three different headphone models. Audio settings are identical between the two OS versions and Bluetooth is off. The only session-level difference we found is AVAudioSession.outputLatency, which went from 97 to 65 frames. Filed as FB24980117.
0
0
548
Sep ’26
CallKit does not activate audio session with higher probability after upgrading to iOS 18.4.1
Hi, We've noticed that this issue occurs more frequently after upgrading to iOS 18.4.1 and can result in one-way audio. Our app uses CallKit with WebRTC to establish VoIP connections. However, on iOS 18.4.1, CallKit no longer triggers: func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) We're currently comparing the occurrence rate across different iOS versions to better understand the impact. Could you please help analyze the root cause of this issue?
40
1
5.8k
Sep ’26
Low-latency, high-quality audio route w/wireless CarPlay?
Is there a supported way for a CarPlay audio app to request a lower-latency wireless playback route without communications-style audio processing or restricted volume behavior? .playback + .default on wired CarPlay gets you ~60ms latency route. The same on wireless CarPlay gets you ~1100ms latency. I know that wireless CarPlay can support faster connections as I have tested them. playAndRecord + .default and .playback + .voicePrompt negotiate approximately 160 ms output/presentation latency. However, on this head unit those paths have unacceptable side effects: The duplex route negotiates 24 kHz mono and removes or severely attenuates bass/haptic-engine content. The voice-prompt route alters volume semantics: steering-wheel/head-unit volume does not control our app’s level, and it appears to apply voice-oriented EQ or other processing. These routes therefore cannot substitute for full-bandwidth media playback, even though their latency is much better. 24 kHz mono would actually work for our app, if only it preserved the signal without voice/telephony EQ, bass removal, or special prompt-bus volume policy. Is there a documented, supported public API or AVAudioSession configuration (or other API even) that lets a CarPlay audio app request that kind of low-latency wireless media route? If not, is this an intentional limitation of wireless CarPlay media playback, and is there an appropriate enhancement-request path for real-time audio applications?
0
0
405
Sep ’26
Does the TN3135 audio-session networking exception have a defined lifetime? Seeing a ~38.5 s revoke/re-grant cycle
TN3135 describes the exception that lets a watchOS app use low-level networking while it holds an active audio session. I have that working, and the app functions — but the network path is withdrawn and restored on a strikingly regular cycle, and I would like to know whether that is expected behaviour rather than something I am doing wrong. Setup Apple Watch Series 10 (Watch7,9), watchOS 26.5. Reproduced on a Series 6 (Watch6,2). UIBackgroundModes: [audio]; AVAudioSession category .playAndRecord, mode .spokenAudio; activated with the async activate(options:completionHandler:). NWConnection with NWProtocolWebSocket to a WebSocket relay over TLS. The app streams 16 kHz mono PCM continuously while transmitting and holds the socket open otherwise. Symptom NWPathMonitor reports .unsatisfied, then .satisfied about two seconds later, over and over. Measured with the iPhone powered off, so the watch was on its own Wi-Fi: Uptime between drops Outage 36.4 s 2.1 s 36.7 s 1.9 s 36.9 s 2.1 s The regularity is what prompts the question — uptime varies by ±0.3 s and the outage is consistently 2.0 s. That reads as a timeout expiring rather than radio behaviour. What I have ruled out Not the network or the server. A browser client on the same relay, same TLS, same wire protocol, holds a WebSocket indefinitely. Not the interface. Identical cadence over the companion ipsec1 tunnel with the iPhone present, and over the watch's own en0 with the iPhone powered off. Pinning requiredInterfaceType = .wifi while the iPhone is reachable fails outright — the path offers only ipsec1. Not audio-session interruption. I observe interruptionNotification, routeChangeNotification, mediaServicesWereResetNotification and silenceSecondaryAudioHintNotification. None fire at a drop. At the moment the path goes .unsatisfied, the engine is running and the player node is actively playing. Not session idleness. Playing continuous silence for the whole session, rather than only while reconnecting, made no difference — still 36.4 s. The control that surprised me To test whether this affects any long-lived watch socket or only audio-unlocked ones, I built a second app with no AVAudioSession at all, no audio background mode, holding a URLSessionWebSocketTask and kept alive by a WKExtendedRuntimeSession so screen sleep was not a factor. It never connected. NWPathMonitor reported .unsatisfied once and never changed, across a 30 s run, and every request failed with "The Internet connection appears to be offline." I had expected URLSession to be permitted regardless. Questions Does the audio-session networking exception in TN3135 have a defined lifetime, and is a periodic revoke/re-grant cycle expected? If so, is there a supported way to hold it continuously — or is the correct design simply to expect the interruption and reconnect through it? Is it expected that an app with no audio session gets no network path at all on watchOS, including via URLSession, even in the foreground with an extended runtime session?
16
0
4k
Sep ’26
AirPods Sleep Detection pauses meditation playback with no API/callback to identify the reason
Good morning! I work on a meditation app, and since Sleep Detection was introduced for AirPods in iOS 26, we've been receiving complaints from users reporting that their meditation sessions unexpectedly stop after approximately 15–20 minutes when Sleep Detection is enabled. This seems to happen particularly during deep meditation sessions, where the user may remain still and exhibit behavior that could potentially be interpreted as falling asleep. I've also tested this on iOS 27 with the latest beta firmware available for AirPods Pro, and the same behavior still occurs. While investigating and debugging the issue, I found that there doesn't appear to be any public API that allows an app to determine that playback was paused specifically because of AirPods Sleep Detection. From the application's perspective, the AirPods appear to simply send a standard pause command to the AVPlayer, without providing any additional context or reason. There also doesn't seem to be an API that allows us to determine whether the user has Sleep Detection enabled. Even having access to that information would allow us to warn users that their meditation session could potentially be interrupted. AVAudioSession.InterruptionReason does not seem to help in this case either: https://developer.apple.com/documentation/avfaudio/avaudiosession/interruptionreason Is there currently any supported way for an app to: Detect that playback was paused specifically because of AirPods Sleep Detection? Determine whether Sleep Detection is enabled for the connected AirPods? Prevent Sleep Detection from pausing playback for specific apps or specific types of audio sessions? If none of these are currently possible, could Apple consider providing either a notification/callback indicating that Sleep Detection triggered the pause, or an option for users to exclude specific apps from Sleep Detection? This behavior is particularly problematic for meditation apps, since a user in a deep meditation session can easily be mistaken for someone who has fallen asleep. Other meditation apps appear to be affected by the same behavior as well. Best regards, Carlos Antunes
1
0
1.4k
Sep ’26
Can an iOS app programmatically enable Voice Isolation microphone mode?
Hi, I’m developing an iOS app that captures the user’s voice and sends the microphone input to an AI model for speech processing. For this use case, Voice Isolation provides a significantly better input signal in noisy environments. However, I’m currently unable to enable Voice Isolation programmatically when the app starts recording. As I understand it, microphone modes such as Automatic, Standard, Voice Isolation, and Wide Spectrum are controlled by the user through the system UI. My app can detect/observe the current microphone mode, but I have not found a public API that allows the app to select Voice Isolation itself. My questions are: Is there currently a supported public API to programmatically switch the microphone mode from Automatic/Standard → Voice Isolation? If direct selection is not supported, is there a recommended way for an app that primarily processes speech/voice input for an AI model to request or prefer Voice Isolation? Would using AVAudioSession with an appropriate voice-processing configuration, such as .voiceChat, or enabling voice processing through AVAudioEngine, provide equivalent Voice Isolation processing? Is AVCaptureDevice.showSystemUserInterface(.microphoneModes) the intended approach when an app needs the user to change the microphone mode? I understand that Apple may intentionally keep microphone-mode selection under user control. I’m mainly trying to determine whether there is a supported programmatic approach that I may have overlooked, rather than relying on a custom noise-suppression implementation. Any guidance on the recommended architecture for this use case would be greatly appreciated. Thank you!
0
0
776
Sep ’26
PushToTalk session sometimes returns silence data after activation
Hello! Thank you for bringing the new iPhone experience with the PushToTalk framework. I have a working walkie talkie app based on the PushToTalk framework. Everything works fine except for an intermittent bug that I face from time to time on different devices with different iOS versions, from iOS 18 to iOS 26.2 Beta. Sometimes the app goes into a state where the AVAudioInputNode input node tap returns buffers with a constant size that contain only silence. Leaving and rejoining a channel helps, but relaunching or reinstalling (from Xcode) the app does not. Rebooting the device or deleting and reinstalling the app also helps. I do not activate the audio session in my app. I only configure it on launch using setCategory(.playAndRecord, options: [.defaultToSpeaker, .allowBluetooth]) So the flow is: channelManager?.requestBeginTransmitting(channelUUID: globalChannelUUID) func channelManager( _ channelManager: PTChannelManager, channelUUID: UUID, didBeginTransmittingFrom source: PTChannelTransmitRequestSource ) func channelManager( _ channelManager: PTChannelManager, didActivate audioSession: AVAudioSession ) { /// ... installTapAndStart() } private func installTapAndStart() { let inputNode = audioEngine.inputNode let hardwareFormat = inputNode.outputFormat(forBus: 0) guard let targetFormat = AVAudioFormat( commonFormat: .pcmFormatFloat32, sampleRate: configuration.audioSampleRate, channels: configuration.audioChannelsCount, interleaved: true ) else { handleError(RecorderError.invalidAudioFormat) return } let converter = AVAudioConverter(from: hardwareFormat, to: targetFormat)! print("[QUICOpusRecorder]: installTap") inputNode.installTap(onBus: 0, bufferSize: tapBufferSize, format: hardwareFormat) { [weak self] buffer, _ in guard let self else { return } // Here I handle audio data and sometimes get silence } //... do { audioEngine.prepare() try audioEngine.start() } catch { print(" ⚠️ Audio engine start error: \(error)") handleError(error) } } Moreover, if the app is in the foreground and PushToTalk gets stuck in this “silence bug”, I can avoid relying on the PushToTalk flow and simulate audio session activation manually in code. In this case I do not request a transmission and do not use any PushToTalk related code, and the app captures audio data perfectly. Once I leave the channel and rejoin it again, the issue is fixed and I start to receive non silent buffers of varying size, as expected. It works for a while. It can work fine for a day or more, communicating without launching the app, or with the app in the foreground. But it can also go into the “silence” state 30 minutes after working normally. I have no clue why this happens. The only thing I notice is that when the app is in this “stuck silence bug” state, iOS does not play its “chirp” system sound when audio recording starts. P.S. Channel descriptor restoration code: extension PushToTalkEngine: PTChannelRestorationDelegate { public func channelDescriptor(restoredChannelUUID channelUUID: UUID) -> PTChannelDescriptor { print("☀️ \(#function) channelUUID: \(channelUUID)") Task { @MainActor in // Here I fetch more detailed channel data asynchronously do { await initChannelManagerIfNeeded(channelUUID: channelUUID) let channelDescriptor = currentChannelDescriptor() lastChannelDescriptorName = channelDescriptor.name try await channelManager?.setChannelDescriptor( channelDescriptor, channelUUID: channelUUID ) } catch { handleError(error) } } return PTChannelDescriptor(name: "Loading...", image: nil) } } private func initChannelManagerIfNeeded(channelUUID: UUID? = nil) async { guard let channelUUID = channelUUID ?? currentUser?.globalChannelUUID else { print("❌ No global channel uuid found") return } do { guard channelManager == nil else { try await channelManager?.setTransmissionMode(.halfDuplex, channelUUID: channelUUID) return } channelManager = try await PTChannelManager.channelManager( delegate: self, restorationDelegate: self ) try await channelManager?.setTransmissionMode(.halfDuplex, channelUUID: channelUUID) } catch { handleError(error) } }
4
0
1.6k
Aug ’26
provider(_:didActivate:) callback intermittently not triggered, causing widespread audio loss for users
Hi everyone, I am facing a critical issue where the CallKit provider delegate method provider(_:didActivate:) is intermittently not triggered. This occasionally results in a total loss of audio during some VoIP calls, while other calls work perfectly fine. Here is the sequence of steps I am currently implementing: Report Incoming Call: The app receives a VoIP push notification and reports the call using reportNewIncomingCall(with:update:completion:). Answer Action: The user taps the answer button, and the app processes the CXAnswerCallAction. Configure Audio Session: Inside the provider delegate, I configure the AVAudioSession category and mode (e.g., setting category to .playAndRecord and mode to .voiceChat). Note: As per Apple's guidelines, I do not call setActive(true) manually, expecting CallKit to activate it automatically. Despite following this standard flow, there are times when provider(_:didActivate:) is skipped entirely, meaning the audio engine fails to initialize for that specific call session. We are currently receiving a large volume of user complaints regarding this issue, as it heavily impacts the core calling experience in production. Could an Apple engineer or anyone from the community look into this? Any insights into what might be causing CallKit to occasionally fail to activate the audio session or how to work around this would be highly appreciated. Thank you!
5
0
1.3k
Aug ’26
AVAudioSession ioBufferDuration always default to 512 samples on MacOS27 no matter what is requested
Hello, I develop an audio processing demo app that has been working fine on iOS/iPad and on Mac ("developed for iPad") until I upgraded to MacOS27. The app is demonstrating low latency / high temporal resolution audio spectral analysis. I am using AVAudioSession, I request the audio IO buffer to be 32 samples. This still works fine on iOS/iPadOS, but it seems that when running on MacOS27 the buffer size always defaults to 512 samples no matter what I request (smaller or larger). This applies to the "Designed for iPad" version running on MacOS and any version running in the iPhone and iPad simulators on MacOS. The app seems to be working as intended on physical iPhones and iPads. I made a catalyst version and used AudioObjectSetPropertyData to force the IO bugger sizes to 32 samples on the system's active hardware device. This seems to succeed but still results in incorrect behaviour in my app; I am still diagnosing but I believe it's because this leaves AVAudioSession with incorrect data, and I am using AudioKit which relies on AVAudioSession (not confirmed). Regardless, is this change in behaviour intentional in MacOS27? Is there a way around it? The whole point of my app is to demonstrate efficient audio processing with very low latency - I need small input buffer size for that. Thank you for any help with this
Replies
1
Boosts
0
Views
276
Activity
3d
AVAudioSession blocks 20–36s on A2DP→HFP switch while another AudioUnit is rendering (iOS 27.0.1, AirPods Spatial Audio)
While an AVAudioPlayer/AudioUnit is rendering to AirPods over A2DP with system Spatial Audio + Head Tracking enabled, switching the shared AVAudioSession to playAndRecord + voiceChat (A2DP → HFP) blocks the main thread for tens of seconds on synchronous AVAudioSession APIs (setCategory / setMode / channel getters / setPreferred*). iOS hang detection reports a Severe Hang of 41.02 s. Stopping playback and deactivating the session before the identical switch completes in ~87 ms. Feedback: FB25324099 Environment iPhone 15 Pro (iPhone16,1), iOS 27.0.1 (24A446) AirPods worn; Spatial Audio + Head Tracking on AVFoundation-only repro (no third-party SDK): https://github.com/shinobuwz/ios27-spatial-audio-stall-repro Info.plist: LSApplicationCategoryType = public.app-category.games, LSSupportsGameMode = YES; does NOT set AVGameBypassSystemSpatialAudio (those two keys are required for system Spatial Audio on this path) Steps Wear AirPods with Spatial Audio + Head Tracking enabled Launch the repro app; allow mic (or use auto-repro) Play 440 Hz (BluetoothA2DP, spatial=1) After ~2 s, run Repro: keep playing and switch to PlayAndRecord + VoiceChat Compare with Control: stop playback + setActive:NO, then the same switch Expected: each call returns in ms; whole reconfiguration ≪ 50 ms Actual (cold launches): configuration total 20.8–28.9 s (options=13); with options=237 ≈ 36.2 s; first input buffer ~40–58 s from switch start. Control ≈ 87 ms. Evidence in the repo: docs/MEASUREMENTS-2026-10-26.md, evidence/*.log, hangs.xml, main-thread stacks in avas::client::SessionCore (sync XPC to the audio daemon). Even inputNumberOfChannels / outputNumberOfChannels getters stall for seconds. Question: Is this a known regression on iOS 27? Any workaround besides stopping all rendering AudioUnits before the HFP switch? Happy to attach sysdiagnose / Instruments / screen recording if useful.
Replies
0
Boosts
0
Views
353
Activity
4d
AVAudioRecorder loses earlier audio after Siri with iOS 27 lifecycle notifications
I’m migrating to the new notifications described in Handling audio interruptions. On an iPhone 14 running iOS 27.0.1 (24A446), I call pause() when the system deactivates the session. On .shouldResume, I await successful session.activate() and call record() on the same recorder. It returns true, but the saved file contains only the audio recorded after Siri. To reproduce: record for five seconds, invoke and dismiss Siri, record for another five seconds, then stop and play. The earlier five seconds are missing. A legacy-notification control preserved both portions on the same phone. Is another step required to preserve the recording with the new notifications, or is this a known issue? I found this similar report, although it uses the legacy API. Minimal reproduction Built with Xcode 27.1. Create a SwiftUI iOS app targeting iOS 27, replace its generated App.swift with the code below, and add these Info.plist entries: NSMicrophoneUsageDescription: Test audio recording UIBackgroundModes: an array containing audio import SwiftUI import AVFoundation @main struct RecorderReproApp: App { var body: some Scene { WindowGroup { RecorderReproView() } } } @MainActor struct RecorderReproView: View { private let session = AVAudioSession.sharedInstance() private let file = URL.documentsDirectory.appendingPathComponent("recording.m4a") @State private var recorder: AVAudioRecorder? @State private var player: AVAudioPlayer? @State private var running = false @State private var interrupted = false @State private var status = "Ready" var body: some View { VStack(spacing: 24) { Button("Start") { Task { await start() } }.disabled(running) Button("Stop") { running = false interrupted = false recorder?.stop() status = file.path }.disabled(!running) Button("Play") { do { player = try AVAudioPlayer(contentsOf: file) status = "Saved duration: \(player!.duration) seconds" player?.play() } catch { status = error.localizedDescription } }.disabled(running) Text(status) } .padding() .task { for await notification in NotificationCenter.default.notifications( named: AVAudioSession.didBecomeInactiveNotification, object: session ) { guard running, let context = notification.userInfo?[AVAudioSession.deactivationContextKey] as? AVAudioSession.DeactivationContext, context.source == .system else { continue } recorder?.pause() interrupted = true status = "Interrupted" } } .task { for await notification in NotificationCenter.default.notifications( named: AVAudioSession.resumptionRecommendationNotification, object: session ) { guard running, interrupted, let context = notification.userInfo?[AVAudioSession.resumptionContextKey] as? AVAudioSession.ResumptionContext else { continue } guard context.recommendation == .shouldResume else { interrupted = false continue } do { guard try await session.activate(), running, interrupted else { continue } status = "Resumed: \(recorder!.record())" interrupted = false } catch { status = error.localizedDescription } } } } private func start() async { guard await AVAudioApplication.requestRecordPermission() else { return } do { try session.setCategory(.playAndRecord) guard try await session.activate() else { return } recorder = try AVAudioRecorder(url: file, settings: [ AVFormatIDKey: kAudioFormatMPEG4AAC_HE, AVSampleRateKey: 44_100, AVEncoderBitRateKey: 32_000, AVNumberOfChannelsKey: 2 ]) running = recorder!.record() status = "Recording: \(running)" } catch { status = error.localizedDescription } } }
Replies
0
Boosts
0
Views
428
Activity
1w
CallKit never calls didActivateAudioSession because callservicesd fails to create the audio session (SessionID 0x0) on iOS 24A446
Summary On iOS build 24A446, an incoming CallKit VoIP call is reported and answered, but the system never creates or activates the CallKit audio session, so CXProviderDelegate provider:didActivateAudioSession: is never called. Both directions of call audio stay silent. The failure is inside callservicesd / audiomxd, before the app starts its audio unit. Once it starts, later calls from the same processes keep failing until the app process is killed. App and device Bundle ID: us.zoom.videomeetings OS build: 24A446 (iPhone) Log: sysdiagnose_2026.10.16_11-15-45-0700_iPhone-OS_iPhone_24A446 Sample call: 2026-10-15 13:29:06–13:29:22 PDT Processes in that window: Zoom PID 816, callservicesd PID 2474, audiomxd PID 115 How the user hits it The app is not in the foreground. A VoIP push wakes it and we call reportNewIncomingCallWithUUID:update:completion:. The user answers from the system incoming-call UI (phone locked or unlocked). The ringtone plays. After answer there is no call audio. The same failure then happens on later calls, including a call started from inside the app, until the Zoom process is killed. Signing out or rebooting only clears it temporarily. We cannot reproduce it in our lab. It became much more frequent after devices moved to this OS. What the app does We configure one CXProvider (PlayAndRecord is applied when the system activates the session). We fulfill CXAnswerCallAction when the user answers. We start the voice audio unit only from provider:didActivateAudioSession:. We do not call AVAudioSession setActive: during this answered call. Our log line "ZMCallKitManager::didActivateAudioSession" is not present for this call. System log for the sample call 13:29:06 — incoming call reported Zoom log: Provider was asked to report a new incoming call At that moment Zoom's existing primary session is sid:0x7304f, Zoom(816), 'prim', and the app is BackgroundRunning. callservicesd then fails while creating the CallKit session: audiomxd AVAudioSessionXPCServer.mm:231 -[AVAudioSessionRemoteXPCClient createProxySession:reply:] failed due to session lookup failure for SessionID 0x0 callservicesd AVAudioSession_iOS.mm:643 Creating proxy session failed, session ID = 0x0, NSOSStatusErrorDomain -50, "Session lookup failed" audiomxd ServerSessionManager.mm:192 Sibling session creation failed. Source sessionID: 0x0. SessionID is not valid. Source PID: 2474 audiomxd AVAudioSessionXPCServer.mm:1287 Session creation failed callservicesd SessionCore_Create.mm:92 AudioSession creation failed, NSOSStatusErrorDomain 2003329396, "Session creation failed in server" callservicesd Audio session not found for call. Returning nil The ringtone still plays. That audio is callservicesd's own session sid:0x732fa, category Ringtone/Default, which activates at 13:29:06.650. It is not the call session. 13:29:15 — user answers callservicesd: Performing answer request / Perform answer call callservicesd: No provider returned for descriptor callservicesd: Audio session not found for call. Returning nil callservicesd: Answer call action fulfilled callservicesd: Error retrieving AVAudioSession provider with ID 0 Sibling session creation fails again with Source sessionID 0x0, Source PID 2474. The ringtone session is stopped. From 13:29:15 to 13:29:22 there is no "action":"activate" for a CallKit call audio session, and no provider:didActivateAudioSession: notification to Zoom. Zoom's primary session 0x7304f is still inactive. Its category is updated to PlayAndRecord / VoiceChat, but it is not activated while this call is up. 13:29:22 — call ends Provider was asked to report that call ended with reason 2 callservicesd: Setting disconnected reason to remote hangup because ended reason is 2 sid:0x732fa callservicesd going inactive The call lasted about 7 seconds with no call audio session ever created. 13:29:33 — following call, same stuck state About 11 seconds later a CXStartCallAction is fulfilled. Zoom's own session then activates: sid:0x7304f, Zoom(816), 'prim' PlayAndRecord_WithBluetooth / VoiceChat, NonMixable, going active callservicesd still cannot build its session: "No existing proxy AVAudioSession interruption provider for ID 0, creating a new one" Session creation failed in server Error retrieving AVAudioSession provider with ID 0 Audio session not found for call So an app-side setActive: after the failed call does not repair the CallKit provider. The system session id remains 0x0. How often it happens in this sysdiagnose Filtering the archive for the hard failure (not the generic "Audio session not found" line, which also appears on earlier days): "Sibling session creation failed. Source sessionID: 0x0": 93 hits, grouped into 57 bursts First burst: 2026-10-15 09:52:11 PDT Last burst: 2026-10-16 11:14:30 PDT (about a minute before this sysdiagnose was taken) "Error retrieving AVAudioSession provider with ID 0": 34 hits "Session creation failed in server": 93 hits Every one of these sibling-session failures is Source PID 2474. callservicesd stays PID 2474 and audiomxd stays PID 115 across the whole window, including overnight. The bad session id is stuck in those daemons, not in one Zoom call object. There is no log line in this archive showing callservicesd successfully activating a provider audio session for these calls. Request Please confirm this is the known CallKit failure where didActivateAudioSession is not delivered because callservicesd cannot create the audio session (Session lookup failed / Session creation failed in server, session ID 0x0). Related public reports: Feedback FB19429215, "CallKit does not activate audio session after iOS 18.4.1", and the iOS 27 thread "iOS 27 CallKit didActivateAudioSession". DTS previously advised apps not to call setActive: themselves, because the CallKit session has higher priority and an app activation can fail or disturb system state. This log matches that: the session is never created, so there is nothing for the system to activate. Please also advise which of these is safe on 24A446 when provider:didActivateAudioSession: does not arrive: Call CXProvider setConfiguration: again (same configuration) before every reportNewIncomingCallWithUUID:update:completion:. On a timeout, fail the unanswered CXAnswerCallAction so the CallKit state machine resets, without invalidating or recreating the CXProvider. Anything else that clears the stuck session ID 0x0 inside callservicesd without a device reboot. I can provide another sysdiagnose if you need a logging profile installed before the next reproduction.
Replies
3
Boosts
0
Views
1.1k
Activity
1w
Intermittent EXC_BAD_ACCESS in AURemoteIO::IPC_Uninitialize when launching an Inter-App Audio app
I'm investigating an intermittent crash in an iOS audio app when launching it through an Inter-App Audio (IAA) host Audiobus and AUM. The crash occurs during the host connection/startup process. The app begins initializing its audio engine, successfully creates and registers an ABAudioSenderPort, starts its output audio unit, and then crashes. Crash details Crash Report Exception: EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x50 Backtrace: #0 _dispatch_sync_f #1 caulk::concurrent::details::dispatch_receiver::~dispatch_receiver #2 std::__1::__shared_weak_count::__release_shared #3 caulk::concurrent::messenger::~messenger #4 CADeprecated::CAAutoDelete<caulk::concurrent::messenger>::set #5 AURemoteIO::IPC_Uninitialize #6 AURemoteIO::IPC_Uninitialize #7 AUWrappedOutputUnit::AUUninitialize #8 _XUninitialize #9 IPCAudioUnit_server #10 dispatch_mig_server #11 _dispatch_client_callout #12 _dispatch_continuation_pop #13 _dispatch_source_latch_and_call #14 _dispatch_source_invoke #15 _dispatch_lane_serial_drain #16 _dispatch_lane_invoke #17 _dispatch_root_queue_drain_deferred_wlh #18 _dispatch_workloop_worker_thread #19 _pthread_wqthread Repro: Quit Audiobus completely. Relaunch Audiobus. Launch the app from Audiobus. The app begins initialization, but crashes during or shortly after the initial host connection. Interestingly, if Audiobus remains open and I attempt to launch the app again, the crash doesn't appear to occur. Reloading the app via AUM is also reproducing the crash. A number of other apps are able to launch via Audiobus, so I think it must be how we are initialising our engine, but I haven't been able to find where we are going wrong. The app configures its audio session as follows: Category: AVAudioSessionCategoryPlayback Mode: AVAudioSessionModeDefault Preferred sample rate: 48000 Hz Preferred I/O buffer duration: approximately 5.3 ms Reported buffer size: 256 frames Input channels: 0 Output channels: 2 Audio-unit initialization The engine creates and initializes its audio unit successfully: AudioComponentInstanceNew: status = 0 AudioUnitInitialize: status = 0 AudioOutputUnitStart: status = 0 The app then creates an ABAudioSenderPort, configures its client format, and registers it with ABAudiobusController. These operations also complete successfully. The engine's RemoteIO audio unit and the sender port's audio unit are separate instances. I haven't yet worked out which instance is being uninitialized when the crash occurs. This seems to be happening across multiple iPhone and iPad models, back to at least iOS 17, and my test environment, Xcode 26.6 and iPadOS 26.5.2. Questions Has anyone encountered this caulk::concurrent::messenger::~messenger / AURemoteIO::IPC_Uninitialize crash when using IAA, Audiobus, AUM? Could this indicate a race or invalid lifecycle transition in Apple's RemoteIO/IAA IPC implementation? Are there known requirements concerning the order of audio-unit initialization, sender-port registration, host connection, and uninitialization that could explain this behavior? What additional diagnostics would help determine which audio-unit instance is being uninitialized and what triggers the failure? Any suggestions or reports of similar behavior would be greatly appreciated.
Replies
0
Boosts
0
Views
107
Activity
1w
What "System-supplied signal processing" is applied when using AVAudioSession.Mode.default or .videoRecording vs .measurement?
The documentation for AVAudioSession.Mode.measurement says that this mode will "minimize the amount of system-supplied signal processing to input and output signals" https://developer.apple.com/documentation/avfaudio/avaudiosession/mode-swift.struct/measurement Is there any documentation regarding specifically what processing is applied in the .default or .videoRecording modes and how it is different in .measurement mode? If my app adds its own signal processing, is it best practice to always use .measurement mode? What should I use for an app that applies its own signal processing to the audio in a video recording? Is it possible to "minimize system-supplied signal processing" while recording a video?
Replies
0
Boosts
0
Views
556
Activity
2w
audiomxd terminated for memory limit during short audio playback with background music
Hello, I need guidance on diagnosing an intermittent audio failure on an iPhone 12 running iOS 26.6.2. My app, Timer Workout Fitness, plays short bundled MP3 voice recordings for countdowns, repetition numbers and workout announcements. It uses React Native / Expo SDK 57 and expo-audio. The native playback implementation uses AVQueuePlayer, AVPlayerItem and AVURLAsset. Users can listen to Spotify while the app plays spoken cues, with ducking of the background music. Observed behavior: Playback can work correctly for an entire workout. Audio sometimes fails after background/foreground transitions, pausing Spotify, or completing one workout and starting another. The exact sequence is not consistently reproducible. The app may remain navigable while recorded audio becomes unavailable. Force-quitting does not always restore reliable playback. Restarting the iPhone has restored it in our tests. Speech-based voices have generally behaved more reliably before the failure. Evidence from a device Console capture: At 15:03:35 on October 12, the kernel reported termination of audiomxd with reason "per-process-limit" and a recorded footprint of 66866 KB. ReportSystemMemory confirmed the jetsam termination. Shortly before this, the Console contained AudioConverter construction messages associated with our app through mediaplaybackd. Our app subsequently reported media-services loss/reset and errors including: "Server was dead" OSStatus 1836282486 We have not established whether our playback implementation causes an accumulation of native resources, a temporary peak, or another issue. We do not assume that this is an iOS defect. The implementation originally retained up to 56 players for individual recordings and loaded them concurrently. We recently changed it to load only the recordings required by a workout: 15 players for 10 repetitions and 35 for 30 repetitions. Failures have still occurred in development testing, but we have not measured the corresponding native memory footprint. We also have a custom native patch affecting activation/deactivation and handling of media-services loss/reset. Current Expo Go tests do not include that patch; our TestFlight builds do. We can provide the patch for review. What is the recommended way to: Attribute audiomxd memory usage to our app’s playback resources? Verify that AVQueuePlayer items and associated decoding resources are released? Capture useful diagnostics for this service termination? Choose an appropriate playback architecture for frequent short local voice clips alongside background music? We have device Console logs and application diagnostic traces. We do not yet have a minimal native Xcode reproduction project and would appreciate guidance on what it should include.
Replies
0
Boosts
0
Views
122
Activity
2w
Issues with AVRoutePickerView channel switching
We are developing a voice call application that uses AVRoutePickerView, allowing users to switch between an iPhone, a speaker, and Bluetooth earphones. However, we have encountered an intermittent issue: when switching from the speaker to Bluetooth earphones, the earphones remain in a loading state, and the audio channel subsequently switches back to the speaker. How can we resolve this issue? Here is the sample code: let session = AVAudioSession.sharedInstance() do { try session.setCategory(.playAndRecord, mode: .default, options: [.allowBluetooth]) try session.overrideOutputAudioPort(isBluetoothConnected ? .none : .speaker) try session.setPreferredSampleRate(48000) try session.setPreferredIOBufferDuration(0.02) try session.setActive(true, options: []) INFO(" >>> start: hasBluetooth=\(isBluetoothConnected), inputs: \(session.currentRoute.inputs.map { $0.portType }) outputs: \(session.currentRoute.outputs.map { $0.portType })") } catch { ERROR("(error.localizedDescription)") }
Replies
5
Boosts
0
Views
2k
Activity
3w
AVSpeechSynthesizer audio pauses when the device locks, despite an active background AVAudioSession
My App announces a place name aloud via AVSpeechSynthesizer (through expo-speech) while a background location task detects the user has entered a new town. This works correctly in the foreground. In the background, with the device screen locked, speech that has already started reliably pauses mid-utterance the moment the screen locks, and resumes and completes the moment the screen is unlocked — even though: The app has UIBackgroundModes: ['audio', 'location'] declared. A genuinely active, native-confirmed AVAudioSession is already running continuously in the background (a looping AVAudioPlayer via expo-audio, separate from the speech itself). AVSpeechSynthesizer.usesApplicationAudioSession is at its default (true), so the synthesizer shares that same active session rather than managing its own. This is not a crash, and AVSpeechSynthesizer never reports onError, the utterance simply stalls and then continues later, which looks exactly like a pause/resume cycle tied to the screen lock event itself rather than any audio session interruption we can detect. What is implemented app.config.js declares the audio and location background modes, and expo-audio's config plugin with enableBackgroundPlayback: true. At app launch, expo-audio's setAudioModeAsync is called once with: { playsInSilentMode: true, shouldPlayInBackground: true, interruptionMode: 'duckOthers' } (We also tested interruptionMode: 'doNotMix' see below.) For the duration of a tracked journey, a silent/near-silent AVAudioPlayer-backed loop is started via expo-audio's createAudioPlayer(), specifically so the app has genuine continuous audio output (not just a configured session) for the whole background session. The player is also registered as the active Now Playing session via setActiveForLockScreen() (expo-audio's wrapper around MPNowPlayingInfoCenter / MPRemoteCommandCenter). When a new place is detected (from a background expo-location task), we call Speech.speak() with the place name. onStart, onDone, onStopped, and onError callbacks are all logged for diagnostics. 5. We listen to the player's native playbackStatusUpdate event to know, from real OS-reported status (not just "the .play() call didn't throw"), whether the keep-alive loop is actually playing. Observed behavior: field test evidence Device log example (stationary repeated test): 08:29:01.948 onStart 08:29:02.092 keep-alive loop confirmed playing (native status) 08:29:07.666 onDone That's a 5.7s onStart-to-onDone gap for a phrase that normally takes under 2s — consistent with the utterance pausing mid-speech when the screen locked, then resuming on unlock. A separate test that stayed unlocked completed the same kind of phrase in 1.9s. On a real 68-minute drive, locked cycles showed 9.4-12.5s gaps; some builds with more aggressive session-reactivation never completed at all (onStart with no onDone/onStopped/onError). Throughout, the background AVAudioPlayer loop's native status still reports playing: true, and Control Center shows the app as Now Playing. So the AVAudioSession is confirmably alive — only the speech utterance itself stalls on lock. What we've ruled out: usesApplicationAudioSession already defaults to true (confirmed via WWDC 2020 session 10022), the synthesizer already shares our configured session, this isn't a missing option. Tried both doNotMix and duckOthers interruption modes. Neither stops the pause-on-lock. duckOthers additionally stops the app showing as Now Playing in Control Center (doNotMix does show it). Keep-alive liveness: native playback status confirms the background AVAudioPlayer reaches playing: true within 100-800ms every time — the session itself isn't failing to activate. We can't observe AVAudioSessionInterruptionNotification directly from our React Native audio libraries, only each library's own polled status — so we can't confirm whether a real interruption notification fires at the moment of lock. That's one of our questions below. Questions: Is it expected that AVSpeechSynthesizer, with usesApplicationAudioSession=true and an already-active background AVAudioSession (.playback category, UIBackgroundModes including audio), still pauses an in-progress utterance when the screen locks and resumes on unlock? If so, is there a supported way to prevent that for a navigation/voice-prompt app? Does locking the screen alone generate an AVAudioSessionInterruptionNotification for an app in this configuration, and if so what interruption type is reported? We can't observe this through our current libraries and want to know what native behavior to expect. Apple's "Audio Guidelines By App Type" doc gives two sets of guidance that both partly apply to us: navigation apps (activate the session only when a prompt is needed, deactivate after, use duckOthers) vs. playback apps (don't stream silence to avoid suspension, use a background task instead). Is there a recommended pattern for an app needing short, infrequent spoken prompts to continue through a locked screen, triggered by a background location task rather than continuous media playback?
Replies
0
Boosts
0
Views
444
Activity
3w
UX pain point - iOS - Stopping foreground apps from cutting audio - Neurodivergent users
TL;DR Requesting a system-level iOS feature or API to prioritize background audio over foreground app interruptions for enhanced neurodivergent accessibility. Granular Audio Session Priority and Control Center Override For users who rely on parallel cognitive processing - such as neurodivergent individuals managing attention through sensory layering like jumping across apps - abrupt audio interruptions are deeply disruptive. One scenario - a user is deep in cognitive flow listening to audio via Apple Music. They then switch to Instagram to check a text or post as natural neurodivergent attention switching and a video automatically fires up audio and instantly cuts the track playing on Apple Music. Regaining the audio stream requires manual intervention and therefore a breaking of focus. Proposal - I would love and suggest a native iOS feature or Control Center overlay allowing users to define audio hierarchy across apps, e.g. by locking background media as primary; open for ideas of course. This may as well be useful in therapeutical setups to easily silence potential notifications of lower priority over audio media designed to sensorically set guidelines for a session. Scope - while potentially helpful to users in the audio engineering and music playing scene running third-party-apps like Ableton and such, the feature request is intended to assist a basic and non-teh-savvy iOS user. Technical Question - is there any undocumented or upcoming capability within ⁠AVAudioSession⁠ categories/modes that could allow a developer to gracefully intercept or suppress automatic audio ducking/interruption from third-party foreground apps? PS First post. Nothing similar found on the forum. Nice request. Would love feedback or a technical review on feasibility.
Replies
0
Boosts
0
Views
369
Activity
3w
watchOS 27 TTS/Bluetooth Issue
When playing TTS on a watchOS 27 device while AirPods or a Bluetooth headset are connected to both the Apple Watch and the iPhone: Playback begins by calling the setActive function of AVAudioSession. A successful response is received, but... ...AVAudioSession.currentRoute.outputs lists only the built-in speaker, with no entry for the Bluetooth headset or earphones. After a brief delay, an AVAudioSession.routeChangeNotification is received, and playback then switches to the AirPods. If TTS is stopped and playback is attempted again: Playback frequently fails. In this state, AVAudioSession.currentRoute.outputs still shows no Bluetooth headset or earphones. However, checking the Bluetooth settings on the Apple Watch confirms that the AirPods or Bluetooth headset are properly connected. If the app is restarted—or if you exit and re-enter the TTS playback screen—the first attempt succeeds (albeit with a delay), but subsequent attempts after stopping fail. Sometimes, playback fails right from the start. Even in this case, the AirPods remain properly connected. The issue is resolved if the AirPods are disconnected from the iPhone and connected solely to the Apple Watch. When connected only to the watch, AVAudioSession.currentRoute.outputs correctly includes the Bluetooth headset or earphones from the start, and playback issues do not occur when repeatedly stopping and restarting. Playback worked fine with simultaneous Bluetooth connections up to watchOS 26, but a strange issue has started occurring since watchOS 27. We suspect this is a bug or error introduced in watchOS 27; could you please fix it? The same issue persists even after the recent update to version 27.0.1. Alternatively, please let us know if there is a way to resolve this within the app itself. It seems impossible to fix this in the current code because there is no way to programmatically trigger a popup on the Apple Watch that forces the selection of a currently connected Bluetooth headset or AirPods. Also, it does not appear to be an issue with the TTS API.
Replies
0
Boosts
0
Views
451
Activity
4w
iPad (9th gen) headphone output ~2.5 to 4.5 dB quieter on iPadOS 27 (FB24980117)
Since iPadOS 27, the 3.5 mm headphone output on iPad (9th generation) is 2.4 to 4.5 dB quieter than on iPadOS 26, depending on frequency, with the same content, system volume and headphones. It's still present in iPadOS 27.2 beta 2 (24B5089g). It isn't app-specific. It reproduces in Safari: Connect wired headphones to the 3.5 mm jack and set system volume to 100%. Open https://www.szynalski.com/tone-generator/, set 3000 Hz, set the generator volume to 50%, and play. Measure with a sound level meter. At 3 kHz we see 2.5 to 2.9 dB less on iPadOS 27 than on iPadOS 26, across three different headphone models. Audio settings are identical between the two OS versions and Bluetooth is off. The only session-level difference we found is AVAudioSession.outputLatency, which went from 97 to 65 frames. Filed as FB24980117.
Replies
0
Boosts
0
Views
548
Activity
Sep ’26
CallKit does not activate audio session with higher probability after upgrading to iOS 18.4.1
Hi, We've noticed that this issue occurs more frequently after upgrading to iOS 18.4.1 and can result in one-way audio. Our app uses CallKit with WebRTC to establish VoIP connections. However, on iOS 18.4.1, CallKit no longer triggers: func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) We're currently comparing the occurrence rate across different iOS versions to better understand the impact. Could you please help analyze the root cause of this issue?
Replies
40
Boosts
1
Views
5.8k
Activity
Sep ’26
Low-latency, high-quality audio route w/wireless CarPlay?
Is there a supported way for a CarPlay audio app to request a lower-latency wireless playback route without communications-style audio processing or restricted volume behavior? .playback + .default on wired CarPlay gets you ~60ms latency route. The same on wireless CarPlay gets you ~1100ms latency. I know that wireless CarPlay can support faster connections as I have tested them. playAndRecord + .default and .playback + .voicePrompt negotiate approximately 160 ms output/presentation latency. However, on this head unit those paths have unacceptable side effects: The duplex route negotiates 24 kHz mono and removes or severely attenuates bass/haptic-engine content. The voice-prompt route alters volume semantics: steering-wheel/head-unit volume does not control our app’s level, and it appears to apply voice-oriented EQ or other processing. These routes therefore cannot substitute for full-bandwidth media playback, even though their latency is much better. 24 kHz mono would actually work for our app, if only it preserved the signal without voice/telephony EQ, bass removal, or special prompt-bus volume policy. Is there a documented, supported public API or AVAudioSession configuration (or other API even) that lets a CarPlay audio app request that kind of low-latency wireless media route? If not, is this an intentional limitation of wireless CarPlay media playback, and is there an appropriate enhancement-request path for real-time audio applications?
Replies
0
Boosts
0
Views
405
Activity
Sep ’26
Does the TN3135 audio-session networking exception have a defined lifetime? Seeing a ~38.5 s revoke/re-grant cycle
TN3135 describes the exception that lets a watchOS app use low-level networking while it holds an active audio session. I have that working, and the app functions — but the network path is withdrawn and restored on a strikingly regular cycle, and I would like to know whether that is expected behaviour rather than something I am doing wrong. Setup Apple Watch Series 10 (Watch7,9), watchOS 26.5. Reproduced on a Series 6 (Watch6,2). UIBackgroundModes: [audio]; AVAudioSession category .playAndRecord, mode .spokenAudio; activated with the async activate(options:completionHandler:). NWConnection with NWProtocolWebSocket to a WebSocket relay over TLS. The app streams 16 kHz mono PCM continuously while transmitting and holds the socket open otherwise. Symptom NWPathMonitor reports .unsatisfied, then .satisfied about two seconds later, over and over. Measured with the iPhone powered off, so the watch was on its own Wi-Fi: Uptime between drops Outage 36.4 s 2.1 s 36.7 s 1.9 s 36.9 s 2.1 s The regularity is what prompts the question — uptime varies by ±0.3 s and the outage is consistently 2.0 s. That reads as a timeout expiring rather than radio behaviour. What I have ruled out Not the network or the server. A browser client on the same relay, same TLS, same wire protocol, holds a WebSocket indefinitely. Not the interface. Identical cadence over the companion ipsec1 tunnel with the iPhone present, and over the watch's own en0 with the iPhone powered off. Pinning requiredInterfaceType = .wifi while the iPhone is reachable fails outright — the path offers only ipsec1. Not audio-session interruption. I observe interruptionNotification, routeChangeNotification, mediaServicesWereResetNotification and silenceSecondaryAudioHintNotification. None fire at a drop. At the moment the path goes .unsatisfied, the engine is running and the player node is actively playing. Not session idleness. Playing continuous silence for the whole session, rather than only while reconnecting, made no difference — still 36.4 s. The control that surprised me To test whether this affects any long-lived watch socket or only audio-unlocked ones, I built a second app with no AVAudioSession at all, no audio background mode, holding a URLSessionWebSocketTask and kept alive by a WKExtendedRuntimeSession so screen sleep was not a factor. It never connected. NWPathMonitor reported .unsatisfied once and never changed, across a 30 s run, and every request failed with "The Internet connection appears to be offline." I had expected URLSession to be permitted regardless. Questions Does the audio-session networking exception in TN3135 have a defined lifetime, and is a periodic revoke/re-grant cycle expected? If so, is there a supported way to hold it continuously — or is the correct design simply to expect the interruption and reconnect through it? Is it expected that an app with no audio session gets no network path at all on watchOS, including via URLSession, even in the foreground with an extended runtime session?
Replies
16
Boosts
0
Views
4k
Activity
Sep ’26
AirPods Sleep Detection pauses meditation playback with no API/callback to identify the reason
Good morning! I work on a meditation app, and since Sleep Detection was introduced for AirPods in iOS 26, we've been receiving complaints from users reporting that their meditation sessions unexpectedly stop after approximately 15–20 minutes when Sleep Detection is enabled. This seems to happen particularly during deep meditation sessions, where the user may remain still and exhibit behavior that could potentially be interpreted as falling asleep. I've also tested this on iOS 27 with the latest beta firmware available for AirPods Pro, and the same behavior still occurs. While investigating and debugging the issue, I found that there doesn't appear to be any public API that allows an app to determine that playback was paused specifically because of AirPods Sleep Detection. From the application's perspective, the AirPods appear to simply send a standard pause command to the AVPlayer, without providing any additional context or reason. There also doesn't seem to be an API that allows us to determine whether the user has Sleep Detection enabled. Even having access to that information would allow us to warn users that their meditation session could potentially be interrupted. AVAudioSession.InterruptionReason does not seem to help in this case either: https://developer.apple.com/documentation/avfaudio/avaudiosession/interruptionreason Is there currently any supported way for an app to: Detect that playback was paused specifically because of AirPods Sleep Detection? Determine whether Sleep Detection is enabled for the connected AirPods? Prevent Sleep Detection from pausing playback for specific apps or specific types of audio sessions? If none of these are currently possible, could Apple consider providing either a notification/callback indicating that Sleep Detection triggered the pause, or an option for users to exclude specific apps from Sleep Detection? This behavior is particularly problematic for meditation apps, since a user in a deep meditation session can easily be mistaken for someone who has fallen asleep. Other meditation apps appear to be affected by the same behavior as well. Best regards, Carlos Antunes
Replies
1
Boosts
0
Views
1.4k
Activity
Sep ’26
Can an iOS app programmatically enable Voice Isolation microphone mode?
Hi, I’m developing an iOS app that captures the user’s voice and sends the microphone input to an AI model for speech processing. For this use case, Voice Isolation provides a significantly better input signal in noisy environments. However, I’m currently unable to enable Voice Isolation programmatically when the app starts recording. As I understand it, microphone modes such as Automatic, Standard, Voice Isolation, and Wide Spectrum are controlled by the user through the system UI. My app can detect/observe the current microphone mode, but I have not found a public API that allows the app to select Voice Isolation itself. My questions are: Is there currently a supported public API to programmatically switch the microphone mode from Automatic/Standard → Voice Isolation? If direct selection is not supported, is there a recommended way for an app that primarily processes speech/voice input for an AI model to request or prefer Voice Isolation? Would using AVAudioSession with an appropriate voice-processing configuration, such as .voiceChat, or enabling voice processing through AVAudioEngine, provide equivalent Voice Isolation processing? Is AVCaptureDevice.showSystemUserInterface(.microphoneModes) the intended approach when an app needs the user to change the microphone mode? I understand that Apple may intentionally keep microphone-mode selection under user control. I’m mainly trying to determine whether there is a supported programmatic approach that I may have overlooked, rather than relying on a custom noise-suppression implementation. Any guidance on the recommended architecture for this use case would be greatly appreciated. Thank you!
Replies
0
Boosts
0
Views
776
Activity
Sep ’26
PushToTalk session sometimes returns silence data after activation
Hello! Thank you for bringing the new iPhone experience with the PushToTalk framework. I have a working walkie talkie app based on the PushToTalk framework. Everything works fine except for an intermittent bug that I face from time to time on different devices with different iOS versions, from iOS 18 to iOS 26.2 Beta. Sometimes the app goes into a state where the AVAudioInputNode input node tap returns buffers with a constant size that contain only silence. Leaving and rejoining a channel helps, but relaunching or reinstalling (from Xcode) the app does not. Rebooting the device or deleting and reinstalling the app also helps. I do not activate the audio session in my app. I only configure it on launch using setCategory(.playAndRecord, options: [.defaultToSpeaker, .allowBluetooth]) So the flow is: channelManager?.requestBeginTransmitting(channelUUID: globalChannelUUID) func channelManager( _ channelManager: PTChannelManager, channelUUID: UUID, didBeginTransmittingFrom source: PTChannelTransmitRequestSource ) func channelManager( _ channelManager: PTChannelManager, didActivate audioSession: AVAudioSession ) { /// ... installTapAndStart() } private func installTapAndStart() { let inputNode = audioEngine.inputNode let hardwareFormat = inputNode.outputFormat(forBus: 0) guard let targetFormat = AVAudioFormat( commonFormat: .pcmFormatFloat32, sampleRate: configuration.audioSampleRate, channels: configuration.audioChannelsCount, interleaved: true ) else { handleError(RecorderError.invalidAudioFormat) return } let converter = AVAudioConverter(from: hardwareFormat, to: targetFormat)! print("[QUICOpusRecorder]: installTap") inputNode.installTap(onBus: 0, bufferSize: tapBufferSize, format: hardwareFormat) { [weak self] buffer, _ in guard let self else { return } // Here I handle audio data and sometimes get silence } //... do { audioEngine.prepare() try audioEngine.start() } catch { print(" ⚠️ Audio engine start error: \(error)") handleError(error) } } Moreover, if the app is in the foreground and PushToTalk gets stuck in this “silence bug”, I can avoid relying on the PushToTalk flow and simulate audio session activation manually in code. In this case I do not request a transmission and do not use any PushToTalk related code, and the app captures audio data perfectly. Once I leave the channel and rejoin it again, the issue is fixed and I start to receive non silent buffers of varying size, as expected. It works for a while. It can work fine for a day or more, communicating without launching the app, or with the app in the foreground. But it can also go into the “silence” state 30 minutes after working normally. I have no clue why this happens. The only thing I notice is that when the app is in this “stuck silence bug” state, iOS does not play its “chirp” system sound when audio recording starts. P.S. Channel descriptor restoration code: extension PushToTalkEngine: PTChannelRestorationDelegate { public func channelDescriptor(restoredChannelUUID channelUUID: UUID) -> PTChannelDescriptor { print("☀️ \(#function) channelUUID: \(channelUUID)") Task { @MainActor in // Here I fetch more detailed channel data asynchronously do { await initChannelManagerIfNeeded(channelUUID: channelUUID) let channelDescriptor = currentChannelDescriptor() lastChannelDescriptorName = channelDescriptor.name try await channelManager?.setChannelDescriptor( channelDescriptor, channelUUID: channelUUID ) } catch { handleError(error) } } return PTChannelDescriptor(name: "Loading...", image: nil) } } private func initChannelManagerIfNeeded(channelUUID: UUID? = nil) async { guard let channelUUID = channelUUID ?? currentUser?.globalChannelUUID else { print("❌ No global channel uuid found") return } do { guard channelManager == nil else { try await channelManager?.setTransmissionMode(.halfDuplex, channelUUID: channelUUID) return } channelManager = try await PTChannelManager.channelManager( delegate: self, restorationDelegate: self ) try await channelManager?.setTransmissionMode(.halfDuplex, channelUUID: channelUUID) } catch { handleError(error) } }
Replies
4
Boosts
0
Views
1.6k
Activity
Aug ’26
provider(_:didActivate:) callback intermittently not triggered, causing widespread audio loss for users
Hi everyone, I am facing a critical issue where the CallKit provider delegate method provider(_:didActivate:) is intermittently not triggered. This occasionally results in a total loss of audio during some VoIP calls, while other calls work perfectly fine. Here is the sequence of steps I am currently implementing: Report Incoming Call: The app receives a VoIP push notification and reports the call using reportNewIncomingCall(with:update:completion:). Answer Action: The user taps the answer button, and the app processes the CXAnswerCallAction. Configure Audio Session: Inside the provider delegate, I configure the AVAudioSession category and mode (e.g., setting category to .playAndRecord and mode to .voiceChat). Note: As per Apple's guidelines, I do not call setActive(true) manually, expecting CallKit to activate it automatically. Despite following this standard flow, there are times when provider(_:didActivate:) is skipped entirely, meaning the audio engine fails to initialize for that specific call session. We are currently receiving a large volume of user complaints regarding this issue, as it heavily impacts the core calling experience in production. Could an Apple engineer or anyone from the community look into this? Any insights into what might be causing CallKit to occasionally fail to activate the audio session or how to work around this would be highly appreciated. Thank you!
Replies
5
Boosts
0
Views
1.3k
Activity
Aug ’26