Skip to content

Commit 444d54c

Browse files
authored
fix(ios): avoid inactive Voice Wake audio startup (#100370)
* fix(ios): avoid inactive voice wake audio startup * fix(ios): avoid inactive voice wake audio startup * fix(ios): avoid inactive voice wake audio startup
1 parent 3a3d483 commit 444d54c

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Docs: https://docs.openclaw.ai
1010

1111
### Fixes
1212

13+
- **iOS Voice Wake cleanup:** avoid initializing the microphone audio pipeline while disabling inactive Voice Wake, preventing simulator launch aborts and unnecessary audio setup.
1314
- **Agent stop recovery:** prevent late-aborting prompts from reacquiring orphaned session locks after teardown, so `/stop` leaves the conversation ready for the next turn.
1415
- **Message delivery status:** report failed and partially failed best-effort channel delivery instead of returning a success-shaped message-tool result. (#99928) Thanks @masatohoshino.
1516
- **WhatsApp credential recovery:** restore malformed primary auth state from a valid backup during startup. (#99070) Thanks @LeonidasLux.

apps/ios/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Fixed startup aborts caused by inactive Voice Wake initializing the simulator audio pipeline.
56
- Debug builds now use separate app, extension, widget, and Watch identifiers plus a distinct debug icon, so they can remain installed beside release builds.
67
- Animated the OpenClaw mascot (float, blink, antenna wiggle, claw snaps) across onboarding, sidebar, and command center, matching openclaw.ai.
78

apps/ios/Sources/Voice/VoiceWakeManager.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,20 +353,25 @@ final class VoiceWakeManager: NSObject {
353353
}
354354

355355
private func tearDownRecognitionPipeline() {
356+
let hadRecognitionPipeline = self.recognitionRequest != nil
357+
356358
self.tapDrainTask?.cancel()
357359
self.tapDrainTask = nil
358360
self.tapQueue?.clear()
359361
self.tapQueue = nil
360362

361363
self.recognitionTask?.cancel()
362364
self.recognitionTask = nil
363-
self.recognitionRequest = nil
364365

365366
if self.audioEngine.isRunning {
366367
self.audioEngine.stop()
367368
}
368-
// A tap can be installed before AVAudioEngine.start() throws.
369-
self.audioEngine.inputNode.removeTap(onBus: 0)
369+
if hadRecognitionPipeline {
370+
// Accessing inputNode initializes RemoteIO. Only touch it after
371+
// startRecognition created a request and may have installed a tap.
372+
self.audioEngine.inputNode.removeTap(onBus: 0)
373+
}
374+
self.recognitionRequest = nil
370375

371376
try? AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation)
372377
}

0 commit comments

Comments
 (0)