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

ANR occurred during the pressure test #1421

Open
T-ONLY opened this issue Mar 6, 2024 · 6 comments
Open

ANR occurred during the pressure test #1421

T-ONLY opened this issue Mar 6, 2024 · 6 comments

Comments

@T-ONLY
Copy link

T-ONLY commented Mar 6, 2024

"main" prio=5 tid=1 Blocked
| group="main" sCount=1 ucsCount=0 flags=1 obj=0x721d0ff8 self=0xb400006eedd4e380
| sysTid=6663 nice=-10 cgrp=top-app sched=0/0 handle=0x70253a7500
| state=S schedstat=( 560240180875 53709456083 2101982 ) utm=44907 stm=11116 core=4 HZ=100
| stack=0x7fcd8d0000-0x7fcd8d2000 stackSize=8188KB
| held mutexes=
at com.pedro.rtplibrary.view.OpenGlViewBase.onFrameAvailable(OpenGlViewBase.java:210)

  • waiting to lock <0x0eb3c699> (a java.lang.Object) held by thread 32
    at android.graphics.SurfaceTexture$1.handleMessage(SurfaceTexture.java:212)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7870)
    at java.lang.reflect.Method.invoke(Native method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1005)

"glThread" prio=5 tid=32 Native
| group="main" sCount=1 ucsCount=0 flags=1 obj=0x13783bf0 self=0xb400006eeddd78b0
| sysTid=6744 nice=0 cgrp=top-app sched=0/0 handle=0x6cdcfa6cb0
| state=S schedstat=( 1737899470525 286389876326 15558134 ) utm=100194 stm=73595 core=0 HZ=100
| stack=0x6cdcea3000-0x6cdcea5000 stackSize=1039KB
| held mutexes=
native: #00 pc 000000000004c25c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #1 pc 0000000000050880 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+144)
native: #2 pc 00000000000b0a8c /apex/com.android.runtime/lib64/bionic/libc.so (pthread_cond_wait+80)
native: #3 pc 00000000000564e0 /system/lib64/libc++.so (std::__1::condition_variable::wait(std::__1::unique_lockstd::__1::mutex&)+20)
native: #4 pc 0000000000089268 /system/lib64/libgui.so (android::BufferQueueProducer::waitForFreeSlotThenRelock(android::BufferQueueProducer::FreeSlotCaller, std::__1::unique_lockstd::__1::mutex&, int*) const+216)
native: #5 pc 00000000000897b8 /system/lib64/libgui.so (android::BufferQueueProducer::dequeueBuffer(int*, android::spandroid::Fence, unsigned int, unsigned int, int, unsigned long, unsigned long, android::FrameEventHistoryDelta*)+616)
native: #6 pc 00000000000e40f4 /system/lib64/libgui.so (android::Surface::dequeueBuffer(ANativeWindowBuffer**, int*)+392)
native: #7 pc 00000000000147bc /vendor/lib64/egl/eglSubDriverAndroid.so (???)
native: #8 pc 0000000000013e60 /vendor/lib64/egl/eglSubDriverAndroid.so (???)
native: #9 pc 0000000000295394 /vendor/lib64/egl/libGLESv2_adreno.so (???)
native: #10 pc 00000000001a6b20 /vendor/lib64/egl/libGLESv2_adreno.so (???)
native: #11 pc 00000000001a843c /vendor/lib64/egl/libGLESv2_adreno.so (???)
native: #12 pc 00000000001e6bf8 /vendor/lib64/egl/libGLESv2_adreno.so (???)
at android.opengl.GLES20.glClear(Native method)
at com.pedro.encoder.input.gl.render.ScreenRender.draw(ScreenRender.java:137)
at com.pedro.encoder.input.gl.render.ScreenRender.draw(ScreenRender.java:102)
at com.pedro.encoder.input.gl.render.ManagerRender.drawScreen(ManagerRender.java:76)
at com.pedro.rtplibrary.view.OpenGlView.run(OpenGlView.java:201)

  • locked <0x0eb3c699> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:920)

Hello, ANR log above; is there a good approach to resolve this ANR issue?

Furthermore, during the long-term stress test, there will be an issue with the preview screen getting stuck. The log indicates that onFrameAvailable is not called back. Is there an idea about this?

Looking forward to your response.

@pedroSG94
Copy link
Owner

Hello,

Which library version are you using?
com.pedro.rtplibrary.view.OpenGlView is an old library version. Try with last version 2.3.9

@T-ONLY
Copy link
Author

T-ONLY commented Mar 7, 2024

Hello,

Which library version are you using? com.pedro.rtplibrary.view.OpenGlView is an old library version. Try with last version 2.3.9

Last July. Could you please tell me what I should do next? There will be many incompatibilities following yesterday's upgrade.

@pedroSG94
Copy link
Owner

pedroSG94 commented Mar 7, 2024

According with your comment. That means version 2.2.4

You have this differences:

  • Multiples classes packages changed. Try remove and import all packages to fix (exactly rtplibrary package was renamed to library)
  • LightOpenGlView was removed, Use OpenGlView
  • AAEnabled, numFilters and keepAspectRatio attribs from OpenGlView was removed because it is unnecessary now.
  • ConnectCheckerRtmp, ConnectCheckerRtsp was replaced with ConnectChecker (it is exactly the same interface that before but with names a bit changed, for example onConnectionSuccessRtmp to onConnectionSuccess)

This should be all. Let me know if you have others errors and I can help you to solve it.

@T-ONLY
Copy link
Author

T-ONLY commented Mar 13, 2024

Hi pedroSG94, Sorry for the late reply.According to you mean modify
1、 LightOpenGlView/OffScreen was removed, Use OpenGlView
2、[use executors in glviews]

We need to support recording in the background. After synchronizing the above modifications, we cannot record (the hardware layer supports background recording).
Can you pull a branch from 2.2.4 and help change the thread to executors

@T-ONLY
Copy link
Author

T-ONLY commented Mar 13, 2024

Because thread is often stuck on onFrameAvailable

@pedroSG94
Copy link
Owner

Hello,

I need more info about the case.

Are you using DisplayRtmp or which class are you using?
What do you mean with stuck? How did you check it?

Also, if possible, use version 2.4.0 that provide a fix in that classes

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

2 participants