Performance Issue(App is slowing too much on some devices)
See original GitHub issue@pedroSG94 Hi !!
I am trying to apply multiple custom views (filters using AndroidViewRenderer)
but on some devices like Poco x3, Samsung A8 tab UI gets stuck or is slowed down and skips frames of CameraFeed while rendering for Livestream.
the logs show too much work on the main thread is done while rendering. Kindly help me out with how to optimize the performance across as many devices as we can. Also, if you could chalk out the factors that could have affected the performance and can be enhanced.
logcats:
D/Surface: lockCanvas
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 2 lines
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 3 lines
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 6 lines
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 4 lines
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
D/Surface: lockCanvas
D/Surface: lockCanvas
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 6 lines
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
D/Surface: lockCanvas
D/Surface: lockCanvas
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 1 line
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/chatty: uid=10011(com.pedro.rtpstreamer) RenderThread identical 2 lines
E/GPUAUX: [AUX]GuiExtAuxCheckAuxPath:593: Null anb
I/RtmpSender: Audio frame discarded
I/RtmpSender: Audio frame discarded
I/Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread.
I/RtmpSender: Audio frame discarded
I/RtmpSender: Audio frame discarded
D/View: [ANR Warning]onDraw time too long, this =android.webkit.WebView{760194a VFEDHVC.. ........ 0,0-2264,876 #7f0801ea app:id/web_view}time =584 ms
D/View: [ANR Warning]onDraw time too long, this =android.webkit.WebView{760194a VFEDHVC.. ........ 0,0-2264,876 #7f0801ea app:id/web_view}time =642 ms
I/Choreographer: Skipped 38 frames! The application may be doing too much work on its main thread.
Poco X 3 device specifications are as follows: Poco x3 with the screen resolution of 1080 x 2400 pixels, 20:9 ratio (~395 ppi density), Qualcomm SM7150-AC Snapdragon 732G Octa-core processor while the GPU: is Adreno 618.
I’ve also opened a discussion on this issue also, here is the link to the discussion for detailed reference.
Issue Analytics
- State:
- Created 2 years ago
- Comments:41 (19 by maintainers)
Top Related StackOverflow Question
That repo is using canvas like me: https://github.com/arthabus/AndroidViewToGLRendering/blob/master/app/src/main/java/com/self/viewtoglrendering/GLWebView.java#L31 I will check xml shared, try to find a way to optimize AndroidViewFilterRender and report you back.
Hello,
I think that this is a design problem in AndroidviewFilter. This filter is a bit special because use canvas to get frames from android view so it is really slow compared with others filters that only need use GPU. Also, I detected that this filter could crash sometimes if you don’t render it in main thread using few devices. Since I couldn’t reproduce the error my solution was this: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/java/com/pedro/encoder/input/gl/render/filters/AndroidViewFilterRender.java#L127
This could be producing a big preformance issue in your device so I need verify this and know which device receive this error in your case and try to optimize it (I will create a branch to test with an idea and after that if I can’t find a solution buy the device with lowest price that can reproduce it). Check if you are reciving this error (you can copy the AndroidViewFilterRender class and add a log to test). If it isn’t the case, we need to find other possible reason but the rest of the library should be executed async.
Also, if you are using multiple AndroidViewFilters. I recommend you add a layout that contain all views to increase performance.