Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV Error on production/compiled app when using Worklets.createContext #173

Open
luicfrr opened this issue Apr 23, 2024 · 19 comments
Open

Comments

@luicfrr
Copy link

luicfrr commented Apr 23, 2024

This problem is related to this issue.

If I try to use runAsync method (wich uses Worklets.createContext method) my app crash while running compiled apk or running it in expo production mode (npx expo run:android -d --variant release).

In dev mode the app don't crash and everything works really fine.

With any version before 1.0.0-beta.3 (and also after a lot of tests) I came to the conclusion that the app don't crash and everything works fine (this was also my workaround to get my vision-camera's face-detector plugin working) if I create my context this way:

function useWorklet(
  func: () => void,
  dependencyList: DependencyList
): WorkletType {
  const worklet = React.useMemo( () => {
    // this was the trick
    const context: any = 'MyContext'
    return Worklets.createRunInContextFn( func, context )
  }, dependencyList )

  return worklet
}

const test = useWorklet() {
  'worklet'
  .... do anything
}

But after 1.0.0-beta.3 I can't do this workaround anymore as now we must call createRunAsync from a created context and this makes the app crash.

I'm currently using worklets core 1.1.1 version with vision camera 4.0.1 and this problem is still happening.

Here's a very simple reproducible code:

function Index() {
  const runOnJs = Worklets.createRunOnJS( () => {
    console.log( 'hello from js' )
  } )

  const context = Worklets.createContext( 'MyContext' )
  const runOnContext = context.createRunAsync( () => {
    'worklet'
    console.log( 'hello from context' )
    runOnJs()
  } )

  const frameProcessor = useFrameProcessor( ( frame ) => {
    'worklet'

    runOnContext()
  }, [] )

  return <Reanimated.View>
    <VisionCamera
      frameProcessor={ frameProcessor }
      pixelFormat='yuv'
      .... other vision camera props
    />
  </Reanimated.View>
}

Thanks for any help.

@rodgomesc
Copy link

rodgomesc commented Apr 24, 2024

can you pls attach adb logcat logs?

@luicfrr
Copy link
Author

luicfrr commented Apr 24, 2024

@rodgomesc sure, here is a full logcat:

