ARVideoKit icon indicating copy to clipboard operation
ARVideoKit copied to clipboard

Crash - [AVAssetWriterInput initWithMediaType:outputSettings:sourceFormatHint:]

Open jrz-afs opened this issue 3 years ago • 0 comments

Users are experiencing a crash with ARVideoKit. It appears to be when initializing WritAR with audio enabled, in the prepareAudioDevice(_:) method.

It doesn't happen all the time; however, it is frequent enough that it is becoming a legitimate problem.

The user(s) are on iOS 13.6.x, on iPad Pro 11". ARVideoKit is the latest "swift_5" branch.

Any ideas on what might be causing this, and how we can fix it?

Relevant exception:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x18960b344 __exceptionPreprocess + 228 (NSException.m:199)
1   libobjc.A.dylib               	0x189320cc0 objc_exception_throw + 60 (objc-exception.mm:565)
2   AVFoundation                  	0x193ad57c4 -[AVAssetWriterInput initWithMediaType:outputSettings:sourceFormatHint:] + 956 (AVAssetWriterInput.m:0)
3   ARVideoKit                    	0x102de00ac @nonobjc AVAssetWriterInput.init(mediaType:outputSettings:) + 20
4   ARVideoKit                    	0x102de00ac AVAssetWriterInput.__allocating_init(mediaType:outputSettings:) + 40
5   ARVideoKit                    	0x102de00ac WritAR.prepareAudioDevice(with:) + 920
6   ARVideoKit                    	0x102de29b8 closure #1 in WritAR.init(output:width:height:adjustForSharing:audioEnabled:orientaions:queue:allowMix:) + 8
7   ARVideoKit                    	0x102de29b8 partial apply for closure #1 in WritAR.init(output:width:height:adjustForSharing:audioEnabled:orientaions:queue:allowMix:) + 28
8   ARVideoKit                    	0x102dd8298 thunk for @escaping @callee_guaranteed (@unowned Bool) -> () + 40
9   AudioToolbox                  	0x194b799a8 AudioSessionRequestRecordPermission + 896 (AudioSession.cpp:0)
10  AVFAudio                      	0x1966b7ab4 -[AVAudioSession requestRecordPermission:] + 84 (AVAudioSession.mm:1070)
11  ARVideoKit                    	0x102de1df4 specialized WritAR.init(output:width:height:adjustForSharing:audioEnabled:orientaions:queue:allowMix:) + 1732
12  ARVideoKit                    	0x102dd9270 WritAR.init(output:width:height:adjustForSharing:audioEnabled:orientaions:queue:allowMix:) + 40
13  ARVideoKit                    	0x102dd9270 WritAR.__allocating_init(output:width:height:adjustForSharing:audioEnabled:orientaions:queue:allowMix:) + 40
14  ARVideoKit                    	0x102dd9270 closure #1 in RecordAR.renderFrame() + 1508
15  ARVideoKit                    	0x102ddb3fc thunk for @callee_guaranteed () -> () + 4
16  ARVideoKit                    	0x102ddb3fc partial apply for thunk for @callee_guaranteed () -> () + 20
17  ARVideoKit                    	0x102dd41e8 thunk for @escaping @callee_guaranteed () -> () + 20
18  libdispatch.dylib             	0x1892ad5ac _dispatch_client_callout + 20 (object.m:495)
19  libdispatch.dylib             	0x1892ba360 _dispatch_lane_barrier_sync_invoke_and_complete + 60 (queue.c:996)
20  ARVideoKit                    	0x102dd8bdc RecordAR.renderFrame() + 532
21  ARVideoKit                    	0x102dd9a44 @objc RecordAR.renderFrame() + 28
22  QuartzCore                    	0x190110d6c CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 512 (CADisplay.mm:2528)
23  QuartzCore                    	0x1901e05fc display_timer_callback(__CFMachPort*, void*, long, void*) + 268 (CADisplayTimer.cpp:164)
24  CoreFoundation                	0x18955cc68 __CFMachPortPerform + 176 (CFMachPort.c:533)
25  CoreFoundation                	0x1895873f0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1937)
26  CoreFoundation                	0x189586a9c __CFRunLoopDoSource1 + 448 (CFRunLoop.c:2075)
27  CoreFoundation                	0x189581630 __CFRunLoopRun + 1856 (CFRunLoop.c:3098)
28  CoreFoundation                	0x189580bc8 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
29  GraphicsServices              	0x1939625cc GSEventRunModal + 164 (GSEvent.c:2246)
30  UIKitCore                     	0x18d733744 UIApplicationMain + 1936 (UIApplication.m:4823)

jrz-afs avatar Sep 16 '20 13:09 jrz-afs