Main screen refresh rate drops caused by the small rear screen


xNAPx

Members
May 31, 2021
174
40
I forgot to ask you,instead of using the set edit app, did you try a terminal emulator with the "su" command to inject those parameters?
 

Misiek735

Members
Feb 11, 2017
44
20
Until now I was writing the commands by thermux app (terminal emulator) as well as I was changing the values with SetEdit. It did not work.

As you suggested this time I used adb shell with 3 commands:
adb shell settings put system min_refresh_rate 120
Same with user and peak refresh rate. After reboot lag disappeared- so adb worked :)

I was reading xda for many hours and I found a Magisk module designed for poco x3 nfc. I exported this module to see what config it has and I discovered a few commands which we did not used until now.
I set up those commands in thermux app but they didn't solve the lag issue. Maybe some person would need them, so just in case I will share you those commands which in my opinion are important and kind of "universal" for all the xiaomi (perhaps even all android?) phones with high refresh rate screens:

#Systemprops
ro.vendor.display.default_fps=120
ro.vendor.dfps.enable=false
ro.vendor.smart_dfps.enable=false
persist.vendor.dfps.level=120

#Touch improve
persist.service.lgospd.enable=0
persist.service.pcsync.enable=0

#Improve global touch screen response
debug.egl.hw=1
hwui.disable_vsync=true
pm.dexopt.bg-dexopt=speed-profile
pm.dexopt.shared=speed
 

xNAPx

Members
May 31, 2021
174
40
Until now I was writing the commands by thermux app (terminal emulator) as well as I was changing the values with SetEdit. It did not work.

As you suggested this time I used adb shell with 3 commands:
adb shell settings put system min_refresh_rate 120
Same with user and peak refresh rate. After reboot lag disappeared- so adb worked :)

I was reading xda for many hours and I found a Magisk module designed for poco x3 nfc. I exported this module to see what config it has and I discovered a few commands which we did not used until now.
I set up those commands in thermux app but they didn't solve the lag issue. Maybe some person would need them, so just in case I will share you those commands which in my opinion are important and kind of "universal" for all the xiaomi (perhaps even all android?) phones with high refresh rate screens:

#Systemprops
ro.vendor.display.default_fps=120
ro.vendor.dfps.enable=false
ro.vendor.smart_dfps.enable=false
persist.vendor.dfps.level=120

#Touch improve
persist.service.lgospd.enable=0
persist.service.pcsync.enable=0

#Improve global touch screen response
debug.egl.hw=1
hwui.disable_vsync=true
pm.dexopt.bg-dexopt=speed-profile
pm.dexopt.shared=speed
But none of this worked for you right? Any improvement whatsoever after using these commands?

Regarding the Magisk prop, you said it didn't work either, did it? Did you find any improvement after using those?
 

Misiek735

Members
Feb 11, 2017
44
20
Until now all the commends I always changed by the terminal in my rooted phone or by setedit. Those commands worked for one day, after that time the phone started to lag again while using the back screen. Repeating any of those steps at the same way (by using terminal in the phone or by setedit) was never successfull,

but I followed your suggestion and I used the adb method (connecting the phone to the pc and writing the commands), and it was successful. Right now I don't experience the lag, I just don't know if the lag will appear randomly again - this requires time.
 
  • Like
Reactions: xNAPx

Misiek735

Members
Feb 11, 2017
44
20
And about the magisk prop, in the xda topic about the poco x3, someone mentioned that there is a difference between the settings of the fps of the screen and hz display of the screen.
Those are not the same values, because, for example, as long as you can force 120hz in youtube app, the fps will dynamically adjust depending on which video you are watching.

We can modify both of those values - as an example of the commands which we spoke about in this topic, the user_refresh_rate is responsible for the hz of the display, but ro.vendor.dfps.enable is responsible for the fps of the display.

I did not noticed any difference in animations smoothness of the system after modifying the fps commands. Also, modifying the fps commands did not solved the lag when the rear screen was active.
 
  • Like
Reactions: xNAPx

xNAPx

Members
May 31, 2021
174
40
Honestly I noticed that when you open many apps and then you open recents there is some stuttering in the animation the first time you do it. Did you notice any difference in this regard after using the commands?

Did the issue come back after 1 day of usage, after you used adb?
 

Misiek735

Members
Feb 11, 2017
44
20
I wrote adb commands today at 14.00, right now is 22.00 and the problem appeared again.

I tried to write the commands again through adb (user, peak and min refresh rate 120) and reboot the phone, but it doesn't work anymore.

There are many lags like that. When you open recent apps, fingerprint unlock animations, effects animations, scrolling reddit also sometimes is laggy...
 

Misiek735

Members
Feb 11, 2017
44
20
@xNAPx

In the xda topic which I pasted here about the dynamic refresh rate for poco x3 there is a person who had a problem with setting up the commands in his phone. One person suggested that it might be because he installed miui after using the custom rom, so there might be a possibility that his vendor partition was corrupted, since (as he wrote) "display hal by xiaomi has been removed from all of them".

I own mi11 ultra for a ~month now. It arrived to me with a chinese rom, don't remember the version. Then I installed xiaomi eu stable, few days later I installed xiaomi eu weekly, and again I came back to stable. Each of this change was done with the format data and format internal memory.

Do you think that my vendor partition might be corrupted? One of the solutions what one person suggested was to install the clean official xiaomi firmware, and then install xiaomi eu.

