title: Face detection isn't working on Asus device when trying to pass image from camera 2 API to detector
body: <p>I am trying to use MLKit in my app for face detection. I am using Camera 2 API to get the image from image reader and pass it to the face detector for processing. This works very well on devices like Motorola, Readmi, Realme and, also most of Samsung devices but fails on Asus. I checked the log and found out that</p>
  <blockquote>
  <p>setOnImageAvailableListener</p>
  </blockquote>
  <p>is called only once instead of calling for every frame.</p>
  <p>Attaching my code snippet below.</p>
  <pre><code>imageReader = ImageReader.newInstance(
             480,
              640
              ImageFormat.YUV_420_888,
              2
          )
  
  val previewSurface = Surface(texture)
          mPreviewBuilder!!.addTarget(previewSurface)
  
  val recordingSurface = imageReader?.surface!!
  mPreviewBuilder?.addTarget(recordingSurface!!)
  
  mCameraDevice!!.createCaptureSession(
              listOf(previewSurface, recordingSurface),
              object : CameraCaptureSession.StateCallback() {
                  override fun onConfigured(@NonNull session: CameraCaptureSession) {
                      mPreviewSession = session
                      updatePreview()
  
              val realTimeOpts = FaceDetectorOptions.Builder()
              .setContourMode(FaceDetectorOptions.CONTOUR_MODE_ALL)
              .setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_FAST)
              .enableTracking()
              .build()
  
          detector = FaceDetection.getClient(realTimeOpts)
  
   imageReader?.setOnImageAvailableListener({ reader -&gt;
              if (isProcessing) return@setOnImageAvailableListener
           
              reader.acquireLatestImage().let { image -&gt;
                  try {
                      isProcessing = true
  
                      synchronized(processorLock) {
                          // Real-time contour detection
  
                          detector?.process(
                              InputImage.fromMediaImage(
                                  image,
                                  getRotationCompensation()
                              )
                          )?.addOnSuccessListener { faces -&gt;
                              // Task completed successfully
                              // ...
                              for (face in faces) {
                                  val faceGraphic = FaceGraphic(graphicOverlay, face)
                                  if (faces.isNotEmpty()) {
                                  Log.d(TAG, &quot;Face detected!&quot;)
                                  }
                              }
                       
                              isProcessing = false
                              image?.close()
                          }
                              ?.addOnFailureListener { e -&gt;
                                  // Task failed with an exception
                                  // ...
                                  image?.close()
                                  detector?.close()
                                  isProcessing = false                          
                                  e.printStackTrace()
                              }
                  }
  
                  override fun onConfigureFailed(@NonNull session: CameraCaptureSession) {
                 
                  }
              }, mBackgroundHandler
          )
  </code></pre>
  <p>Anyone having Asus device can please confirm if they are facing similar issue.</p>
  <blockquote>
  <ul>
  <li>Phone make and model: Asus Zenfone Max M2</li>
  <li>OS version: Android 9</li>
  </ul>
  </blockquote>