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:open
  • Created 2 years ago
  • Comments:41 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
pedroSG94commented, Dec 9, 2021

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.

1reaction
pedroSG94commented, Dec 8, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Speed up a slow Android device - Google Support
Speed up a slow Android device. Try the steps on this page if your phone: Runs very slowly; Lags; Takes a long time...
Read more >
5 Ways To Deal With Super Slow Apps - Popular Mechanics
Solution: Clear the cache for your slowest apps. On Apple devices: -Tap Settings > General > Storage & iCloud Usage. Then, in the...
Read more >
Why is my Android slow? 8 ways to troubleshoot your phone
Stock Android users can tap Settings → Storage→ Other Apps. Tap on the app where you want to clear the cache and select...
Read more >
Top Reasons Why Your Mobile App is Slow and How to Fix it
The speed of the network can hugely affect the speed of your mobile application. If the network is slow, the app performance will...
Read more >
8 Common Mistakes Slowing Down Your Android Phone (And ...
Having lots of apps installed on your Android phone is one of the most common causes of slow performance. Apps require memory and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found