Perhaps I should install the original Chinese rom and see if the problem with coming back lag also happen in the original soft. What do you think?

Maybe you know, if possible, what would be the correct steps to follow to install the original chinese miui without the necessity of deleting the data?
 

xNAPx

Members
May 31, 2021
174
40
In terms of corrupted data it is not coherent to dirty flash your device. I did the same on my device,maybe that partition is corrupted as well, but my question is: how we can verify that? Because now I am curious. One solution might be to format all the partition of your phone like system and persist,but how?
 

Misiek735

Members
Feb 11, 2017
44
20
The life would be much easier if we could just simply delete the vendor folder by using the file manager in twrp, and then copy this whole vendor folder from the original Chinese miui rom - I believe that's not the correct way and too big cheat, probably the phone will explode or smthing xD

I can try tomorrow to spend most of my day to backup all 180 gb of data just to install stock chinese miui. I really don't want to waste time in that, but seems that there is no other solution.

Writing in Google "repair vendor partition" doesn't bring any reasonable result, so flashing stock rom seems to be the only solution.
 

xNAPx

Members
May 31, 2021
174
40
What ROM are you using? Because I am using the global stock ROM and experienced the same issues
 

xNAPx

Members
May 31, 2021
174
40
Well afaik the xiaomi EU rom is not the best for performance, original ROM is much better,apps loads faster and smoothness is ok but you may incur in some lags which I think are not easy to get rid of, for example in global ROM I can perceive some lags going to recents the first time from the home screen when I have many apps open
 

xNAPx

Members
May 31, 2021
174
40
Do you mind trying wiping your cache and dalvik via twrp and the retry the commands?

Also I wanted to ask you,do you have busybox installed?
 
Last edited:

xNAPx

Members
May 31, 2021
174
40
In xda forum I also found an interesting topic, worth to read all the posts:

Ok I tried for the first time the commands used in this guide on my global stock ROM, the first command was false already,the second one was not existing,so I set it as false as the guide tells. At the end of the guide the author states these commands are proven to work only on stock MIUI ROM, now I'm gonna test this and come back to you. I've just run the commands, as you say the problem reappear after a certain time, so by tomorrow I should be able to see if they made some difference, so far I can tell lag from recent disappeared and also using the rear screen doesn't create any issues
 

Misiek735

Members
Feb 11, 2017
44
20
I also read somewhere that the global and eeu versions of the firmware are not as good optimized as the Chinese versions - you experienced lags in global, so the option to switch to original chinese could be also good for you.
Of course the Chinese stock rom has a lot of bloatware, but after checking xda I can see that you have excellent knowledge what to debloat.

I realized that for some reason I lost busybox, I thought I have it installed. I just reinstall it in Magisk and rebooted the phone. Lag dissapeared, the question is for how long.

In case if the lag will appear again I could try of course to wipe cache / dalvic in twrp and repeat the commands, but to be honest I am starting to be tired of this problem. If the Chinese rom doesn't require any party related with the commands, busybox, cleaning etc. I just prefer to install it, debloat and continue happy life.

I am happy to hear that the commands from the topic of poco x3 were helpful for you :)
 

xNAPx

Members
May 31, 2021
174
40
Well I spoke too early, that particular lag of recents didn't disappear, YouTube though seems to work fine, it used to start in 120hz mode and turning 60hz after watching a video, now seems to keep the 120hz.

China Rom is not good for me, with Vodafone UK I would not have the same 5g speed, plus I don't like Chinese stuff
 

Misiek735

Members
Feb 11, 2017
44
20
Until now the lag did not appear, but I lost the possibility of doing the photo. Camera app, whatsapp camera, telegram... Nothing, just black screen. I didn't change anything since I installed busybox.
 

xNAPx

Members
May 31, 2021
174
40
Honestly I didn't have such issues, I did not like Xiaomi EU for me is Very bad optimised, you should try stock china or global ROM
 

xNAPx

Members
May 31, 2021
174
40
I don't know how but since I used this command

ro.vendor.display.default_fps=120
ro.vendor.dfps.enable=false
ro.vendor.smart_dfps.enable=false

The phone has become Superfast (it was already quite fast but after these commands even more)

YouTube lag (going to 60hz after a while) is disappeared and some apps are loading faster (WhatsApp splash screen is now faster in cold boot)

This on global ROM 12.5.4.0
 

xNAPx

Members
May 31, 2021
174
40
In xda forum I also found an interesting topic, worth to read all the posts:

In this topic you posted me I found a guy saying to use

settings put system user_refresh_rate 0

Honestly I set 120 and not 0, what did you set?
 

Misiek735

Members
Feb 11, 2017
44
20
Yesterday I went to sleep at 3 in the night after 6h of copying, installing chinese stable firmware and copying the data back. Today after all the day of using the phone I didn't experience any lags or problems, so seems that xiaomi.eu was the primary reason of my issues.

I am happy to know that those commands made your phone even faster :D For me chinese stable is very very fast and well optimized, so for now on I will not touch any of those settings. In fact I would prefer to adjust those settings to be more battery friendly, but we will see.

When I still had xiaomi.eu I tried user refresh rate 0 but I didn't noticed any improvement in performance. Setting it up as 120 or as 0 was the same for me.
 

xNAPx

Members
May 31, 2021
174
40
I'm happy you finally solved your issues buddy, as I was expecting Xiaomi EU was the main culprit