---------------------------- PROCESS STARTED (2164) for package com.facedetector.example ----------------------------
 2164-2169  zygote                              Do partial code cache collection, code=30KB, data=25KB
 2164-2169  zygote                              After code cache collection, code=30KB, data=25KB
 2164-2169  zygote                              Increasing code cache capacity to 128KB
 2164-2164  SoLoader                            SoLoader already initialized
 2164-2185  OpenGLRenderer                      HWUI GL Pipeline
 2164-2164  InputTransport                      Input channel constructed: fd=54
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  setView = DecorView@267ae35[MainActivity] TM=true MM=false
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  dispatchAttachedToWindow
 2164-2164  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  Relayout returned: old=[0,0][0,0] new=[0,0][720,1280] result=0x7 surface={valid=true 3359508480} changed=true
 2164-2180  ExpoModulesCore                     ✅ AppContext was initialized
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  MSG_RESIZED_REPORT: frame=Rect(0, 0 - 720, 1280) ci=Rect(0, 48 - 0, 0) vi=Rect(0, 48 - 0, 0) or=1
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  MSG_WINDOW_FOCUS_CHANGED 1
 2164-2185  OpenGLRenderer                      Initialized EGL, version 1.4
 2164-2185  OpenGLRenderer                      Swap behavior 2
 2164-2164  InputMethodManager                  Starting input: tba=android.view.inputmethod.EditorInfo@2e18ea5 nm : com.facedetector.example ic=null
 2164-2164  InputMethodManager                  startInputInner - mService.startInputOrWindowGainedFocus
 2164-2185  libGLESv1                           STS_GLApi : DTS, ODTC are not allowed for Package : com.facedetector.example
 2164-2176  InputTransport                      Input channel constructed: fd=61
 2164-2185  mali_winsys                         EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [720x1280]-format:1
 2164-2185  OpenGLRenderer                      eglCreateWindowSurface = 0xc69c0640
 2164-2180  CameraManagerGlobal                 Connecting to camera service
 2164-2180  VendorTagDescriptor                 addVendorDescriptor: vendor tag id 3854507339 added
 2164-2164  InputMethodManager                  Starting input: tba=android.view.inputmethod.EditorInfo@a4cfc46 nm : com.facedetector.example ic=null
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.th3rdwave.safeareacontext.SafeAreaProviderManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.th3rdwave.safeareacontext.SafeAreaViewManager
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.th3rdwave.safeareacontext.SafeAreaViewShadowNode
 2164-2200  unknown:ViewManagerPropertyUpdater  Could not find generated setter for class com.mrousavy.camera.react.CameraViewManager
 2164-2200  NetworkSecurityConfig               No Network Security Config specified, using platform default
 2164-2199  zygote                              Deoptimizing com.facebook.react.bridge.WritableNativeMap com.facebook.react.bridge.Arguments.makeNativeMap(java.util.Map) due to JIT inline cache
 2164-2205  CameraDevices                       Initializing ProcessCameraProvider...
 2164-2200  CameraDevices                       Camera #0 is now available.
 2164-2200  CameraDevices                       Camera #1 is now available.
 2164-2207  CameraManager                       getCameraCharacteristics : cameraId = 0
 2164-2207  CameraManager                       getCameraCharacteristics : cameraId = 1
 2164-2207  CameraRepository                    Added camera: 0
 2164-2207  Camera2CameraInfo                   Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
 2164-2207  CameraRepository                    Added camera: 1
 2164-2207  Camera2CameraInfo                   Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
 2164-2207  CameraValidator                     Verifying camera lens facing on on5xelte, lensFacingInteger: null
 2164-2209  CameraDevices                       Initializing ExtensionsManager...
 2164-2209  zygote                              Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$1>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsInitializedCallback;
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsInitializedCallback" on path: DexPathList[[zip file "/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/lib/arm, /data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
 2164-2209  zygote                                at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              
 2164-2209  zygote                              Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$1>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsInitializedCallback;
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsInitializedCallback" on path: DexPathList[[zip file "/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/lib/arm, /data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
 2164-2209  zygote                                at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              
 2164-2209  zygote                              Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$1>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsInitializedCallback;
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsInitializedCallback" on path: DexPathList[[zip file "/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/lib/arm, /data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
 2164-2209  zygote                                at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              
 2164-2209  zygote                              Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsDeinitializedCallback;
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsDeinitializedCallback" on path: DexPathList[[zip file "/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/lib/arm, /data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
 2164-2209  zygote                                at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              
 2164-2209  zygote                              Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsDeinitializedCallback;
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsDeinitializedCallback" on path: DexPathList[[zip file "/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/lib/arm, /data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
 2164-2209  zygote                                at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              
 2164-2209  zygote                              Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsDeinitializedCallback;
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsDeinitializedCallback" on path: DexPathList[[zip file "/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/lib/arm, /data/app/com.facedetector.example-7hW9CKFFg7HaEp6EdMHzuQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
 2164-2209  zygote                                at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
 2164-2209  zygote                                at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
 2164-2209  zygote                                at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:197)
 2164-2209  zygote                                at java.lang.Object com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(java.lang.Object) (CameraDevicesManager.kt:69)
 2164-2209  zygote                                at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
 2164-2209  zygote                                at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:108)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
 2164-2209  zygote                                at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
 2164-2209  zygote                                at void java.lang.Thread.run() (Thread.java:764)
 2164-2209  zygote                              
 2164-2209  ExtenderVersion                     No versioning extender found. Falling back to default.
 2164-2209  CameraDevices                       Successfully initialized!
 2164-2209  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2209  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2209  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2209  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
 2164-2209  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2209  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2209  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2209  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2199  zygote                              Deoptimizing com.facebook.react.bridge.WritableNativeMap com.facebook.react.bridge.Arguments.makeNativeMap(java.util.Map) due to JIT inline cache
 2164-2199  ExpoModulesCore                     ✅ JSI interop was installed
 2164-2199  ExpoModulesCore                     ✅ Constants were exported
 2164-2169  zygote                              Do partial code cache collection, code=58KB, data=51KB
 2164-2169  zygote                              After code cache collection, code=57KB, data=50KB
 2164-2169  zygote                              Increasing code cache capacity to 256KB
 2164-2199  ReactNativeJS                       Running "main
 2164-2199  ReactNativeJS                       Loading react-native-worklets-core...
 2164-2199  ReactNativeJS                       Worklets loaded successfully
 2164-2199  VisionCameraProxy                   Initializing VisionCameraProxy...
 2164-2199  VisionCameraProxy                   Creating Worklet Context...
 2164-2199  VisionCameraProxy                   Worklet Context created!
 2164-2199  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2199  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2199  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2199  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
 2164-2199  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2199  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2199  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2199  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  MSG_WINDOW_FOCUS_CHANGED 0
 2164-2164  InputTransport                      Input channel destroyed: fd=61
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  MSG_WINDOW_FOCUS_CHANGED 1
 2164-2164  InputMethodManager                  Starting input: tba=android.view.inputmethod.EditorInfo@9022430 nm : com.facedetector.example ic=null
 2164-2164  InputMethodManager                  startInputInner - mService.startInputOrWindowGainedFocus
 2164-2164  InputTransport                      Input channel constructed: fd=76
 2164-2199  FrameProcessorPluginRegistry        Looking up Frame Processor Plugin "detectFaces"...
 2164-2199  FrameProcessorPluginRegistry        Frame Processor Plugin "detectFaces" found! Initializing...
 2164-2436  DynamiteModule                      Considering local module com.google.mlkit.dynamite.face:10000 and remote module com.google.mlkit.dynamite.face:0
 2164-2436  DynamiteModule                      Selected local version of com.google.mlkit.dynamite.face
 2164-2199  ReactNativeJS                       Loading react-native-worklets-core...
 2164-2199  ReactNativeJS                       react-native-worklets-core installed.
 2164-2433  TransportRuntime.JobInfoScheduler   Scheduling upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=-99211561 in 86400000ms(Backend next call timestamp 1713622851490). Attempt 1
 2164-2164  CameraSession                       Camera Lifecycle changed to CREATED!
 2164-2164  CameraView                          Updating CameraSession...
 2164-2164  CameraView                          Updating CameraSession...
 2164-2164  CameraView                          Updating CameraSession...
 2164-2164  CameraSession                       configure { ... }: Waiting for lock...
 2164-2164  CameraView                          A new configure { ... } call arrived, aborting this one...
 2164-2164  CameraSession                       configure { ... }: Waiting for lock...
 2164-2164  CameraView                          A new configure { ... } call arrived, aborting this one...
 2164-2164  CameraSession                       configure { ... }: Waiting for lock...
 2164-2164  CameraSession                       configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=true, outputsChanged=true, sidePropsChanged=true, isActiveChanged=true, locationChanged=true)
 2164-2164  CameraSession                       Creating new Outputs for Camera #1...
 2164-2164  CameraSession                       Using FPS Range: null
 2164-2164  CameraSession                       Creating Preview output...
 2164-2199  FrameProcessorPluginRegistry        Looking up Frame Processor Plugin "detectFaces"...
 2164-2199  FrameProcessorPluginRegistry        Frame Processor Plugin "detectFaces" found! Initializing...
 2164-2164  CameraSession                       Creating Video output...
 2164-2164  CameraSession                       Creating new Recorder...
 2164-2164  CameraSession                       Creating YUV Frame Processor output...
 2164-2164  CameraSession                       Successfully created new Outputs for Camera #1!
 2164-2164  CameraSession                       Binding Camera #1...
 2164-2164  CameraSession                       Binding 3 use-cases...
 2164-2433  TransportRuntime.SQLiteEventStore   Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
 2164-2433  TransportRuntime.JobInfoScheduler   Scheduling upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=-104192298 in 30000ms(Backend next call timestamp 1713872223056). Attempt 1
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2433  TransportRuntime.SQLiteEventStore   Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  QualitySelector                     supportedQualities = [ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}]
 2164-2164  VideoCapture                        Found selectedQualities [ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}] by QualitySelector{preferredQualities=[ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}], fallbackStrategy=RuleStrategy{fallbackQuality=ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, fallbackRule=1}}
 2164-2433  TransportRuntime.JobInfoScheduler   Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
 2164-2164  VideoCapture                        Set custom ordered resolutions = [1920x1080, 1280x720, 720x480]
 2164-2164  DynamicRangeResolver                Resolved dynamic range for use case androidx.camera.core.Preview-a79fdaa8-18e1-4aaa-afed-59bc3bc7d1c5 to no compatible HDR dynamic ranges.
                                                DynamicRange@7f33434{encoding=UNSPECIFIED, bitDepth=0}
                                                ->
                                                DynamicRange@1eafb07{encoding=SDR, bitDepth=8}
 2164-2169  zygote                              Do full code cache collection, code=125KB, data=98KB
 2164-2169  zygote                              After code cache collection, code=100KB, data=70KB
 2164-2433  TransportRuntime.SQLiteEventStore   Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
 2164-2433  TransportRuntime.JobInfoScheduler   Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  QualitySelector                     supportedQualities = [ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}]
 2164-2164  VideoCapture                        Found selectedQualities [ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}] by QualitySelector{preferredQualities=[ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}], fallbackStrategy=RuleStrategy{fallbackQuality=ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, fallbackRule=1}}
 2164-2164  VideoCapture                        Set custom ordered resolutions = [1920x1080, 1280x720, 720x480]
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  ResolutionsMerger                   The closer aspect ratio to the sensor size (2576x1932) is 4/3.
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  ResolutionsMerger                   Parent resolutions: [2048x1536, 1440x1080, 960x720, 1920x1080, 1280x720, 720x480]
 2164-2164  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@dc7f2a}
 2164-2164  ResolutionsMerger                   Parent resolutions: [2048x1536, 1440x1080, 960x720, 1920x1080, 1280x720, 720x480]
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  QualitySelector                     supportedQualities = [ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}]
 2164-2164  VideoCapture                        Found selectedQualities [ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}] by QualitySelector{preferredQualities=[ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, ConstantQuality{value=5, name=HD, typicalSizes=[1280x720]}, ConstantQuality{value=4, name=SD, typicalSizes=[720x480, 640x480]}], fallbackStrategy=RuleStrategy{fallbackQuality=ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]}, fallbackRule=1}}
 2164-2164  VideoCapture                        Set custom ordered resolutions = [1920x1080, 1280x720, 720x480]
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@d62b3f7}
 2164-2169  zygote                              Do partial code cache collection, code=119KB, data=93KB
 2164-2169  zygote                              After code cache collection, code=119KB, data=93KB
 2164-2169  zygote                              Increasing code cache capacity to 512KB
 2164-2440  OpenGlRenderer                      EGLContext created, client version 2
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=3, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@1e87ccd}
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=4, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@b049893}
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=5, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@116fbce}
 2164-2164  DeferrableSurface                   New surface in use[total_surfaces=5, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@116fbce}
 2164-2164  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@116fbce
 2164-2440  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=6, used_surfaces=1](androidx.camera.core.processing.SurfaceEdge$SettableSurface@8539732}
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=7, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@31ff47e}
 2164-2164  DeferrableSurface                   New surface in use[total_surfaces=7, used_surfaces=2](androidx.camera.core.SurfaceRequest$2@31ff47e}
 2164-2164  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@31ff47e
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  DeferrableSurface                   use count+1, useCount=2 androidx.camera.core.SurfaceRequest$2@31ff47e
 2164-2164  VideoCapture                        onSuggestedStreamSpecUpdated: StreamSpec{resolution=1080x1920, dynamicRange=DynamicRange@d1a8f1e{encoding=SDR, bitDepth=8}, expectedFrameRateRange=[0, 0], implementationOptions=androidx.camera.camera2.impl.Camera2ImplConfig@e92bd18}
 2164-2164  VideoCapture                        suggested resolution 1080x1920 is not in custom ordered resolutions [1920x1080, 1280x720, 720x480]
 2164-2207  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763 ACTIVE
 2164-2164  CameraSession                       Successfully bound Camera #1!
 2164-2164  CameraSession                       Camera Lifecycle changed to STARTED!
 2164-2207  UseCaseAttachState                  Active and attached use case: [] for camera: 1
 2164-2164  CameraView                          invokeOnStopped()
 2164-2207  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419 ACTIVE
 2164-2207  UseCaseAttachState                  Active and attached use case: [] for camera: 1
 2164-2207  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763 ACTIVE
 2164-2207  UseCaseAttachState                  Active and attached use case: [] for camera: 1
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               Using supported quality of ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]} for size 1080x1920
 2164-2164  VideoConfigUtil                     MediaSpec video mime matches EncoderProfiles. Using EncoderProfiles to derive VIDEO settings [mime type: video/avc]
 2164-2164  VidEncVdPrflRslvr                   Resolved frame rate 30fps [Video profile frame rate: 30fps, Expected operating range: <UNSPECIFIED>]
 2164-2164  VidEncVdPrflRslvr                   Resolved VIDEO frame rate: 30fps
 2164-2164  VidEncVdPrflRslvr                   Using resolved VIDEO bitrate from EncoderProfiles
 2164-2164  VideoConfigUtil                     Base Bitrate(17000000bps) * Bit Depth Ratio (8 / 8) * Frame Rate Ratio(30 / 30) * Width Ratio(1080 / 1920) * Height Ratio(1920 / 1080) = 17000000
 2164-2164  VideoConfigUtil                     Unsupported mime type video/avc or profile level -1. Data space is unspecified.
 2164-2164  ACodec                               [] Now uninitialized
 2164-2443  ACodec                              [] onAllocateComponent
 2164-2443  OMXClient                           Treble IOmx obtained
 2164-2443  ACodec                              Set Google AAC Dec for aacProfile 0
 2164-2443  ACodec                              [OMX.Exynos.AVC.Encoder] Now Loaded
 2164-2164  AudioCapabilities                   Unsupported mime audio/mpeg-L1
 2164-2164  AudioCapabilities                   Unsupported mime audio/mpeg-L2
 2164-2164  AudioCapabilities                   Unsupported mime audio/x-ms-wma
 2164-2164  AudioCapabilities                   Unsupported mime audio/x-ima
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2164  VideoCapabilities                   Unsupported mime video/wvc1
 2164-2164  VideoCapabilities                   Unsupported mime video/x-ms-wmv
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2164  VideoCapabilities                   Unsupported profile 4 for video/mp4v-es
 2164-2164  VideoCapabilities                   Unrecognized profile/level 1/32 for video/mp4v-es
 2164-2164  VideoCapabilities                   Unrecognized profile/level 32768/2 for video/mp4v-es
 2164-2164  VideoCapabilities                   Unrecognized profile/level 32768/64 for video/mp4v-es
 2164-2164  VideoCapabilities                   Unsupported mime video/wvc1
 2164-2164  VideoCapabilities                   Unsupported mime video/x-ms-wmv
 2164-2164  VideoCapabilities                   Unsupported mime video/x-ms-wmv7
 2164-2164  VideoCapabilities                   Unsupported mime video/x-ms-wmv8
 2164-2164  VideoCapabilities                   Unsupported mime video/mp43
 2164-2443  ACodec                               [OMX.Exynos.AVC.Encoder] Now uninitialized
 2164-2443  ACodec                               [] Now kWhatShutdownCompleted event : 8492
 2164-2442  MediaCodec                          Codec shutdown complete
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  VideoCapture                        camera timebase = UPTIME, processing timebase = UPTIME
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=8, used_surfaces=2](androidx.camera.core.processing.SurfaceEdge$SettableSurface@88292c4}
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=9, used_surfaces=2](androidx.camera.core.SurfaceRequest$2@6781730}
 2164-2164  DeferrableSurface                   New surface in use[total_surfaces=9, used_surfaces=3](androidx.camera.core.SurfaceRequest$2@6781730}
 2164-2164  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@6781730
 2164-2164  Recorder                            Surface is requested in state: CONFIGURING, Current surface: 0
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2448  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2448  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2448  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2448  Recorder                            Using supported quality of ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]} for surface size 1080x1920
 2164-2448  Recorder                            Try to safely release video encoder: null
 2164-2448  VideoEncoderSession                 Create VideoEncoderSession: VideoEncoderSession@168753722 for androidx.camera.core.SurfaceRequest@8d1dc73
 2164-2448  VideoConfigUtil                     MediaSpec video mime matches EncoderProfiles. Using EncoderProfiles to derive VIDEO settings [mime type: video/avc]
 2164-2448  VidEncVdPrflRslvr                   Resolved frame rate 30fps [Video profile frame rate: 30fps, Expected operating range: <UNSPECIFIED>]
 2164-2448  VidEncVdPrflRslvr                   Resolved VIDEO frame rate: 30fps
 2164-2448  VidEncVdPrflRslvr                   Using resolved VIDEO bitrate from EncoderProfiles
 2164-2448  VideoConfigUtil                     Base Bitrate(17000000bps) * Bit Depth Ratio (8 / 8) * Frame Rate Ratio(30 / 30) * Width Ratio(1080 / 1920) * Height Ratio(1920 / 1080) = 17000000
 2164-2448  VideoConfigUtil                     Unsupported mime type video/avc or profile level -1. Data space is unspecified.
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use cases [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] now ATTACHED
 2164-2448  ACodec                               [] Now uninitialized
 2164-2164  CameraSession                       Camera State: CLOSED (has error: false)
 2164-2208  UseCaseAttachState                  All use case: [androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763, androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419] for camera: 1
 2164-2164  VideoCapture                        VideoCapture is detached from the camera. Surface update cancelled.
 2164-2164  DeferrableSurface                   surface closed,  useCount=1 closed=true androidx.camera.core.SurfaceRequest$2@6781730
 2164-2164  DeferrableSurface                   surface closed,  useCount=0 closed=true androidx.camera.core.processing.SurfaceEdge$SettableSurface@88292c4
 2164-2164  DeferrableSurface                   Surface terminated[total_surfaces=8, used_surfaces=3](androidx.camera.core.processing.SurfaceEdge$SettableSurface@88292c4}
 2164-2164  DeferrableSurface                   use count-1,  useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@6781730
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763, androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419] for camera: 1
 2164-2164  DeferrableSurface                   Surface no longer in use[total_surfaces=8, used_surfaces=2](androidx.camera.core.SurfaceRequest$2@6781730}
 2164-2164  DeferrableSurface                   Surface terminated[total_surfaces=7, used_surfaces=2](androidx.camera.core.SurfaceRequest$2@6781730}
 2164-2164  CameraSession                       Camera Lifecycle changed to CREATED!
 2164-2164  MetadataProvider                    Stopping location updates...
 2164-2450  ACodec                              [] onAllocateComponent
 2164-2164  CameraSession                       configure { ... }: Completed CameraSession Configuration! (State: CREATED)
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Resetting Capture Session
 2164-2450  OMXClient                           Treble IOmx obtained
 2164-2450  ACodec                              Set Google AAC Dec for aacProfile 0
 2164-2164  zygote                              Deoptimizing void com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(com.facebook.react.uimanager.ViewManager, android.view.View, java.lang.Object) due to JIT inline cache
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Releasing session in state INITIALIZED
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Attempting to force open the camera.
 2164-2208  CameraStateRegistry                 tryOpenCamera(Camera@8a1c951[id=1]) [Available Cameras: 1, Already Open: false (Previous state: null)] --> SUCCESS
 2164-2208  CameraStateRegistry                 Recalculating open cameras:
                                                Camera                                       State                 
                                                -------------------------------------------------------------------
                                                Camera@8a1c951[id=1]                         OPENING               
                                                Camera@3a33019[id=0]                         UNKNOWN               
                                                -------------------------------------------------------------------
                                                Open count: 1 (Max allowed: 1)
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Opening camera.
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Transitioning camera internal state: INITIALIZED --> OPENING
 2164-2208  CameraStateMachine                  New public camera state CameraState{type=OPENING, error=null} from OPENING and null
 2164-2208  CameraStateMachine                  Publishing new public camera state CameraState{type=OPENING, error=null}
 2164-2450  ACodec                              [OMX.Exynos.AVC.Encoder] Now Loaded
 2164-2208  UseCaseAttachState                  All use case: [androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763, androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419] for camera: 1
 2164-2208  CameraManager                       getCameraCharacteristics : cameraId = 1
 2164-2448  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2448  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2448  VideoEncoder                        mInputTimebase = UPTIME
 2164-2448  VideoEncoder                        mMediaFormat = {color-format=2130708361, i-frame-interval=1, mime=video/avc, width=1080, bitrate=17000000, frame-rate=30, height=1920}
 2164-2450  ACodec                               [OMX.Exynos.AVC.Encoder] Now uninitialized
 2164-2450  ACodec                               [] Now kWhatShutdownCompleted event : 8492
 2164-2449  MediaCodec                          Codec shutdown complete
 2164-2448  ACodec                               [] Now uninitialized
 2164-2450  ACodec                              [] onAllocateComponent
 2164-2450  OMXClient                           Treble IOmx obtained
 2164-2450  ACodec                              Set Google AAC Dec for aacProfile 0
 2164-2164  CameraView                          Updating CameraSession...
 2164-2450  ACodec                              [OMX.Exynos.AVC.Encoder] Now Loaded
 2164-2449  MediaCodec                          MediaCodec will operate in async mode
 2164-2450  ACodec                              recording-mode has no value at here
 2164-2164  PreviewView                         Surface requested by Preview.
 2164-2200  CameraDevices                       Camera #1 is now unavailable.
 2164-2200  CameraManager                       getCameraCharacteristics : cameraId = 1
 2164-2450  OMXUtils                            do not know color format 0x7f000011 = 2130706449
 2164-2450  OMXUtils                            do not know color format 0x10 = 16
 2164-2450  OMXUtils                            do not know color format 0x7f00a000 = 2130747392
 2164-2450  OMXUtils                            do not know color format 0x7f000789 = 2130708361
 2164-2450  ACodec                              app-name : com.facedetector.example
 2164-2450  ACodec                              setupAVCEncoderParameters with [profile: Baseline] [level: Level1]
 2164-2450  ACodec                              Enable Perceptual Video Coding
 2164-2450  ACodec                              Success set VideoMinQP(5/5/5) VideoMaxQP(50/50/50)
 2164-2450  ACodec                              SECSetparameters : default
 2164-2450  ACodec                              reconfigEncoder4OtherApps
 2164-2450  ACodec                              [OMX.Exynos.AVC.Encoder] cannot encode HDR static metadata. Ignoring.
 2164-2450  ACodec                              setupVideoEncoder succeeded
 2164-2450  ACodec                              [OMX.Exynos.AVC.Encoder] configure, AMessage : AMessage(what = 'conf', target = 7) = {
                                                  int32_t color-format = 2130708361
                                                  int32_t i-frame-interval = 1
                                                  string mime = "video/avc"
                                                  int32_t width = 1080
                                                  int32_t bitrate = 17000000
                                                  int32_t frame-rate = 30
                                                  int32_t height = 1920
                                                  int32_t encoder = 1
                                                }
 2164-2450  OMXUtils                            do not know color format 0x7f000789 = 2130708361
 2164-2448  OMXClient                           Treble IOmx obtained
 2164-2448  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2164  SurfaceView                         BG show() Surface(name=Background for - SurfaceView - com.facedetector.example/com.facedetector.example.MainActivity@850f6b6@0) android.view.SurfaceView{850f6b6 V.E...... ......ID 0,0-1080,1920}
 2164-2448  VideoEncoder                        Transitioning encoder internal state: null --> CONFIGURED
 2164-2448  Recorder                            Video source has transitioned to state: ACTIVE_NON_STREAMING
 2164-2174  zygote                              Background concurrent copying GC freed 101120(5MB) AllocSpace objects, 2(40KB) LOS objects, 58% free, 4MB/10MB, paused 395us total 104.325ms
 2164-2448  Recorder                            Video source has transitioned to state: INACTIVE
 2164-2448  Recorder                            Transitioning audio state: INITIALIZING --> INITIALIZING
 2164-2448  VideoEncoderSession                 Not provide surface, androidx.camera.core.SurfaceRequest@8d1dc73 is already serviced.
 2164-2448  VideoEncoderSession                 VideoEncoder is releasing: androidx.camera.video.internal.encoder.EncoderImpl@44e3e8d
 2164-2448  Recorder                            VideoEncoder is created. null
 2164-2164  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2164  SurfaceView                         surfaceCreated 1 #8 android.view.SurfaceView{850f6b6 V.E...... ......ID 0,0-1080,1920}
 2164-2164  SurfaceViewImpl                     Surface created.
 2164-2164  SurfaceView                         surfaceChanged (1080,1920) 1 #8 android.view.SurfaceView{850f6b6 V.E...... ......ID 0,0-1080,1920}
 2164-2164  SurfaceViewImpl                     Surface changed. Size: 1080x1920
 2164-2164  CameraSession                       configure { ... }: Waiting for lock...
 2164-2164  CameraSession                       configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=false, outputsChanged=false, sidePropsChanged=false, isActiveChanged=true, locationChanged=false)
 2164-2164  CameraSession                       Camera Lifecycle changed to STARTED!
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2164  CapabilitiesByQuality               Using supported quality of ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]} for size 1080x1920
 2164-2164  VideoConfigUtil                     MediaSpec video mime matches EncoderProfiles. Using EncoderProfiles to derive VIDEO settings [mime type: video/avc]
 2164-2164  VidEncVdPrflRslvr                   Resolved frame rate 30fps [Video profile frame rate: 30fps, Expected operating range: <UNSPECIFIED>]
 2164-2164  VidEncVdPrflRslvr                   Resolved VIDEO frame rate: 30fps
 2164-2164  VidEncVdPrflRslvr                   Using resolved VIDEO bitrate from EncoderProfiles
 2164-2164  VideoConfigUtil                     Base Bitrate(17000000bps) * Bit Depth Ratio (8 / 8) * Frame Rate Ratio(30 / 30) * Width Ratio(1080 / 1920) * Height Ratio(1920 / 1080) = 17000000
 2164-2164  VideoConfigUtil                     Unsupported mime type video/avc or profile level -1. Data space is unspecified.
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2164  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  VideoCapture                        camera timebase = UPTIME, processing timebase = UPTIME
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=8, used_surfaces=2](androidx.camera.core.processing.SurfaceEdge$SettableSurface@ded3689}
 2164-2450  ACodec                               [OMX.Exynos.AVC.Encoder] Now uninitialized
 2164-2450  ACodec                               [] Now kWhatShutdownCompleted event : 8492
 2164-2449  MediaCodec                          Codec shutdown complete
 2164-2164  DeferrableSurface                   Surface created[total_surfaces=9, used_surfaces=2](androidx.camera.core.SurfaceRequest$2@669b245}
 2164-2164  DeferrableSurface                   New surface in use[total_surfaces=9, used_surfaces=3](androidx.camera.core.SurfaceRequest$2@669b245}
 2164-2164  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@669b245
 2164-2164  Recorder                            Surface is requested in state: CONFIGURING, Current surface: 0
 2164-2448  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=17000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2448  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2448  CapabilitiesByQuality               profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=30, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=256000, sampleRate=48000, channels=2, profile=2}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=3449000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
 2164-2448  Recorder                            Using supported quality of ConstantQuality{value=6, name=FHD, typicalSizes=[1920x1080]} for surface size 1080x1920
 2164-2448  Recorder                            Try to safely release video encoder: null
 2164-2448  VideoEncoderSession                 closeInternal in RELEASED state, No-op
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2463  VideoEncoder                        Transitioning encoder internal state: CONFIGURED --> RELEASED
 2164-2463  Recorder                            Video source has transitioned to state: ACTIVE_NON_STREAMING
 2164-2463  VideoEncoderSession                 Create VideoEncoderSession: VideoEncoderSession@60351741 for androidx.camera.core.SurfaceRequest@4ad52bc
 2164-2463  VideoConfigUtil                     MediaSpec video mime matches EncoderProfiles. Using EncoderProfiles to derive VIDEO settings [mime type: video/avc]
 2164-2164  CameraSession                       Camera State: OPENING (has error: false)
 2164-2463  VidEncVdPrflRslvr                   Resolved frame rate 30fps [Video profile frame rate: 30fps, Expected operating range: <UNSPECIFIED>]
 2164-2463  VidEncVdPrflRslvr                   Resolved VIDEO frame rate: 30fps
 2164-2463  VidEncVdPrflRslvr                   Using resolved VIDEO bitrate from EncoderProfiles
 2164-2164  CameraSession                       Camera Lifecycle changed to RESUMED!
 2164-2463  VideoConfigUtil                     Base Bitrate(17000000bps) * Bit Depth Ratio (8 / 8) * Frame Rate Ratio(30 / 30) * Width Ratio(1080 / 1920) * Height Ratio(1920 / 1080) = 17000000
 2164-2463  VideoConfigUtil                     Unsupported mime type video/avc or profile level -1. Data space is unspecified.
 2164-2164  CameraSession                       configure { ... }: Completed CameraSession Configuration! (State: RESUMED)
 2164-2164  VisionCameraProxy                   Finding view 43...
 2164-2463  ACodec                               [] Now uninitialized
 2164-2164  VisionCameraProxy                   Found view 43!
 2164-2164  PreviewView                         Preview transformation info updated. TransformationInfo{getCropRect=Rect(0, 0 - 1080, 1920), getRotationDegrees=0, getTargetRotation=-1, hasCameraTransform=false, getSensorToBufferTransform=Matrix{[-0.0, -1.0, 1080.0][-1.0, 0.0, 1920.0][0.0, 0.0, 1.0]}, isMirroring=false}
 2164-2164  PreviewTransform                    Transformation info set: TransformationInfo{getCropRect=Rect(0, 0 - 1080, 1920), getRotationDegrees=0, getTargetRotation=-1, hasCameraTransform=false, getSensorToBufferTransform=Matrix{[-0.0, -1.0, 1080.0][-1.0, 0.0, 1920.0][0.0, 0.0, 1.0]}, isMirroring=false} 1080x1920 true
 2164-2470  ACodec                              [] onAllocateComponent
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2164  SurfaceViewImpl                     Surface set on Preview.
 2164-2470  OMXClient                           Treble IOmx obtained
 2164-2470  ACodec                              Set Google AAC Dec for aacProfile 0
 2164-2470  ACodec                              [OMX.Exynos.AVC.Encoder] Now Loaded
 2164-2463  VideoCapabilities                   Unrecognized profile 2130706433 for video/avc
 2164-2463  VideoCapabilities                   Unrecognized profile 2130706434 for video/avc
 2164-2463  VideoEncoder                        mInputTimebase = UPTIME
 2164-2463  VideoEncoder                        mMediaFormat = {color-format=2130708361, i-frame-interval=1, mime=video/avc, width=1080, bitrate=17000000, frame-rate=30, height=1920}
 2164-2164  ViewRootImpl@8d51d1f[MainActivity]  Relayout returned: old=[0,0][720,1280] new=[0,0][720,1280] result=0x1 surface={valid=true 3359508480} changed=false
 2164-2470  ACodec                               [OMX.Exynos.AVC.Encoder] Now uninitialized
 2164-2470  ACodec                               [] Now kWhatShutdownCompleted event : 8492
 2164-2469  MediaCodec                          Codec shutdown complete
 2164-2463  ACodec                               [] Now uninitialized
 2164-2470  ACodec                              [] onAllocateComponent
 2164-2470  OMXClient                           Treble IOmx obtained
 2164-2470  ACodec                              Set Google AAC Dec for aacProfile 0
 2164-2164  VideoCapture                        Stream info update: old: StreamInfo{id=0, streamState=INACTIVE, inProgressTransformationInfo=null} new: StreamInfo{id=0, streamState=INACTIVE, inProgressTransformationInfo=null}
 2164-2164  DeferrableSurface                   New surface in use[total_surfaces=9, used_surfaces=4](androidx.camera.core.processing.SurfaceEdge$SettableSurface@b049893}
 2164-2164  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.processing.SurfaceEdge$SettableSurface@b049893
 2164-2164  CameraOrientationUtil               getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
 2164-2470  ACodec                              [OMX.Exynos.AVC.Encoder] Now Loaded
 2164-2469  MediaCodec                          MediaCodec will operate in async mode
 2164-2470  ACodec                              recording-mode has no value at here
 2164-2470  OMXUtils                            do not know color format 0x7f000011 = 2130706449
 2164-2470  OMXUtils                            do not know color format 0x10 = 16
 2164-2470  OMXUtils                            do not know color format 0x7f00a000 = 2130747392
 2164-2470  OMXUtils                            do not know color format 0x7f000789 = 2130708361
 2164-2470  ACodec                              app-name : com.facedetector.example
 2164-2470  ACodec                              setupAVCEncoderParameters with [profile: Baseline] [level: Level1]
 2164-2470  ACodec                              Enable Perceptual Video Coding
 2164-2470  ACodec                              Success set VideoMinQP(5/5/5) VideoMaxQP(50/50/50)
 2164-2470  ACodec                              SECSetparameters : default
 2164-2470  ACodec                              reconfigEncoder4OtherApps
 2164-2470  ACodec                              [OMX.Exynos.AVC.Encoder] cannot encode HDR static metadata. Ignoring.
 2164-2470  ACodec                              setupVideoEncoder succeeded
 2164-2470  ACodec                              [OMX.Exynos.AVC.Encoder] configure, AMessage : AMessage(what = 'conf', target = 12) = {
                                                  int32_t color-format = 2130708361
                                                  int32_t i-frame-interval = 1
                                                  string mime = "video/avc"
                                                  int32_t width = 1080
                                                  int32_t bitrate = 17000000
                                                  int32_t frame-rate = 30
                                                  int32_t height = 1920
                                                  int32_t encoder = 1
                                                }
 2164-2470  OMXUtils                            do not know color format 0x7f000789 = 2130708361
 2164-2463  OMXClient                           Treble IOmx obtained
 2164-2463  Surface                             sf_framedrop debug : 0x4f4c, game : false, logging : 0
 2164-2463  VideoEncoder                        Transitioning encoder internal state: null --> CONFIGURED
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419 ACTIVE
 2164-2463  VideoEncoderSession                 provide surface: Surface(name=null)/@0x75741d8
 2164-2463  Recorder                            VideoEncoder is created. androidx.camera.video.internal.encoder.EncoderImpl@ef20816
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763, androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419] for camera: 1
 2164-2463  Recorder                            Transitioning streamId: 0 --> 123159000
 2164-2164  VideoCapture                        Stream info update: old: StreamInfo{id=0, streamState=INACTIVE, inProgressTransformationInfo=null} new: StreamInfo{id=123159000, streamState=INACTIVE, inProgressTransformationInfo=null}
 2164-2463  Recorder                            Transitioning Recorder internal state: CONFIGURING --> IDLING
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763 ACTIVE
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763, androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419] for camera: 1
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use cases [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] now DETACHED for camera
 2164-2208  UseCaseAttachState                  All use case: [] for camera: 1
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Resetting Capture Session
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Releasing session in state OPENING
 2164-2208  UseCaseAttachState                  Active and attached use case: [] for camera: 1
 2164-2208  UseCaseAttachState                  Active and attached use case: [] for camera: 1
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Closing camera.
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Transitioning camera internal state: OPENING --> CLOSING
 2164-2208  CameraStateRegistry                 Recalculating open cameras:
                                                Camera                                       State                 
                                                -------------------------------------------------------------------
                                                Camera@8a1c951[id=1]                         CLOSING               
                                                Camera@3a33019[id=0]                         UNKNOWN               
                                                -------------------------------------------------------------------
                                                Open count: 1 (Max allowed: 1)
 2164-2208  CameraStateMachine                  New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null
 2164-2208  CameraStateMachine                  Publishing new public camera state CameraState{type=CLOSING, error=null}
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use cases [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] now ATTACHED
 2164-2164  CameraSession                       Camera State: CLOSING (has error: false)
 2164-2208  UseCaseAttachState                  All use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] for camera: 1
 2164-2208  UseCaseAttachState                  Active and attached use case: [] for camera: 1
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Resetting Capture Session
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Releasing session in state CLOSING
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Transitioning camera internal state: CLOSING --> REOPENING
 2164-2208  CameraStateRegistry                 Recalculating open cameras:
                                                Camera                                       State                 
                                                -------------------------------------------------------------------
                                                Camera@8a1c951[id=1]                         OPENING               
                                                Camera@3a33019[id=0]                         UNKNOWN               
                                                -------------------------------------------------------------------
                                                Open count: 1 (Max allowed: 1)
 2164-2208  CameraStateMachine                  New public camera state CameraState{type=OPENING, error=null} from OPENING and null
 2164-2208  CameraStateMachine                  Publishing new public camera state CameraState{type=OPENING, error=null}
 2164-2164  CameraSession                       Camera State: OPENING (has error: false)
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419 ACTIVE
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419] for camera: 1
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Use case androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763 ACTIVE
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] for camera: 1
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] for camera: 1
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} CameraDevice.onOpened()
 2164-2208  Camera2CameraImpl                   {Camera@8a1c951[id=1]} Transitioning camera internal state: REOPENING --> OPENED
 2164-2208  CameraStateRegistry                 Recalculating open cameras:
                                                Camera                                       State                 
                                                -------------------------------------------------------------------
                                                Camera@8a1c951[id=1]                         OPEN                  
                                                Camera@3a33019[id=0]                         UNKNOWN               
                                                -------------------------------------------------------------------
                                                Open count: 1 (Max allowed: 1)
 2164-2208  CameraStateMachine                  New public camera state CameraState{type=OPEN, error=null} from OPEN and null
 2164-2208  CameraStateMachine                  Publishing new public camera state CameraState{type=OPEN, error=null}
 2164-2164  CameraSession                       Camera State: OPEN (has error: false)
 2164-2164  CameraView                          invokeOnInitialized()
 2164-2208  UseCaseAttachState                  All use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] for camera: 1
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] for camera: 1
 2164-2208  UseCaseAttachState                  Active and attached use case: [androidx.camera.core.ImageAnalysis-2725d34a-b056-4b41-880d-ec1f0b4e6f3c46405419, androidx.camera.core.streamsharing.StreamSharing-72fa5ad8-ecc0-4fc0-a95f-01b9ee9e0a56229785763] for camera: 1
 2164-2208  SyncCaptureSessionBase              [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@17cf411] getSurface done with results: [Surface(name=null)/@0x5188c38, Surface(name=android.graphics.SurfaceTexture@1509e8)/@0x324dc94]
 2164-2208  CaptureSession                      Opening capture session.
 2164-2208  SyncCaptureSessionImpl              [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@17cf411] start openCaptureSession
 2164-2208  DeferrableSurface                   New surface in use[total_surfaces=9, used_surfaces=5](androidx.camera.core.impl.ImmediateSurface@dc7f2a}
 2164-2208  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@dc7f2a
 2164-2208  DeferrableSurface                   New surface in use[total_surfaces=9, used_surfaces=6](androidx.camera.core.processing.SurfaceEdge$SettableSurface@d62b3f7}
 2164-2208  DeferrableSurface                   use count+1, useCount=1 androidx.camera.core.processing.SurfaceEdge$SettableSurface@d62b3f7
 2164-2207  SyncCaptureSessionImpl              [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@17cf411] Session onConfigured()
 2164-2207  CaptureSession                      Attempting to send capture request onConfigured
 2164-2207  CaptureSession                      Issuing request for session.
 2164-2207  Camera2CaptureRequestBuilder        createCaptureRequest
 2164-2207  CaptureSession                      CameraCaptureSession.onConfigured() mState=OPENED
 2164-2207  CaptureSession                      CameraCaptureSession.onReady() OPENED
 2164-2440  mali_winsys                         EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
 2164-2207  VideoCapture                        cameraCaptureResult timestampNs = 9788160821667733, current system uptimeMs = 2942109502, current system realtimeMs = 9788160872
 2164-2207  StreamStateObserver                 Update Preview stream state to STREAMING
 2164-2164  CameraView                          invokeOnStarted()
 2164-2196  libc                                Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 2196 (ionCamera.video)
