Fix: Mali GPU Deadlock ANR on Stream Stop - #2185
Open
krishnasen2401 wants to merge 1 commit into
Open
Conversation
krishnasen2401
marked this pull request as draft
August 24, 2026 16:19
krishnasen2401
force-pushed
the
fix-anr-deadlock
branch
from
August 24, 2026 16:26
f1f57c2 to
9325c31
Compare
Although pedroSG94#2058 was closed previously, the deadlock still occurs on Mali GPUs because the video source is stopped before the GL interface is unbound in StreamBase.kt. - StreamBase.kt: Stop GlStreamInterface before stopping video and audio sources to release buffers. - GlStreamInterface.kt: Render preview surface first to prevent hardware encoder back-pressure from freezing the preview. - GlStreamInterface.kt / OpenGlView.kt: Implement synchronous teardown using a CountDownLatch to ensure all EGL surfaces are fully released before proceeding with stream stop.
krishnasen2401
force-pushed
the
fix-anr-deadlock
branch
from
August 24, 2026 16:31
9325c31 to
7ec57f1
Compare
krishnasen2401
marked this pull request as ready for review
August 24, 2026 16:32
Owner
|
Hello, The PR was no developed on master branch removing multiple recent commits and it is not compiling. Also, the way to stop/start is really weird (do sleeps and wait that the fix works with random timers is not the correct way to fix a race conditions produced by async code). Can you test that the ANR still happens using this commit? I added the code of the PR that could be useful for the case here (stop encoders before the gl thread): implementation "com.github.pedroSG94.RootEncoder:library:0c3e1ee1db"This basically is master with a bit of code added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although #2058 was closed previously, the deadlock still occurs on Mali GPUs because the video source is stopped before the GL interface is unbound in StreamBase.kt.