Autofocus image blurry with iPhone X's telephoto/dual camera

Not sure if anyone experienced the same. When I used .builtInTelephotoCamera or .builtInDualCamera as my capture device, auto focus failed, the image was blurry. It was blurry whether I used

.autoFocus
or
.continuousAutoFocus
. The phone basically tried hard to focus, achieved kind of a focused state, then the image got blurred again.

let device = AVCaptureDevice.default(.builtInTelephotoCamera, for: AVMediaType.video, position: .back)

or

let device = AVCaptureDevice.default(.builtInDualCamera, for: AVMediaType.video, position: .back)

Wide-angle camera on the other hand worked fine.

let device = AVCaptureDevice.default(.builtInWideAngleCamera, for: AVMediaType.video, position: .back)

I am using iPhone X and iOS 11.2 and Xcode 9.2 beta. The iPhone X hardware seems fine since focus is fine when using the phone's built-in Camera app with 1x and 2x photo modes. If this is a software issue, I suspect any iPhone (iPhone 7+, iPhone 8+, iPhone X) with dual camera will have same issue. Help..

After some digging, I figured out why, although not the solution. Autofocus with telephoto and dualcamera is out of whack when DEPTH DATA is captured. Such an inconvenice!! Wouldn't anyone want a sharp color image AND depth data together?


Solution please? Hello Apple?!

When depth data is enabled on the dual camera, the telephoto lens is the master. Perhaps you're trying to focus on something that's closer than the focal length of the telephoto camera lens?

Good to know, thanks Bford. Any documentation on the minimum focusing distance of the telephoto camera (and wide-angle camera as well) of various iPhone models including X, 7+ and 8+? So that I can give user some warning to avoid frustration.

Autofocus image blurry with iPhone X's telephoto/dual camera
 
 
Q