First of all let me say that I confirmed that this behavior only happens on iOS 16, and does not happen on the previous iOS versions.
In short, the app uses Apple Vision Framework to track face rectangles in the camera input and show that in camera output with view overlays over those found faces.
The correct behavior of the apps is as follows:
- camera output is shown on the screen
- frames from camera input is constantly checked whether it contains faces
- if the face is found it's being overlaid by a circular view, and it's also being tracked (if you move the camera to the left, the view overlay will move to the left as well and the app will know it's the same face and won't draw another circle)
The breaking behaviour is as follows:
- the same
- the same
- if the face is found, at first it's being tracked correctly, but at some point if you bug it out (move the face close to the edges) it will stop recognizing that it's the same face and it will constantly register (even the same face) as another one popping in the screen, and that results in constant jittery overlap of the circular overlay view, and ultimately to the error:
Exceeded maximum allowed number of Trackers for a tracker type: VNObjectTrackerRevision2Type
Also, there's one more thing which I noticed after updating my Xcodde:
Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness
I did put those methods in background thread, but no avail, the issue only worsened from that point on.
Does anyone know what could've changed in the iOS 16 version that would impact this behaviour? Is it more likely a thread related issue, camera input related issue, VN framework related issue, or something else?
How would you go about detecting where the problem is? (I spent 2 days logging the face tracking but I've found no logical issue).