TrebleDroid / treble_experimentations

Scripts to automatically build/CI/Release TrebleDroid GSI
Other
203 stars 26 forks source link

Poor performance on all A14 GSIs #100

Closed melontini closed 4 months ago

melontini commented 4 months ago

Current Behavior:

Almost all GSIs based on A14 have UI stutters. It feels as if the refresh rate is capped at 5 fps. ### Describe the bug ### To Reproduce 1. Boot A14 GSI. 2. Poor performance out of the gate. 3. No visible improvements after ~30 mins. ### Expected behavior ### Photos ### Smartphone (please complete the following information): - Device: Realme 8 pro - Build Flavor: [android_14.0.0_r27 ci-20240208](https://github.com/TrebleDroid/treble_experimentations/releases/tag/ci-20240208). As well as: [Lineage light](https://sourceforge.net/projects/andyyan-gsi/files/lineage-21-light/lineage-21.0-20240212-UNOFFICIAL-gsi_arm64_gN.img.xz/download), [AOSP by ponces](https://github.com/ponces/treble_aosp/releases/tag/v2024.02.06), [PixelOS](https://github.com/MisterZtr/PixelOS_gsi/releases/tag/v2024.02.18) and [DerpFest](https://github.com/KoysX/treble_DerpFest_GSI/releases/tag/v2024.02.12) - Version latest ### Additional context If that helps in any way, the only GSIs which have basically no performance issues are [EvoX](https://github.com/ahnet-69/treble_evo) and, for the most part, [VoltageOS](https://github.com/cawilliamson/treble_voltage/releases/tag/3.2-20240219). If there's some sort of SurfaceFlinger log, I'd be happy to provide that.
phhusson commented 4 months ago

Please try this, as root:

setprop debug.sf.enable_gl_backpressure false
pkill -f surfaceflinger
melontini commented 4 months ago

Thank you for the fast response. This makes EvoX even smoother, but barely has any effect on AOSP by ponces. (Tested using DSU, but I don't think that matters)

melontini commented 4 months ago

As a quick and obvious update, I tried the latest TD with the new option in the app, but to no avail.

phhusson commented 4 months ago

Could you show the result of dumpsys SurfaceFlinger on EvoX and on https://github.com/TrebleDroid/treble_experimentations/releases/tag/ci-20240222 to see if there is a difference?

melontini commented 4 months ago

evox.txt (default backpressure) td.txt (backpressure disabled)

phhusson commented 4 months ago

What modes do you see in Treble settings => Misc => Force FPS? I presume you see 30fps and 60fps, could you try forced at 60fps?

phhusson commented 4 months ago

General obversations based on those SF logs: Both dumps use device compositing Both use RGBA888_UBWC. Framebuffer byte size is the same so we can expect compression to be identical Current color mode is identical both side Both have colormode srgb, same render intent, same in/out dataspace EvoX has much more missed frames than TD (though IDK the run time)

Log say " FPS min:61 max:61 cur:61 TransferTime: 0us MaxBrightness:4095" on TD, so I'm not sure where that 30.5 comes from Both logs have same "vsync on" state to off Client cache look identical

So yeah except that 30.5FPS thingy, I see nothing wrong in there. If it isn't screen's fps, it could be app rendering which will require systrace.py to check

melontini commented 4 months ago

So, the 30 fps things made everything much more confusing. This was the issue, and forcing 61.000004 fixed all the stutters. Thank you very much.

What's strange, is that the treble app doesn't even have a 30 fps option. I wonder why EvoX SurfaceFlinger got it right immediately... Screenshot_treble_app_cropped

melontini commented 4 months ago

I suppose some final observations on the issue: