How To change Display RefreshRate

Hi, since unity Won’t allow you to change the display refresh rate or even setting a 60fps on a 90hz or 144hz display, there is a way aroud it ! Google have already an api for it Here. I’m new for android studio and java so I couldn’t get it to work and the documentation about it not very clear. I spend the last week trying to find a solution, I did manage to show an android toast message even showing battery charging capacity but i didn’t succeed to change the display RefreshRate. I really need help !

I’ve never heard of this being the case. How have you been trying to do it before this?

You Can’t change the display refresh rate in unity. The only option you have is target frame rate wich responsable of changing the game fps not screen refresh rate, add to that unity won’t allow you to get 60fps on a 90Hz,144,165 because they said that the fps need to be divisor of 2 and with no decimal digits meaning that a 90 hz you can achieve 90,45,30.144hz display 144,72,48 etc. disabling frame pacing also won’t help. In older versions of unity you can get 60 on a 90hz device but the fps is not stable and looks worse than stable 45. So only solution to fix it is to change the display refresh rate to 60 so you can achieve a locked smooth 60fps

You can change the display refresh rate in Unity.

https://docs.unity3d.com/ScriptReference/Screen.SetResolution.html

Dosen’t work on android

Again I’ve never heard of this being the case.

I think you missed Screen.SetResolution. Refreshrate stores refresh rate as fraction, so you could target 59.97 or whatever that one odd refresh rate was in CRT times. Assuming your display supports it. You cannot set refresh rate to random values. You need to use ones supported by your display, and those have to be enumerated.
https://docs.unity3d.com/ScriptReference/Screen-resolutions.html

That applies to desktop. On android secondary packages like cardboard can interfere with resolution in strange ways, for example, preventing you from setting 90Hz. And of course, on desktop, user can mess with the drivers, setting overrides…

1 Like

The API that they’ve linked to allows you to set arbitrary values, and if the device chooses not to ignore it it will try to match it as close as possible.

res.refreshRateRatio shows that my phone can accept 90,60 but when i set the refreshrate to 60 nothing happenes. There is a build in refresh rate indicator in android it should switch to 60 like when I enter youtube app

Who is the manufacturer and what is the model of the phone?

xiaomi 11lite 5g ne supports 90 and 60 and as I said when I enter youtube app the screen automatically switches to 60 and I can feel it and see the indicator switches to 60

There’s
https://docs.unity3d.com/ScriptReference/Rendering.OnDemandRendering.html
https://docs.unity3d.com/ScriptReference/Rendering.OnDemandRendering-renderFrameInterval.html

and

All of which can affect refresh rate.

Also I absolutely would not trust built-in refresh rate indicator. You need to check the rendering rate from within unity. Implement framerate counter in unity, see its values.

Also, you’re asking in a wrong forum. General is not support forum.

Speaking of which here’s a free one.

Okay, I’ve looked up and confirmed the phone supports it, but I’ve also looked up and confirmed that people outside of Unity have been having trouble getting that model to change refresh rate.

1 Like

I already have an fps counter and still showing 90 or 45 no 60 the only way I can achieve 60 is to switch screen refreshrate manually to 60

Can You give me link pls because in some apps the phone switch to 60 automatically and seamlessly

This sort of thing doesn’t take a lot of time to write, So… (-_-)

I vaguely recall having plenty of trouble switching refresh rate on android in one of the projects.

Problem one was that by default application was running at 60 and didn’t want to go to 90 even if I demanded it. To be more specific, it sometimes didn’t want to go to 90. I don’t rememebr what I needed to do, I remember being annoyed by it. It involved plenty of “dances with tambourine”.

Problem two was application completely ignoring everything related to ondemand rendering when cardboard is installed. It was running at 60 fps and draining battery no matter what we did. Apparently cardboard did something under the hood which effectively disable frame skips/etc.

In the end I just assumed that android is not as reliable to PC when it comes to resolution switching, granted this wasn’t top priority to begin with.

There isn’t much in the way of info.

https://xiaomi.eu/community/threads/mi-11-lite-5g-renoir-90hz-not-working-12-5-2.62929/
https://www.reddit.com/r/Xiaomi/comments/p479re/miui_1253_refresh_rate_drop_issues_on_mi_11_lite/

1 Like

I never faced this problem and even if it existed before now the phone have android 13 and many problems are fixed, and as I said the phone can switch to 60 seamlessly but I can’t figure how

In android You can’t get frame rate above your screen refresh rate no matter what you do and vsync is useless and also you can’t set any target frame rate you want