Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
111.97k stars 10.71k forks source link

Screen freeze on PC side #4618

Open tjb8907 opened 9 months ago

tjb8907 commented 9 months ago

Environment

Describe the bug I use scrcpy to play a game on a phone, and when going back to a couple of the main screens the display will freeze on the PC side and FPS goes to 0. It will eventually refresh, but takes at least 10-15 seconds a lot of times. The phone screen displays properly, and inputs still work (I can click on frozen image on scrcpy and the click works on the actual display on the phone.

I can get it to unfreeze by clicking the back button on my mouse (open app switch) then right clicking (android back button) to go back to the same app. That will refresh the screen and start working again. It only happens when going back to a couple different screens in the game, and I dont know if its because they are more detailed or what. They are usually the main screens (i.e. clicking the back button again would not change anything. I don't know if that is relevant or not.) It will freeze whether I right click (back) from the mouse, or click on the game icon that goes to that screen.

I've seen a few issues similar and seems like the issue is always blamed on the codec on the phone, but I just want to know if that is something I can change or adjust? Or is there setting in scrcpy I can change to lower resolution or such to improve performance. I have played with some setting but can't seem to get any different results

In the log before where it dips to 25fps is where i clicked back, and the it comes back when I go to app switcher and back to the app.

On errors, please provide the output of the console (and adb logcat if relevant).

scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)        14121FDD4000B4            device  Pixel_5
C:\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 86.4 MB/s (56995 bytes in 0.001s)
[server] INFO: Device: [Google] google Pixel 5 (Android 13)
INFO: Renderer: direct3d
INFO: Texture: 1024x472
INFO: FPS counter started
INFO: 44 fps (+4 frames skipped)
INFO: 45 fps
INFO: 45 fps
INFO: 25 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 11 fps
INFO: 70 fps
INFO: 84 fps
INFO: 46 fps
INFO: 45 fps
INFO: 45 fps

Please do not post screenshots of your terminal, just post the content as text instead.

rom1v commented 9 months ago

If you record (scrcpy --record=file.mp4), is the recording frozen?

I've seen a few issues similar and seems like the issue is always blamed on the codec on the phone, but I just want to know if that is something I can change or adjust?

Try with another encoder.

tjb8907 commented 9 months ago

I will try that. I also see I'm not using the lastest version of scrcpy either. will update that as well as to android 14

ryoukaip commented 3 months ago

Apparently this problem is still happening to this day, and the method to "fix" this is by lowering the bit rate/resolution. Probably because there's not enough bandwidth using the default encoder.