Apple iOS ARKit: "A sensor failed to deliver the required input" error and stop working

I am developing an application that uses both ARKit and hardware video decoder. As soon as the decoder start to decode, the following error message appears in console and prevent tracking from working properly. Occasionally, this error do not show up and the app works normally. After some debugging, I found out this error only happens at the "beginning" (shortly after launching the app). Once it passes that point, it works fine for the rest of the time. Does anyone know what the problem is or how to go around it?


--------------------------------------------------------------------------------

2017-08-11 20:48:02.550228-0700 PortalMetal[4037:893878] [] <<<< AVCaptureSession >>>> -[AVCaptureSession _handleServerConnectionDiedNotification]: (0x1c0007eb0)(pthread:0x170387000) ServerConnectionDied


2017-08-11 20:48:02.564053-0700 PortalMetal[4037:893747] [Session] Session did fail with error: Error Domain=com.apple.arkit.error Code=102 "Required sensor failed." UserInfo={NSLocalizedFailureReason=A sensor failed to deliver the required input., NSUnderlyingError=0x1c4c51280 {Error Domain=AVFoundationErrorDomain Code=-11819 "Cannot Complete Action" UserInfo={NSLocalizedDescription=Cannot Complete Action, NSLocalizedRecoverySuggestion=Try again later.}}, NSLocalizedRecoverySuggestion=Make sure that the application has the required privacy settings., NSLocalizedDescription=Required sensor failed.}

Replies

I'm having the exact same issue. I have no idea how to fix it -- seems like a bug with AR kit? Have you been able to work around this?

What other components are you using? I just updated both Xcode 9 and iOS 11 to the release versions. However, it did not help solving this problem. I wonder if anybody from internal can help us out.

Same issue here. Happens when encoding H.264 video with Twilio Video 2.0

It sounds like the video decoder you're adding is interrupting the AVCaptureSession used by ARKit. Does the ARSession delegate sessionWasInterrupted method get triggered?

Hi funnest,


Sorry, I don't think I was notified that there was a reply here. I will take another look in the next day or two, and reply back with what I find.


Thanks,

Sean

Here is the output from my app during the error. It happens on the very first frame captured by Twilio Video, after ARKit has been running for a few seconds already. It only happens when using the H264 codec. I've opened a support ticket with them as well.


```

2017-10-02 23:41:17.537878-0700 App DEV[2776:550759] [] nw_connection_get_connected_socket 33 Connection has no connected handler

2017-10-02 23:41:17.537904-0700 App DEV[2776:550759] TCP Conn 0x1c0363900 Failed : error 0:61 [61]

2017-10-02 23:41:17.775368-0700 App DEV[2776:550539] XMachServer.cpp:106:RequestPortDeathNotification: AudioSessionClient is deallocating someone's notification port! (0x19b07)

2017-10-02 23:41:17.806318-0700 App DEV[2776:550565] [] <<<< AVCaptureDevice >>>> _registerServerConnectionDiedNotification_block_invoke: (pthread:0x16f99f000) ServerConnectionDied

2017-10-02 23:41:17.807316-0700 App DEV[2776:550549] [] <<<< CompressionSessionRemote >>>> vtcsr_dequeueAllPendingFramesAndCallbackClientForEach_block_invoke: dequeue failed (-12912)

2017-10-02 23:41:17.807502-0700 App DEV[2776:550769] [] VTCompressionSessionRemote_GetPixelBufferPool signalled err=-12912 (kVTVideoEncoderMalfunctionErr) (Lost server connection) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMedia/EmbeddedCoreMedia-2180.7/Celeste/Sources/VideoToolboxRemote/VTCompressionSession_Remote.c:970

2017-10-02 23:41:17.807626-0700 App DEV[2776:550769] [] <<<< CompressionSessionRemote >>>> VTCompressionSessionRemote_GetPixelBufferPool: creating pixel buffer pool failed -12912

2017-10-02 23:41:18.566697-0700 App DEV[2776:550549] [] nw_connection_get_connected_socket 34 Connection has no connected handler

2017-10-02 23:41:18.566725-0700 App DEV[2776:550549] TCP Conn 0x1c417b600 Failed : error 0:61 [61]

2017-10-02 23:41:18.896441-0700 App DEV[2776:550565] [] <<<< AVCaptureSession >>>> -[AVCaptureSession _handleServerConnectionDiedNotification]: (0x1c401ca40)(pthread:0x16f99f000) ServerConnectionDied

2017-10-02 23:41:18.922468-0700 App DEV[2776:550429] [Session] Session did fail with error: Error Domain=com.apple.arkit.error Code=102 "Required sensor failed." UserInfo={NSLocalizedFailureReason=A sensor failed to deliver the required input., NSUnderlyingError=0x1c524d470 {Error Domain=AVFoundationErrorDomain Code=-11819 "Cannot Complete Action" UserInfo={NSLocalizedDescription=Cannot Complete Action, NSLocalizedRecoverySuggestion=Try again later.}}, NSLocalizedRecoverySuggestion=Make sure that the application has the required privacy settings., NSLocalizedDescription=Required sensor failed.}

2017-10-02 23:41:18.993403-0700 App DEV[2776:550565] [] <<<< AVCaptureDevice >>>> _registerServerConnectionDiedNotification_block_invoke: (pthread:0x16f99f000) ServerConnectionDied

2017-10-02 23:41:18.993972-0700 App DEV[2776:550539] [] <<<< CompressionSessionRemote >>>> vtcsr_dequeueAllPendingFramesAndCallbackClientForEach_block_invoke: dequeue failed (-12912)

2017-10-02 23:41:22.031352-0700 App DEV[2776:550769] [] nw_connection_get_connected_socket 35 Connection has no connected handler

2017-10-02 23:41:22.031409-0700 App DEV[2776:550769] TCP Conn 0x1c0362e80 Failed : error 0:61 [61]

2017-10-02 23:41:23.669098-0700 App DEV[2776:550565] [] <<<< AVCaptureSession >>>> -[AVCaptureSession _handleServerConnectionDiedNotification]: (0x1c401ca40)(pthread:0x16f99f000) ServerConnectionDied

2017-10-02 23:41:23.672653-0700 App DEV[2776:550565] [] nw_connection_get_connected_socket 36 Connection has no connected handler

2017-10-02 23:41:23.672679-0700 App DEV[2776:550565] TCP Conn 0x1c417ec00 Failed : error 0:61 [61]

2017-10-02 23:41:23.783749-0700 App DEV[2776:550429] 30: AudioSessionSetActive_Priv is passing a serverPID of 0 to CheckRPCError!

```


It was actually `sessionDidFailWithError` that was called.


I'm going to try creating a simpler app and see if I can reproduce with nothing else going on.

bump, did you find a solution?

Hello iOS word!

I just wanted to let you know that I faced a similar error message and I solved the issue by allowing geolocalisation on my iPhone.

Good continuation all.