---------------------------- PROCESS ENDED (2164) for package com.facedetector.example ----------------------------

SIGSEGV error happens at the exactly moment that camera preview is showed on screen.
If you need something else to test, use my react-native-vision-camera-face-detector example app at 1.6.0 version. Just run yarn android:prod and you'll see this crash.

I don't think this crash is related to my package because with my context trick it works really fine.

Another thing: This error only happens when using react-native-reanimated (as I mentioned here).

And yes, I already added processNestedWorklets on my babe.config.js

@Nurmehemmed
Copy link

@rodgomesc, Hi, Is there any hope that this issue will be resolved?) Thanks

@chrfalch
Copy link
Collaborator

@nonam4 Please add a test to the unit tests in React-native-worklets-core and submit a PR that shows the error. This makes it a lot more easy for us to fix the issue - I know it takes some time for you to make these tests, but then we'll share the workload, the error can be fixed faster, and we'll all be happy 🥳

@mrousavy
Copy link
Member

Exactly as Christian said - please add a reproduction to the example app here.

We already have a test that runs a function in a context, which itself calls another function in another context - so this should be the same as a useFrameProcessor that calls runAsync. Maybe we can just try to just run the app in release to see if that test fails then @chrfalch?

@mrousavy
Copy link
Member

mrousavy commented May 8, 2024

