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

App frozen #40

Closed
tousif-p99soft opened this issue May 24, 2023 · 13 comments
Closed

App frozen #40

tousif-p99soft opened this issue May 24, 2023 · 13 comments

Comments

@tousif-p99soft
Copy link

The app getting freezing on unmounting, any solution?

@Dynamsoft-Henry
Copy link
Collaborator

Hi @tousif-p99soft

Would you like to share your usage scenario by sending us a sample code that can re-produce your freezing issue?

@tousif-p99soft
Copy link
Author

tousif-p99soft commented May 25, 2023

@Dynamsoft-Henry
I have one component with DCVCameraView and when navigating from this component it takes time to hide and freeze the app, when removing DCVCameraView then it is working fine.

It is always happened on simulator but on real device sometimes only

@badbeoti
Copy link

@Dynamsoft-Henry

Same issue here.
I don't know exactly. But sometimes app gonna be freeze when use DCVCameraView.
In my case, It only occurs on real devices.

@Dynamsoft-Henry
Copy link
Collaborator

Hi @tousif-p99soft @badbeoti

Are you using iOS or Android? What's your device model and the simulator model? It helps us debug if you can share your device model or a sample code.

I don't know how you describe "freeze". The open / close of the camera might take some time. Is the freeze permanent or just last for a few seconds?

@tousif-p99soft
Copy link
Author

tousif-p99soft commented May 25, 2023 via email

@badbeoti
Copy link

Hi @tousif-p99soft @badbeoti

Are you using iOS or Android? What's your device model and the simulator model? It helps us debug if you can share your device model or a sample code.

I don't know how you describe "freeze". The open / close of the camera might take some time. Is the freeze permanent or just last for a few seconds?

I'm using both though but only iOS has error now.
Also I mean 'freeze' is seems like totally pause and then turn off.
In my opinion, We can found this things when using 'react-native-navigation' with 'DCVCameraView'

@Dynamsoft-Henry
Copy link
Collaborator

@tousif-p99soft @badbeoti
We made some attempts on the 'freeze' issue.

What we can re-produce is:

  1. Open the camera to scan.
  2. Close the camera.
  3. Try re-open the camera.

The freeze occurs between 2-3. It last for about 10 seconds on our device (simulator only). Is the issue the same as yours?

This issue is caused by a system method "AVCaptureSession stopRunning". It is a sync method that might block the thread on simulators. Since our SDK is not designed for scanning on the simulator, we prefer to wait for iOS to solve this issue instead of try fixing it on SDK.

We can't re-produce it on real devices. Could you share a screen recording of the issue to describe how you produce it on a real device?

@badbeoti
Copy link

@tousif-p99soft @badbeoti We made some attempts on the 'freeze' issue.

What we can re-produce is:

  1. Open the camera to scan.
  2. Close the camera.
  3. Try re-open the camera.

The freeze occurs between 2-3. It last for about 10 seconds on our device (simulator only). Is the issue the same as yours?

This issue is caused by a system method "AVCaptureSession stopRunning". It is a sync method that might block the thread on simulators. Since our SDK is not designed for scanning on the simulator, we prefer to wait for iOS to solve this issue instead of try fixing it on SDK.

We can't re-produce it on real devices. Could you share a screen recording of the issue to describe how you produce it on a real device?

Unfortunately, in my case, I'm only talking about errors made on real devices.
I will upload a related video when I go to work next time.

@badbeoti
Copy link

@Dynamsoft-Henry
I'm sorry. We don't have any video about this error now.
We will proceed with the test and collect related videos.

@Dynamsoft-Henry
Copy link
Collaborator

@badbeoti
No matter. Thanks.

@tousif-p99soft
Copy link
Author

@Dynamsoft-Henry
One more observation, if the scanner opens and closes multiple times then suddenly it gets frozen and crashes.

Stack traces which are recorded on Sentry

libsystem_kernel 0x1f8f93f3c __psynch_mutexwait
libsystem_pthread 0x20851461c _pthread_mutex_firstfit_lock_wait
libsystem_pthread 0x20850b300 _pthread_mutex_firstfit_lock_slow$VARIANT$armv81
AVFCapture 0x1d67ea6a4 -[AVCaptureSession _buildAndRunGraph:]
AVFCapture 0x1d675891c -[AVCaptureSession _commitConfiguration]
AVFCapture 0x1d6798300 -[AVCaptureVideoPreviewLayer setSession:]
AVFCapture 0x1d6789234 -[AVCaptureSession _removeAllPreviewLayers]
AVFCapture 0x1d6788d7c -[AVCaptureSession _addVideoPreviewLayer:exceptionReason:]
AVFCapture 0x1d6798338 -[AVCaptureVideoPreviewLayer setSession:]
DynamsoftCameraEnhancer0x1047ee170
CoreFoundation 0x1be504854 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
CoreFoundation 0x1be5a1128 ___CFXRegistrationPost_block_invoke
CoreFoundation 0x1be585910 _CFXRegistrationPost
CoreFoundation 0x1be517f68 _CFXNotificationPost
Foundation 0x1b88b4210 -[NSNotificationCenter postNotificationName:object:userInfo:]
DynamsoftCameraEnhancer0x1047ded74
PickingApp 0x10101118c -[DYSCameraView init] (DYSCameraView.m:28)
PickingApp 0x101012284 -[DYSCameraViewManager view] (DYSCameraViewManager.m:30)
PickingApp 0x10119d4d4 -[RCTComponentData createViewWithTag:rootTag:] (RCTComponentData.m:81)
PickingApp 0x10126c4c0 __50-[RCTUIManager createView:viewName:rootTag:props:]_block_invoke (RCTUIManager.m:1007)
PickingApp 0x101275b08 __RCTExecuteOnMainQueue_block_invoke (RCTUtils.m:265)
libdispatch 0x1c527a7a4 _dispatch_call_block_and_release
libdispatch 0x1c527b77c _dispatch_client_callout
libdispatch 0x1c525ce0c _dispatch_main_queue_drain
libdispatch 0x1c525ca84 _dispatch_main_queue_callback_4CF$VARIANT$armv81
CoreFoundation 0x1be561a28 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
CoreFoundation 0x1be5456c4 __CFRunLoopRun
CoreFoundation 0x1be549d9c CFRunLoopRunSpecific
GraphicsServices 0x1f58b8994 GSEventRunModal
UIKitCore 0x1c07db808 -[UIApplication _run]
UIKitCore 0x1c07db480 UIApplicationMain
PickingApp 0x100bfdebc main (main.m:8)

@badbeoti
Copy link

badbeoti commented Sep 5, 2023

@tousif-p99soft
Check this issue.
link

@tousif-p99soft
Copy link
Author

@badbeoti
Thanks, buddy!

I think it is working :)

Now testing more!

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

3 participants