RootEncoder
RootEncoder copied to clipboard
Crash at ManagerRender.drawScreen
RTMP, OpenGlView, No filters, Front camera
Fatal Exception: java.lang.RuntimeException: drawScreen end. GL error: 1285
at com.pedro.encoder.utils.gl.GlUtil.checkGlError(GlUtil.java:126)
at com.pedro.encoder.input.gl.render.ScreenRender.draw(ScreenRender.java:115)
at com.pedro.encoder.input.gl.render.ManagerRender.drawScreen(ManagerRender.java:66)
at com.pedro.rtplibrary.view.OpenGlView.run(OpenGlView.java:144)
at java.lang.Thread.run(Thread.java:929)
That error means OutOfMemory. Do you have any way to reproduce it? Do you have this error with all devices?
Based on firebase info, devices had enought memory
Acording with android documentation 1285 is out of memory: https://developer.android.com/reference/android/opengl/GLES20#GL_OUT_OF_MEMORY
The question is, why only in certains devices? Do you have any way to know if your user is streaming long time before get this crash? Maybe I'm not releasing something properly
I'm facing a similar issue mostly on Samsung devices
Fatal Exception: java.lang.RuntimeException: drawScreen end. GL error: 1285
at com.pedro.encoder.utils.gl.GlUtil.checkGlError(GlUtil.java:142)
at com.pedro.encoder.input.gl.render.ScreenRender.draw(ScreenRender.java:131)
at com.pedro.encoder.input.gl.render.ManagerRender.drawScreen(ManagerRender.java:76)
at com.pedro.rtplibrary.view.OpenGlView.run(OpenGlView.java:189)
at java.lang.Thread.run(Thread.java:764)
After debugging with the Android Studio profiler I didn't find any leaks 😞
Hello,
If possible, let me know if you are using any filter and which one. Also, if you can get time streaming until you get that crash, device model and android api.
This crash seems really difficult to reproduce and I'm not sure about the reason so it is hard to fix.
I'm using BlurFilterRender
. These crashes are not super frequent so from my perspective it's a low prio thing.
Based on the logs, crashes are pretty random. Sometimes they occur after a few seconds of streaming and somethimes after user leaves the screen. It's also possible that these are caused by other leakage elsewhere in the application 🤷
If I manage to find some pattern or more details I'll post them here 🤞
@linean Have you solved it? I have the same problem
Unfortunately no, crashes seems pretty random. Luckily they doesn't affect a significant number of users 🤷
If anyone could find a way to reproduce the error report it here. Since in OpenGL documentation the error code is an out of memory I only can assume a GPU memory overflow. If you have any way to report GPU memory state when you receive that error, this could be helpful
I have the same error on Samsung Galaxy S21.
It's happen all the time. Without any filter.
@minonger were you able to fix it? Are there any special conditions to it happening? Like using WiFi/5G / reconnecting / going to background and back?
Have you solved it? I'm facing this problem now. I'm using both ImageFilter and TextFilter together. App still in development. There were no problems in short-term tests. I suddenly encountered this error while broadcasting for more than 20 minutes. Test device is Redmi Note 11 pro. 3.5gb free memory and 35gb available disk. I'm using mobile internet.
Hello,
This error is really random and I'm not able to reproduce it consistently to solve.
If you can reproduce it, test this and tell me the result:
- Try to stream without filters to discard problems with filters. If you can't reproduce the error without filters, then test with only one filter to try find the filter that produce problems.
- If you are streaming in background or you have rotation support. Try to stream in foreground all time and block screen orientation. This is to discard a problem related with the preview lifecycle.
Remember that this is an out of memory. Can you check the GPU memory usage? Maybe you can find a pattern
Thank you for quick reply @pedroSG94 . Tests still continue. So propably I'll reproduce it. App currently doesn't support rotation. It only supports landscape and only streams foreground. I thought maybe the behavior was being disrupted for a reason like "preventing accidental screen touching". I'll let you know immediately when reproduce it again.
Hello,
I did a refactor to GlInterface (OpenGlView and GlStreamInterface) that maybe solved this error. If possible try update the libary to version 2.4.0 and let me know if the problem is solved or reduced.
I followed the user experience for a while and found the error. The activity was set to sensorlandscape. This error occurred when the user made a movement that caused a 180-degree rotation while holding the device. After changing the sensorlandscape setting to landscape, the problem disappeared. Also thank you for your revision. I will include it in the next refactoring process.
It is worth adding that the problem only occurred if the screen was rotated while using filters. There is no problem with rotation when there is no filter.
Hi @pedroSG94,
Today I have found that this issue occurs for AndroidViewFilterRender
, if it has isHardwareMode
forced to be false
. I've not checked any other filter, my orientation is always horizontal.
I hope, it will help you with finding solution.
Hello,
@Feureth are you using library version 2.4.0?
Yes