ThibaultBee / StreamPack

SRT/RTMP/RTMPS live streaming libraries for Android
https://thibaultbee.github.io/StreamPack/index.html
Apache License 2.0
175 stars 67 forks source link

[Bug]: App crashes with "eglMakeCurrent failed" error #78

Closed AndroidTNTU-3 closed 9 months ago

AndroidTNTU-3 commented 9 months ago

Version

N/A

Environment that reproduces the issue

Android 7

RTMP/SRT/... Server

RTMP/SRT

Audio configuration

No response

Video configuration

codec - MediaFormat.MIMETYPE_VIDEO_AVC resolution - 1080 x 1920 fps - 30 startBitrate = 2000000

Is it reproducible in the demos application?

Not tested

Reproduction steps

Start stream. The app crashes randomly.

Expected result

GL14.eglMakeCurrent() should return true

Actual result

io.github.thibaultbee.streampack.internal.gl.EGlSurface in makeCurrent at line 132 io.github.thibaultbee.streampack.internal.encoders.VideoMediaCodecEncoder$CodecSurface in onFrameAvailable$lambda$7$lambda$6 at line 192 androidx.biometric.BiometricFragment$$InternalSyntheticLambda$2$6c29fc67a7f83c4b04ff1f73909ab7d4ad5e8d38e92b712cda9c49144307343d$0 java.util.concurrent.ThreadPoolExecutor in runWorker at line 1133 java.util.concurrent.ThreadPoolExecutor$Worker in run at line 607 java.lang.Thread in run at line 761

Additional context

Hi. Sometimes the App crashes while streaming. It happens because EGL14.eglMakeCurrent() returns false and the method EGlSurface -> makeCurrent() throws RuntimeException.

What might be the problem? It seems like another process(that has BiometricFragment) call method onFrameAvailable(surfaceTexture: SurfaceTexture) {...}

Relevant logs output

No response

ThibaultBee commented 9 months ago

Hi,

Sorry I don't know how to handle this issue. I don't understand what BiometricFragment is doing here as it is not in this library. Is there an easy way to reproduce this issue? Have you modified this library?

AndroidTNTU-3 commented 9 months ago

Hi. It is hard to reproduce this bag. It occurs only on a single device which is not a smartphone. And yes, this library is modified a little. I believe these modifications did not affect the part of the code where this happens. But Ok. I guess I have to close this weird bug.