So it works fine when Reanimated is installed? Maybe Reanimated's babel plugin does some optimizations that we can't handle?

@luicfrr
Copy link
Author

luicfrr commented May 8, 2024

yes, worklets-core and vision-camera works fine with Reanimated on default context. On a created context it crash.

This crash happens on Android and IOS only on production/compiled app (in dev mode it works fine).

@luicfrr luicfrr changed the title App crashes in compiled apk SIGSEGV Error on production/compiled app when using Worklets.createContext May 8, 2024
@nmajumder12
Copy link

nmajumder12 commented May 16, 2024

Exactly as Christian said - please add a reproduction to the example app here.

We already have a test that runs a function in a context, which itself calls another function in another context - so this should be the same as a useFrameProcessor that calls runAsync. Maybe we can just try to just run the app in release to see if that test fails then @chrfalch?

It fails on dev mode for me on iOS as well. On the iOS it seems to process few frames initially, and then it simply stops calling to the frame processor itself. It is as if the frame processor worklet was cleared by some other process.

I am afraid that test would pass since it is just one call. The underlying issue seems to be occurring after several continuous calls.

@mrousavy
Copy link
Member

Again, please create a reproduction here in the Worklets repo. Then we can take a look.

@luicfrr
Copy link
Author

luicfrr commented May 16, 2024

