Genymobile / scrcpy

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

Bug: after OS update, Honor Magic4 pro can't be mirrored with screen turned off using ScrCpy (closes right away), but can be via Android Studio #4943

Open AndroidDeveloperLB opened 1 month ago

AndroidDeveloperLB commented 1 month ago

Environment

Describe the bug When launching without any parameters and without any key combination, it works fine. However, when I tell it to also turn off the display (either in parameter or using ALT+O combination), it closes the window of ScrCpy right away.

This is what I got from the console, after I used ALT+O:

PS C:\android\scrcpy> .\scrcpy-console.bat
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  AJ3D022630001200                device  LGE_NX9
C:\android\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 82.7 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [HONOR] HONOR LGE-NX9 (Android 14)
INFO: Renderer: direct3d
INFO: Texture: 1144x2488
Native registration unable to find class 'com/android/server/TrustedUIService'; aborting...
WARN: Device disconnected
Aborted
Press Enter to continue...

And this is what I got on logcat, filtered by errors:

logcat.zip

This issue doesn't occur when using Android Studio to mirror the device and turning off the display. ScrCpy used to work fine with this device. The issue started only yesterday, as I've updated the OS.

eiyooooo commented 1 month ago

4823

eiyooooo commented 3 weeks ago

but can be via Android Studio

It should not work, because Android Studio declared that turn off device display while mirroring is not supported on Android 14.

AndroidDeveloperLB commented 3 weeks ago

@eiyooooo They fixed it (maybe using some workaround) but didn't change the text for some reason.

eiyooooo commented 3 weeks ago

They fixed it (maybe using some workaround) but didn't change the text for some reason.

I tested on my Android 14 phone, and it did not work.

And

https://github.com/JetBrains/android/blob/dbd9aeae0dc5b8c56ce2c7d51208ba26ea0f169b/streaming/screen-sharing-agent/app/src/main/cpp/session_environment.cc#L55-L66

shows that it does not seem to support "turn off device display" on Android 14.

AndroidDeveloperLB commented 3 weeks ago

@eiyooooo Seems it's as such for me for Android 14 : Pixel 6 - doesn't turn off in Android Studio, yet ScrCpy can do it. Honor magic 4 pro - turns off in Android Studio, yet ScrCpy can't turn it off.

How odd...