[Report Case Id: IN-83800]Crash often on visionOS with vivox16.x

Hi,
vivox visionOS sdk crash often on our App.

After building for the first time (first startup), it crashes after granting access to the microphone. After restarting (second startup), the channel can be successfully created and joined; after the third startup of the app, it crashes whether joining or creating.

REPORT ID: Report Case Id: IN-83800

Issues found

  • Authorizing a microphone for the first time → crash (More info see PART 2)
  • Create → crash (More info see PART 1)
  • Join → crash (More info see PART 1)
  • About five minutes after joining → crash (More info see PART 1)
  • No voice after sucess joining

Development Environment

Why not upgrade to 16.5.0

We have tried this but the Vivox for VisionOS package is not available with 16.5.0 and the download from the dashboard is not Vivox for VisionOS.

Crash information

PART1

Join and create crash log:

  PhaseIOImpl.mm:1751  phaseextio@0x10526dd10: warning: could not get client layout on output bus, using layout tag 0x650002
           PhaseIOImpl.mm:1751  phaseextio@0x10526dd10: warning: could not get client layout on output bus, using layout tag 0x650002
           AVAEInternal.h:125   [AUInterface.mm:539:SetFormat: ([[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr])] returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"
*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: '[[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"'
*** First throw call stack:
(0x193770924 0x18af64a30 0x19377081c 0x18ce9cc34 0x18ce9cfac 0x18cdd9a84 0x18ce946a8 0x18ce984d4 0x1a16a2a30 0x1a14e8220 0x1a14e0fc0 0x1a1438058 0x1a1437f3c 0x1a14dff78 0x1a15f7878 0x1a15f68b4 0x1a16b5544 0x1a159cb50 0x1a15a1600 0x1014ab488 0x10149af34 0x10149de9c 0x1014b446c 0x1014b2f88 0x10149dce4 0x10149d1f8 0x1014ae63c 0x1014af004 0x25c0f3560 0x25c0fa7bc)
Uncaught exception: com.apple.coreaudio.avfaudio: [[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"
(
	0   CoreFoundation                      0x0000000193770930 264582E1-795B-361D-A1BD-6BC2CBDC0778 + 1177904
	1   libobjc.A.dylib                     0x000000018af64a30 objc_exception_throw + 88
	2   CoreFoundation                      0x000000019377081c 264582E1-795B-361D-A1BD-6BC2CBDC0778 + 1177628
	3   AVFAudio                            0x000000018ce9cc34 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1096756
	4   AVFAudio                            0x000000018ce9cfac 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1097644
	5   AVFAudio                            0x000000018cdd9a84 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 297604
	6   AVFAudio                            0x000000018ce946a8 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1062568
	7   AVFAudio                            0x000000018ce984d4 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1078484
	8   PHASE                               0x00000001a16a2a30 F8976810-150D-349E-9131-536C994CA294 + 2570800
	9   PHASE                               0x00000001a14e8220 F8976810-150D-349E-9131-536C994CA294 + 758304
	10  PHASE                               0x00000001a14e0fc0 F8976810-150D-349E-9131-536C994CA294 + 729024
	11  PHASE                               0x00000001a1438058 F8976810-150D-349E-9131-536C994CA294 + 36952
	12  PHASE                               0x00000001a1437f3c F8976810-150D-349E-9131-536C994CA294 + 36668
	13  PHASE                               0x00000001a14dff78 F8976810-150D-349E-9131-536C994CA294 + 724856
	14  PHASE                               0x00000001a15f7878 F8976810-150D-349E-9131-536C994CA294 + 1869944
	15  PHASE                               0x00000001a15f68b4 F8976810-150D-349E-9131-536C994CA294 + 1865908
	16  PHASE                               0x00000001a16b5544 F8976810-150D-349E-9131-536C994CA294 + 2647364
	17  PHASE                               0x00000001a159cb50 F8976810-150D-349E-9131-536C994CA294 + 1497936
	18  PHASE                               0x00000001a15a1600 F8976810-150D-349E-9131-536C994CA294 + 1517056
	19  libdispatch.dylib                   0x00000001014ab488 _dispatch_block_async_invoke2 + 128
	20  libdispatch.dylib                   0x000000010149af34 _dispatch_client_callout + 20
	21  libdispatch.dylib                   0x000000010149de9c _dispatch_continuation_pop + 632
	22  libdispatch.dylib                   0x00000001014b446c _dispatch_source_latch_and_call + 460
	23  libdispatch.dylib                   0x00000001014b2f88 _dispatch_source_invoke + 864
	24  libdispatch.dylib                   0x000000010149dce4 _dispatch_continuation_pop + 192
	25  libdispatch.dylib                   0x000000010149d1f8 _dispatch_async_redirect_invoke + 672
	26  libdispatch.dylib                   0x00000001014ae63c _dispatch_root_queue_drain + 384
	27  libdispatch.dylib                   0x00000001014af004 _dispatch_worker_thread2 + 188
	28  libsystem_pthread.dylib             0x000000025c0f3560 _pthread_wqthread + 228
	29  libsystem_pthread.dylib             0x000000025c0fa7bc start_wqthread + 8
)
Message from debugger: Xcode has killed the LLDB RPC server to allow the debugger to detach from your process. You may need to manually terminate your process.
           PhaseIOImpl.mm:1151  phaseextio@0x10526dd10: error/timed out when creating external output stream with format <AVAudioFormat 0x307bcf020:  2 ch,  48000 Hz, Float32, interleaved>!
           PhaseIOImpl.mm:783   phaseextio@0x10526dd10: error initializing output stream[0], err -10875
           PhaseIOImpl.mm:636   phaseextio@0x10526dd10: error initializing single output stream, err -10875
           PhaseIOImpl.mm:523   phaseextio@0x10526dd10: error initializing spatial description for single stream!
             AUPhaseIO.mm:261   Initialize { phaseio=0x106069440, error=-10875 }

PART 2

Authorizing a microphone for the first time crash log:

InvalidOperationException: ChannelSession: Both AudioState and Text State must be disconnected
  at Unity.Services.Vivox.ChannelSession.BeginConnect (System.Boolean connectAudio, System.Boolean connectText, System.Boolean switchTransmission, System.String accessToken, System.AsyncCallback callback) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.ChannelSession.ConnectAsync (System.Boolean connectAudio, System.Boolean connectText, System.Boolean switchTransmission, System.AsyncCallback callback, System.String accessToken) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.ChannelSession.ConnectAsync (System.Boolean connectAudio, System.Boolean connectText, System.Boolean switchTransmission, System.AsyncCallback callback, System.String accessToken) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.ChannelSession.ConnectAsync (System.Boolean connectAudio, System.Boolean connectText, System.Boolean switchTransmission, System.AsyncCallback callback, System.String accessToken) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.ChannelId..ctor (System.String issuer, System.String name, System.String domain, Unity.Services.Vivox.ChannelType type, Unity.Services.Vivox.Channel3DProperties properties, System.String environmentId) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.VivoxServiceInternal.JoinChannelAsync (System.String channelName, Unity.Services.Vivox.ChatCapability chatCapability, Unity.Services.Vivox.ChannelType channelType, Unity.Services.Vivox.Channel3DProperties positionalChannelProperties, Unity.Services.Vivox.ChannelOptions channelOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.VivoxServiceInternal.JoinChannelAsync (System.String channelName, Unity.Services.Vivox.ChatCapability chatCapability, Unity.Services.Vivox.ChannelType channelType, Unity.Services.Vivox.Channel3DProperties positionalChannelProperties, Unity.Services.Vivox.ChannelOptions channelOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.VivoxServiceInternal.JoinEchoChannelAsync (System.String channelName, Unity.Services.Vivox.ChatCapability chatCapability, Unity.Services.Vivox.ChannelOptions channelOptions) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Services.Vivox.VivoxServiceInternal.JoinEchoChannelAsync (System.String channelName, Unity.Services.Vivox.ChatCapability chatCapability, Unity.Services.Vivox.ChannelOptions channelOptions) [0x00000] in <00000000000000000000000000000000>:0 

PhaseIOImpl.mm:1751  phaseextio@0x11123db30: warning: could not get client layout on output bus, using layout tag 0x650002
           PhaseIOImpl.mm:1751  phaseextio@0x11123db30: warning: could not get client layout on output bus, using layout tag 0x650002
Scene will resign active: <UIWindowScene: 0x11237d480; role: UIWindowSceneSessionRoleVolumetricApplication; persistentIdentifier: com.phantomsxr.nin1:SFBSystemService-901934FE-762D-44E3-B963-1CD7E1AFD53B; activationState: UISceneActivationStateForegroundActive>
           AVAEInternal.h:125   [AUInterface.mm:539:SetFormat: ([[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr])] returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"
*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: '[[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"'
*** First throw call stack:
(0x193770924 0x18af64a30 0x19377081c 0x18ce9cc34 0x18ce9cfac 0x18cdd9a84 0x18ce946a8 0x18ce984d4 0x1a16a2a30 0x1a14e8220 0x1a14e0fc0 0x1a1438058 0x1a1437f3c 0x1a14dff78 0x1a15f7878 0x1a15f68b4 0x1a16b5544 0x1a159cb50 0x1a15a1600 0x1012ff488 0x1012eef34 0x1012f1e9c 0x10130846c 0x101306f88 0x1012f1ce4 0x1012f11f8 0x10130263c 0x101303004 0x25c0f3560 0x25c0fa7bc)
Uncaught exception: com.apple.coreaudio.avfaudio: [[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"
(
	0   CoreFoundation                      0x0000000193770930 264582E1-795B-361D-A1BD-6BC2CBDC0778 + 1177904
	1   libobjc.A.dylib                     0x000000018af64a30 objc_exception_throw + 88
	2   CoreFoundation                      0x000000019377081c 264582E1-795B-361D-A1BD-6BC2CBDC0778 + 1177628
	3   AVFAudio                            0x000000018ce9cc34 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1096756
	4   AVFAudio                            0x000000018ce9cfac 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1097644
	5   AVFAudio                            0x000000018cdd9a84 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 297604
	6   AVFAudio                            0x000000018ce946a8 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1062568
	7   AVFAudio                            0x000000018ce984d4 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1078484
	8   PHASE                               0x00000001a16a2a30 F8976810-150D-349E-9131-536C994CA294 + 2570800
	9   PHASE                               0x00000001a14e8220 F8976810-150D-349E-9131-536C994CA294 + 758304
	10  PHASE                               0x00000001a14e0fc0 F8976810-150D-349E-9131-536C994CA294 + 729024
	11  PHASE                               0x00000001a1438058 F8976810-150D-349E-9131-536C994CA294 + 36952
	12  PHASE                               0x00000001a1437f3c F8976810-150D-349E-9131-536C994CA294 + 36668
	13  PHASE                               0x00000001a14dff78 F8976810-150D-349E-9131-536C994CA294 + 724856
	14  PHASE                               0x00000001a15f7878 F8976810-150D-349E-9131-536C994CA294 + 1869944
	15  PHASE                               0x00000001a15f68b4 F8976810-150D-349E-9131-536C994CA294 + 1865908
	16  PHASE                               0x00000001a16b5544 F8976810-150D-349E-9131-536C994CA294 + 2647364
	17  PHASE                               0x00000001a159cb50 F8976810-150D-349E-9131-536C994CA294 + 1497936
	18  PHASE                               0x00000001a15a1600 F8976810-150D-349E-9131-536C994CA294 + 1517056
	19  libdispatch.dylib                   0x00000001012ff488 _dispatch_block_async_invoke2 + 128
	20  libdispatch.dylib                   0x00000001012eef34 _dispatch_client_callout + 20
	21  libdispatch.dylib                   0x00000001012f1e9c _dispatch_continuation_pop + 632
	22  libdispatch.dylib                   0x000000010130846c _dispatch_source_latch_and_call + 460
	23  libdispatch.dylib                   0x0000000101306f88 _dispatch_source_invoke + 864
	24  libdispatch.dylib                   0x00000001012f1ce4 _dispatch_continuation_pop + 192
	25  libdispatch.dylib                   0x00000001012f11f8 _dispatch_async_redirect_invoke + 672
	26  libdispatch.dylib                   0x000000010130263c _dispatch_root_queue_drain + 384
	27  libdispatch.dylib                   0x0000000101303004 _dispatch_worker_thread2 + 188
	28  libsystem_pthread.dylib             0x000000025c0f3560 _pthread_wqthread + 228
	29  libsystem_pthread.dylib             0x000000025c0fa7bc start_wqthread + 8
)

Best,
NSWell

Hello @NSWell!

Thanks for reporting this.
Are you experiencing these crashes through the simulator, or are you using an actual visionOS device?

For the error ChannelSession: Both AudioState and Text State must be disconnected in Part 2, this should be resolved in 16.5.0, which is now available in the Unity Dashboard.

Hi,

Thank you for your reply and help.

are you using an actual visionOS device?

YES, actual visionOS device!

this should be resolved in 16.5.0, which is now available in the Unity Dashboard.

We have tried this and the SDK downloaded from the dashboard does not work missing vivox for visionOS libs.(we dont use vivox for visionOS 16.4.0 with 16.5.0)

Hey!
Thanks for letting us know about your issue with the 16.5.0 visionOS package downloaded from Unity Dashboard - we’ve corrected the incorrect artifact.

Please let us know if you’re still having issues with the package or the crashes you’ve mentioned after trying the 16.5.0 Vivox package~

Hi @UnityGarChar @vgauth ,
We have updated to 16.5.0 but it still crashes. Same as 16.4.0.

cannot add handler to 0 from 1 - dropping
           PhaseIOImpl.mm:1751  phaseextio@0x103519ae0: warning: could not get client layout on output bus, using layout tag 0x650002
           PhaseIOImpl.mm:1751  phaseextio@0x103519ae0: warning: could not get client layout on output bus, using layout tag 0x650002
           AVAEInternal.h:125   [AUInterface.mm:539:SetFormat: ([[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr])] returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"

*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: '[[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"'
*** First throw call stack:
(0x18ed18924 0x18650ca30 0x18ed1881c 0x188444c34 0x188444fac 0x188381a84 0x18843c6a8 0x1884404d4 0x19cc4aa30 0x19ca90220 0x19ca88fc0 0x19c9e0058 0x19c9dff3c 0x19ca87f78 0x19cb9f878 0x19cb9e8b4 0x19cc5d544 0x19cb44b50 0x19cb49600 0x105813488 0x105802f34 0x105805e9c 0x10581c46c 0x10581af88 0x105805ce4 0x1058051f8 0x10581663c 0x105817004 0x25769b560 0x2576a27bc)
Uncaught exception: com.apple.coreaudio.avfaudio: [[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 "(null)"
(
	0   CoreFoundation                      0x000000018ed18930 264582E1-795B-361D-A1BD-6BC2CBDC0778 + 1177904
	1   libobjc.A.dylib                     0x000000018650ca30 objc_exception_throw + 88
	2   CoreFoundation                      0x000000018ed1881c 264582E1-795B-361D-A1BD-6BC2CBDC0778 + 1177628
	3   AVFAudio                            0x0000000188444c34 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1096756
	4   AVFAudio                            0x0000000188444fac 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1097644
	5   AVFAudio                            0x0000000188381a84 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 297604
	6   AVFAudio                            0x000000018843c6a8 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1062568
	7   AVFAudio                            0x00000001884404d4 34D88B3F-EB90-3E03-8012-E33FB5FD8985 + 1078484
	8   PHASE                               0x000000019cc4aa30 F8976810-150D-349E-9131-536C994CA294 + 2570800
	9   PHASE                               0x000000019ca90220 F8976810-150D-349E-9131-536C994CA294 + 758304
	10  PHASE                               0x000000019ca88fc0 F8976810-150D-349E-9131-536C994CA294 + 729024
	11  PHASE                               0x000000019c9e0058 F8976810-150D-349E-9131-536C994CA294 + 36952
	12  PHASE                               0x000000019c9dff3c F8976810-150D-349E-9131-536C994CA294 + 36668
	13  PHASE                               0x000000019ca87f78 F8976810-150D-349E-9131-536C994CA294 + 724856
	14  PHASE                               0x000000019cb9f878 F8976810-150D-349E-9131-536C994CA294 + 1869944
	15  PHASE                               0x000000019cb9e8b4 F8976810-150D-349E-9131-536C994CA294 + 1865908
	16  PHASE                               0x000000019cc5d544 F8976810-150D-349E-9131-536C994CA294 + 2647364
	17  PHASE                               0x000000019cb44b50 F8976810-150D-349E-9131-536C994CA294 + 1497936
	18  PHASE                               0x000000019cb49600 F8976810-150D-349E-9131-536C994CA294 + 1517056
	19  libdispatch.dylib                   0x0000000105813488 _dispatch_block_async_invoke2 + 128
	20  libdispatch.dylib                   0x0000000105802f34 _dispatch_client_callout + 20
	21  libdispatch.dylib                   0x0000000105805e9c _dispatch_continuation_pop + 632
	22  libdispatch.dylib                   0x000000010581c46c _dispatch_source_latch_and_call + 460
	23  libdispatch.dylib                   0x000000010581af88 _dispatch_source_invoke + 864
	24  libdispatch.dylib                   0x0000000105805ce4 _dispatch_continuation_pop + 192
	25  libdispatch.dylib                   0x00000001058051f8 _dispatch_async_redirect_invoke + 672
	26  libdispatch.dylib                   0x000000010581663c _dispatch_root_queue_drain + 384
	27  libdispatch.dylib                   0x0000000105817004 _dispatch_worker_thread2 + 188
	28  libsystem_pthread.dylib             0x000000025769b560 _pthread_wqthread + 228
	29  libsystem_pthread.dylib             0x00000002576a27bc start_wqthread + 8
)

Hi,

The vivox voice system is very urgent for our project. The current bug prevents us from using vivox normally and may cause the delay of our project. So are there any other solutions?

Best,
NSWell

Is there any update?