I'm trying to reproduce this issue on tests without success. Maybe this issue only happens with vision-camera installed. I'll keep testing here.

@tfcornerstone
Copy link

I'm trying to reproduce this issue on tests without success. Maybe this issue only happens with vision-camera installed. I'll keep testing here.

I believe the example app for the tests do not have a dependency on reanimated. Hence it will always pass.

@luicfrr
Copy link
Author

luicfrr commented May 16, 2024

I think my test is very close to what VC's runAsync looks like:

call_async_to_js_from_worklet_thread_context: () => {
    const sharedValue = Worklets.createSharedValue<boolean | null>( null )
    const context = Worklets.createContext( "test" )
    
    // the runOnAsyncContext worklet
    const workletB = context.createRunAsync( (func: () => void) => {
      'worklet'
      try{
        func()
      } catch(e) {
        console.log('workletB error', e)
      } finally {
        // simulate update isAsyncContextBusy
        sharedValue.value = false
      }
    } )

    // the runAsync worklet
    const workletA = (func: () => void) => {
      'worklet'
      // simulate update isAsyncContextBusy
      sharedValue.value = true
      workletB( func )
    }

    // our run on js callback
    const js1 = Worklets.createRunOnJS(() => {
      console.log('hello from js')
    })

    return Expect( workletA( () => {
      'worklet'
      js1()
    } ), () => {
      return sharedValue.value === false
        ? undefined
        : `sharedValue.value to be false, got ${ sharedValue.value }`
    } )
  }

But it's not crashing. I also installed reanimated on example app but it seems to crash only when VC is also installed.

@nmajumder12
Copy link

nmajumder12 commented May 17, 2024

After playing around with the VC on android and iOS, here is the behaviors I noticed.

Using a similar code mentioned on the reproducible code section in OP.

  • Works in android debug, does not work on release (crashes)
  • Works partially on iOS for few frames until the frameProcessor itself stops being called.

After looking at VC code, I noticed that the "VisionCamera" context is created on module load...there is a difference in iOS and Android.

iOS _workletContext
android _workletContext

This would imply that this context is not source mapped in babel since it lives outside of Javascript. I am assuming there is some sort of optimization within react-native-worklets-core or reanimated, that is cleaning up the mappings/contexts which breaks the "VisionCamera" context.

To further investigate, I tried createRunAsync using default context which resolved the issue with android release mode crashing, however it did not resolve the issue where iOS VC stops running frame processor after several frames.

I was able to resolve all issues by doing VisionCameraProxy.workletContext.createRunAsync. However that runs the async within the same thread (VisionCamera), which defeats the purpose of having an async invoker since we want it to run without affecting the Main JS Thread nor the VisionCamera Thread.

The main issue lies in how vision camera is integrating with worklets outside of Javascript. So writing tests for this repo will be pointless unless VC is integrated in the example. This test probably should live in VC repo instead. Unfortunately I do not have anymore time to spare to attempt a fix, I am working full-time. I am using RNVC for a production app that I am rewriting from kotlin to react native for multiplatform capability (@mrousavy and team thank you for these awesome libraries, was able to complete a 1 month deadline in 1 week). For my use case I can slide with using VisionCameraProxy.workletContext.createRunAsync.

