Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.24k stars 10.5k forks source link

Recording is interrupted when turning off the screen #2563

Open WQY916 opened 3 years ago

WQY916 commented 3 years ago

When using the v1.18 version for screen recording tasks, pressing the power button to turn off the screen causes scrcpy to disconnect and the screen recording task is also interrupted.

u0_a317@Termux:~$ SCRCPY_SERVER_PATH=../usr/share/scrcpy/scrcpy-server scrcpy -b200M -Nrdl/tmp.mp4
INFO: scrcpy 1.18 <https://github.com/Genymobile/scrcpy>
../usr/share/scrcpy/scrcpy-serve...1.9 MB/s (37330 bytes in 0.000s
[server] INFO: Device: samsung SM-N9760 (Android 11)
INFO: Recording started to mp4 file: dl/tmp.mp4
INFO: Recording complete to mp4 file: dl/tmp.mp4
WARN: Device disconnected
WARN: Killing the server...

No error message is displayed in the terminal. Is this a problem with Android or scrcpy?

rom1v commented 3 years ago

WARN: Device disconnected

It looks like a problem with your USB cable, the device gets disconnected.

WQY916 commented 3 years ago

WARN: Device disconnected

It looks like a problem with your USB cable, the device gets disconnected.

It's uncomfortable. When I tested with adb logcat, turning off the screen caused the recording to be interrupted. It seems that the system restricts the connection of adb

rom1v commented 3 years ago

Which system is it? I don't have this problem. However, I already encountered very sensitive USB cables, where a tiny move would cause a disconnection.

What if you power off the screen with Alt+p in scrcpy instead of using the physical button?

WQY916 commented 3 years ago

I am using Samsung note10+ sm-n9760 I tested alt+p but it still causes the device to disconnect. adb ​​logcat runs normally when the screen is off, Only the moment the screen is turned off will cause the command to stop running.It seems that something else is causing this problem