Phone freezes during casual usage

Expected Behavior

Phone doesn't freeze during casual usage

Current Behavior

Phone freezes during casual usage (expanding notification bar, opening browser, going to settings, opening music player, etc. etc.). This freeze is often followed by error dialog with message "System.UI has stopped working"

Possible Solution

Spamming the wake button for a while snaps it out of the freeze.

Steps to Reproduce

Just using the phone 🤷‍♂️

Additional info

I have had this issue throughout multiple linage major versions on this device, since the release of surya port. I remember these freezes occurring more often when I had magisk and Adaway installed and running. So far it feels like the less apps I have running the less frequent these freezes are. When installing linage I also ran the oem Xiaomi firmware update script as per instructions, so that side should be fine. Haven't tried factory resetting and reinstalling firmware and image due to data loss.

edit cant freaking reply to my own issue. @gardiol what logs exactly you need?
edit2 still cant reply to my own issue 👀. but heres logcat output of this freeze https://vomitb.in/raw/cJUnVQNZ0Y you can identify freezes when you see tons of InputDispatcher rows. for example at (02-27 22:08:13.569). there are multiple occurences. i happened to also get the system ui not responding error when i was making this dump and i think its at (02-27 22:08:32.376). also added picture of error on phone itself system_ui_dead

/device surya /version 20-20230123-NIGHTLY-surya /date 2023-02-03 /kernel 4.14.290 /baseband c6-00044-RENNELL_GEN_PACK-1.434626.4.436471.2 /mods Google Apps, F-Droid, Magisk

I have read the directions

Edited by Janek Kos