Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
105.37k stars 10.23k forks source link

Fps locking to 30 in 3d scenes only. #2005

Open CryseArk opened 3 years ago

CryseArk commented 3 years ago

Environment

Describe the bug In 3d game scenes I cannot seem to get scrcpy to display at higher than 30 fps despite my phone running the scenes at 60 regardless of what I do. I used Scrcpy's built in fps counter to monitor this.

What I've done:

Why am I unlocking my fps now if I had previously been locking it to 30fps? Well, with the new update to scrcpy I was testing out different encoders on my device, and found that some increased my performance by a rather hefty amount. I can now run things in much higher fidelity at a stable 30fps, but 3d scenes still won't go above it even with very low settings.

It's very odd. Something seems to be locking the fps to 30 in 3d scenes, as the first few seconds will run at a high frame-rate before locking to an extremely consistent 30-29fps. As for whether the issue stems from somewhere withing scrcpy, my pc or my android device I have no idea.

What my scrcpy.bat usually looks like: scrcpy -b18M --crop 1080:1920:0:184 --render-driver=opengl -m 1920 --shortcut-mod=lalt --turn-screen-off --encoder 'c2.qti.avc.encoder' --max-fps 60

The low scrcpy settings I tried in addition to changing the in-game 3d resolution to very low were this: scrcpy -b4M --crop 1080:1920:0:184 --render-driver=direct3d (tried opengl as well) -m 1000 --shortcut-mod=lalt --turn-screen-off --encoder (All different encoders) --max-fps 60

The encoders available to my device that I've tried are: 'OMX.qcom.video.encoder.avc' 'c2.android.avc.encoder' 'OMX.google.h264' 'c2.qti.avc.encoder'

The game in question is "Tales of Crestoria".

I'm a little new to filing github issues, so let me know if there's anything else you require from me! Edit 2: Well, I experienced something rather odd. I had my phone locked for a good while while still connected via scrcpy. After unlocking it and coming back to the 3d scene I'd left off at, it ran at near 60fps for about a good maybe 7 seconds. So at the very least I can confirm this issue is not a lack of being able to reach those frame-rates at all due to weak hardware or anything.

rom1v commented 3 years ago

I'm a little new to filing github issues, so let me know if there's anything else you require from me!

You did very well (better than most issues) :+1:

Is the framerate better with a tiny definition (scrcpy -m400)?

It is possible that your hardware is not able to both render the scene at maximum framerate and record the screen at the same time.

See https://github.com/Genymobile/scrcpy/issues/600#issuecomment-502615625

Note: don't pass --max-fps at all if you don't want to limit framerate.

CryseArk commented 3 years ago

Good to hear.

No. I just tried -m400 and it made no difference at all. That's the weird part. Scrcpy and my device can both handle cranking fidelity up no problem and still maintain 30fps, but even when turning everything way down 3d scenes just won't budge past 30. I understand that it might sound like the scenes (combat) run at 30, but the game's combat is known to run at 60, looking on my phone it easily appears smoother as 60fps does, and like I mentioned I even used an app to make sure it was indeed running at 60. I know it doesn't really make sense, but unfortunately that's all the info I've got.

Gotcha. I tried both with and without --max-fps, I just figured I'd leave it on in case uncapping it was somehow stressing everything, like it was trying to shoot above the cap or something. I'll take it out from now on though.

Edit: But here, don't take my word for it. Here's some gameplay at 60fps (timestamped for convenience) https://www.youtube.com/watch?v=pzEmthOuSpg&t=35s