RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

ANR when stopStream()

Open AlwaysYang opened this issue 1 year ago • 5 comments

Describe the bug ANR : fun ExecutorService.secureSubmit(code: () -> Unit) { try { submit { code() }.get() } catch (ignored: Exception) {} }

To Reproduce stopStream()

Expected behavior

Screenshots

Smartphone (please complete the following information):

  • Library version [2.4.5]
  • Device: [e.g. Pixel 6a]
  • OS: [e.g. Android13]
  • Media server [e.g. srs, version 5.0]
  • Class used [e.g. RtmpCamera1] 1

Additional context

07-11 15:29:03.343 26007 26044 E AndroidRuntime: FATAL EXCEPTION: |ANR-WatchDog|
07-11 15:29:03.343 26007 26044 E AndroidRuntime: Process: net.whir.emp.endusertest, PID: 26007
07-11 15:29:03.343 26007 26044 E AndroidRuntime: com.github.anrwatchdog.ANRError: Application Not Responding for at least 5000 ms.
07-11 15:29:03.343 26007 26044 E AndroidRuntime: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: main (state = WAITING)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at sun.misc.Unsafe.park(Native Method)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:450)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at com.pedro.common.ExtensionsKt.secureSubmit(Extensions.kt:87)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at com.pedro.library.view.GlStreamInterface.removeMediaCodecSurface(GlStreamInterface.kt:130)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at com.pedro.library.base.StreamBase.stopSources(StreamBase.kt:387)

AlwaysYang avatar Jul 15 '24 08:07 AlwaysYang

Hello,

Can you tell me library version used? because that logcat is not related with the last version lines Can you reproduce the error consistently?

pedroSG94 avatar Jul 15 '24 10:07 pedroSG94

After check a bit others version. This seems that you are using version 2.4.5 I did a commit for this error. If you can reproduce the case, get the last commit of master branch and test if your error is solved

pedroSG94 avatar Jul 15 '24 12:07 pedroSG94

After check a bit others version. This seems that you are using version 2.4.5 I did a commit for this error. If you can reproduce the case, get the last commit of master branch and test if your error is solved

Thank you. I will try to integrate the source code into the project and let users test it, which may take a little time

AlwaysYang avatar Jul 16 '24 07:07 AlwaysYang

After check a bit others version. This seems that you are using version 2.4.5 I did a commit for this error. If you can reproduce the case, get the last commit of master branch and test if your error is solved

Thank you. I will try to integrate the source code into the project and let users test it, which may take a little time

Hi @AlwaysYang @pedroSG94 Is resolved this issue? because i also getting same issue in some devices. lat me know how to resolved this?

hemant-novotrax avatar Aug 11 '25 07:08 hemant-novotrax

Hello,

the exact error related to this issue can't happens because secureSubmit was removed in that method. Did you tried using the last library version?

pedroSG94 avatar Aug 11 '25 20:08 pedroSG94