TTS problem iOS 17 beta

I see a lot of crashes on iOS 17 beta regarding some problem of "Text To Speech". Does anybody has a clue why TTS crashes? Anybody else seeing the same problem?


Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000000037f729380
Exception Codes: 0x0000000000000001, 0x000000037f729380
VM Region Info: 0x37f729380 is not in any region.  Bytes after previous region: 3748828033  Bytes before following region: 52622617728
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC_NANO              280000000-2a0000000 [512.0M] rw-/rwx SM=PRV  
--->  GAP OF 0xd20000000 BYTES
      commpage (reserved)      fc0000000-1000000000 [  1.0G] ---/--- SM=NUL  ...(unallocated)
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [36389]

Triggered by Thread:  9

.....

Thread 9 name:
Thread 9 Crashed:
0   libobjc.A.dylib               	0x000000019eeff248 objc_retain_x8 + 16
1   AudioToolboxCore              	0x00000001b2da9d80 auoop::RenderPipeUser::~RenderPipeUser() + 112 (AUOOPRenderPipePool.mm:400)
2   AudioToolboxCore              	0x00000001b2e110b4 -[AUAudioUnit_XPC internalDeallocateRenderResources] + 92 (AUAudioUnit_XPC.mm:904)
3   AVFAudio                      	0x00000001bfa4cc04 AUInterfaceBaseV3::Uninitialize() + 60 (AUInterface.mm:524)
4   AVFAudio                      	0x00000001bfa894bc AVAudioEngineGraph::PerformCommand(AUGraphNodeBaseV3&, AVAudioEngineGraph::ENodeCommand, void*, unsigned int) const + 772 (AVAudioEngineGraph.mm:3317)
5   AVFAudio                      	0x00000001bfa93550 AVAudioEngineGraph::_Uninitialize(NSError**) + 132 (AVAudioEngineGraph.mm:1469)
6   AVFAudio                      	0x00000001bfa4b50c AVAudioEngineImpl::Stop(NSError**) + 396 (AVAudioEngine.mm:1081)
7   AVFAudio                      	0x00000001bfa4b094 -[AVAudioEngine stop] + 48 (AVAudioEngine.mm:193)
8   TextToSpeech                  	0x00000001c70b3c5c __55-[TTSSynthesisProviderAudioEngine renderSpeechRequest:]_block_invoke + 1756 (TTSSynthesisProviderAudioEngine.m:613)
9   libdispatch.dylib             	0x00000001ae4b0740 _dispatch_call_block_and_release + 32 (init.c:1519)
10  libdispatch.dylib             	0x00000001ae4b2378 _dispatch_client_callout + 20 (object.m:560)
11  libdispatch.dylib             	0x00000001ae4b990c _dispatch_lane_serial_drain + 748 (queue.c:3885)
12  libdispatch.dylib             	0x00000001ae4ba470 _dispatch_lane_invoke + 432 (queue.c:3976)
13  libdispatch.dylib             	0x00000001ae4c5074 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6913)
14  libdispatch.dylib             	0x00000001ae4c48e8 _dispatch_workloop_worker_thread + 404 (queue.c:6507)

...

Thread 9 crashed with ARM Thread State (64-bit):
    x0: 0x0000000283309360   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x00000002833093c0
    x4: 0x00000002833093c0   x5: 0x0000000101737740   x6: 0x0000000000000013   x7: 0x00000000ffffffff
    x8: 0x0000000283309360   x9: 0x3c788942d067009a  x10: 0x0000000101547000  x11: 0x0000000000000000
   x12: 0x00000000000007fb  x13: 0x00000000000007fd  x14: 0x000000001ee24020  x15: 0x0000000000000020
   x16: 0x0000b1037f729360  x17: 0x000000037f729360  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x00000001016a8de8  x21: 0x0000000283e21d00  x22: 0x0000000283b3f1f8  x23: 0x0000000283098000
   x24: 0x00000001bfb4fc35  x25: 0x00000001bfb4fc43  x26: 0x000000028033a688  x27: 0x0000000280c93090
   x28: 0x0000000000000000   fp: 0x000000016fc86490   lr: 0x00000001b2da9d80
    sp: 0x000000016fc863e0   pc: 0x000000019eeff248     cpsr: 0x1000
   esr: 0x92000006 (Data Abort) byte read Translation fault







Does anyone have an update on this issue? Neither the iOS 17.2 beta 2 nor the Xcode 15.1 Beta 2 release notes mention it

I am also seeing this stack trace in the crash logs that Apple send via Organiser.

My app uses TTS on the iPhone and the Apple Watch and I get this crash for both iOS 17 and watchOS 10.

It feels like it has something to do with calling the stop method and not actually stopping

We are now switching to OpenAI voices to avoid having unhappy customers with crashes in the middle of performing workouts.

Cons: Our app needs to work offline so we have to add all the possible voice messages to the app... which will be quite a lot of files considering all the localisations we support.

Pros: A lot better text-to-speech audio that doesn't sound computer generated compared to Siri.

My users are still reporting this issue in iOS 17.2.1. Are there any known workarounds?

https://juejin.cn/post/7422401535214944268, This is an attempt to solve this problem

TTS problem iOS 17 beta
 
 
Q