AVCaptureDepthDataOutput fails

Trying to use the depth API in the initial iOS 11 beta causes an internal error. Using standard AVCaptureSession boilerplate with the following block:


let output = withDepth ? AVCaptureDepthDataOutput() : AVCaptureVideoDataOutput()

if let out = output as? AVCaptureDepthDataOutput {
    out.setDelegate(self, callbackQueue: DispatchQueue.main)
}


session.addOutput(output)


If withDepth here is set to false, you get a camera preview as you would expect. If it's set to true, you get the following errors:


2017-06-07 12:00:13.919991-0500 AVDepthDataTest[870:34531] [] FigDerivedFormatDescriptionGetDerivedStorage signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (!desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigFormatDescription.c line 683
2017-06-07 12:00:13.920187-0500 AVDepthDataTest[870:34531] [] CMVideoFormatDescriptionGetDimensions signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (NULL desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigVideoFormatDescription.c line 384
2017-06-07 12:00:13.921197-0500 AVDepthDataTest[870:34531] [] FigDerivedFormatDescriptionGetDerivedStorage signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (!desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigFormatDescription.c line 683
2017-06-07 12:00:13.921574-0500 AVDepthDataTest[870:34531] [] CMVideoFormatDescriptionGetDimensions signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (NULL desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigVideoFormatDescription.c line 384
2017-06-07 12:00:13.924965-0500 AVDepthDataTest[870:34531] [] FigDerivedFormatDescriptionGetDerivedStorage signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (!desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigFormatDescription.c line 683
2017-06-07 12:00:13.925014-0500 AVDepthDataTest[870:34531] [] CMVideoFormatDescriptionGetDimensions signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (NULL desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigVideoFormatDescription.c line 384
2017-06-07 12:00:13.925851-0500 AVDepthDataTest[870:34531] [] FigDerivedFormatDescriptionGetDerivedStorage signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (!desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigFormatDescription.c line 683
2017-06-07 12:00:13.926302-0500 AVDepthDataTest[870:34531] [] CMVideoFormatDescriptionGetDimensions signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (NULL desc) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigVideoFormatDescription.c line 384
2017-06-07 12:00:14.320812-0500 AVDepthDataTest[870:34570] [] <<<< AVCaptureDevice >>>> _registerServerConnectionDiedNotification_block_invoke: (pthread:0x17e01b000) ServerConnectionDied
2017-06-07 12:00:22.971831-0500 AVDepthDataTest[870:34570] [] <<<< AVCaptureSession >>>> -[AVCaptureSession _handleServerConnectionDiedNotification]: (0x1c401b420)(pthread:0x17e01b000) ServerConnectionDied


I'm guessing this is an internal error, but it's possible my session isn't configured correctly. Any guidance is appreciated.