Potential fixes:

  • Create a context such that VisionCameraProxy.asyncContext.createRunAsync can be used instead of creating the context on the JS Thread. (VisionCameraProxy will be replaced with CxxTurboModule...)
  • Migrating to CxxTurboModule might fix the issue
  • Fix the issue with worklets module where the nested worklets within a context created natively does not get cleaned up (This would probably require some sort of mapping of the nested relationships.)

@luicfrr
Copy link
Author

luicfrr commented May 17, 2024

however it did not resolve the issue where iOS VC stops running frame processor after several frames.

@nmajumder12 on my face-detector package I solved this problem casting frame to FrameInternal type and calling incrementRefCount method and after all tasks just call decrementRefCount. On my case this fixed this issue on IOS. Take a look here.

About crashing, yes, using defaultContext seems to work and it's my current workaround so I could release my app.

This makes me think (@mrousavy can you please answer me this?): Why do we neet to create a new separeted context when default context seems to work (even on a low-end device) without any issues and without fps drop?

@nmajumder12
Copy link

nmajumder12 commented May 17, 2024

however it did not resolve the issue where iOS VC stops running frame processor after several frames.

@nmajumder12 on my face-detector package I solved this problem casting frame to FrameInternal type and calling incrementRefCount method and after all tasks just call decrementRefCount. On my case this fixed this issue on IOS. Take a look here.

