scrcpy
scrcpy copied to clipboard
scrcpy fixes my phone's refresh rate to 60
Environment
- OS: macOS 12.6
- scrcpy version: 2.0
- installation method: brew
- device model: samsung z fold4
- Android version: 12
Describe the bug When I launch scrcpy and then close it, my my phone's refresh rate is fixed to 60, and only reboot can bring it back to 120.
Weird.
It should not have any impact, but could you test with this change?
diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
index 528cd3279..6e4d1b32b 100644
--- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
@@ -225,7 +225,7 @@ public class ScreenEncoder implements Device.RotationListener {
format.setString(MediaFormat.KEY_MIME, videoMimeType);
format.setInteger(MediaFormat.KEY_BIT_RATE, bitRate);
// must be present to configure the encoder, but does not impact the actual frame rate, which is variable
- format.setInteger(MediaFormat.KEY_FRAME_RATE, 60);
+ format.setInteger(MediaFormat.KEY_FRAME_RATE, 120);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, DEFAULT_I_FRAME_INTERVAL);
// display the very first frame, and recover from bad quality when no new frames
How do you observe that it is 60 or 120 in practice?
I open the "Show refresh rate" in "Developer options".
Now the refresh rate is fixed to 120, the refresh rate should be "adaptive".
I've also noticed this recently and +1 that a reboot of the device "fixes it". Other things to note is that the refresh rate of the device appears capped even disconnected from scrcpy (via disconnecting USB).
Weirdly enough, enabling 'Show refresh rate' option shows the device at 120 and scrolling appears smoothly again. Turning off the option, appears to lower the refresh rate back what I assume is 60.
Same issue here on the same device model (Galaxy Z Fold 4). I also have my phone refresh rate at adaptive
normally