About crashing, yes, using defaultContext seems to work and it's my current workaround so I could release my app.

This makes me think (@mrousavy can you please answer me this?): Why do we neet to create a new separeted context when default context seems to work (even on a low-end device) without any issues and without fps drop?

It is better to stay away from defaultContext since react-native-worklets-core could be used for other cases in adjacent to Vision Camera. You do not want to bring down performance of defaultContext by clobbering it with more processes. The main purpose of having multiple context is to utilize multi-threading.

@nmajumder12
Copy link

nmajumder12 commented May 17, 2024

@mrousavy Does these solutions I mentioned here make sense?

I believe the issue is that the worklets nested inside the VisionCamera context which is created natively are somehow colliding with the babel plugin optimization.

Potential fixes:

  • Create a context such that VisionCameraProxy.asyncContext.createRunAsync can be used instead of creating the context on the JS Thread. (VisionCameraProxy will be replaced with CxxTurboModule...)
  • Migrating to CxxTurboModule might fix the issue
  • Fix the issue with worklets module where the nested worklets within a context created natively does not get cleaned up (This would probably require some sort of mapping of the nested relationships.)
  // Handled by babel...? No context, causes null pointer dereferencing?
  const runOnJs = Worklets.createRunOnJS( () => {
    console.log( 'hello from js' )
  } )
  // Handled by babel...? New context
  const context = Worklets.createContext( 'MyContext' )
  const runOnContext = context.createRunAsync( () => {
    'worklet'
    console.log( 'hello from context' )
    runOnJs()
  } )
  // Not handled by babel, 'VisionCamera' context
  const frameProcessor = useFrameProcessor( ( frame ) => {
    'worklet'

    runOnContext()
  }, [] )

@mrousavy
Copy link
Member

I'm not sure if I follow, babel only transpiles functions that are marked with the 'worklet' directive. Babel doesn't know about the IWorkletContexts.

@tfcornerstone
Copy link

@nadeem-portico
Copy link

nadeem-portico commented Nov 21, 2024

@mrousavy @hannojg Wouldn't this cause issues if invoked multiple times with the same string name. In turn maybe some deduplication mechanism needs to be added. Also is there a clean up? If not, it might also cause memory problems.

std::shared_ptr<JsiWorkletContext>
JsiWorkletApi::createWorkletContext(const std::string &name) {
  return std::make_shared<JsiWorkletContext>(name);
}

E.g.

try {
  const Worklets = WorkletsProxy.Worklets
  isAsyncContextBusy = Worklets.createSharedValue(false)

  const asyncContext = Worklets.createContext('VisionCamera.async')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants