-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrcpy[v3.0] seems locked when -S argument or meta-o pressed #5530
Comments
v2.7 is fine.. |
If you can build manually, could you please find the specific commit which introduce this behavior on your device using |
git checkout 3d478d7, fine. git checkout 5e05f2a, cannot launch after ./install_release.sh. seems v2.7/v3.0 mismatch git checkout 74aecc0(master now), can lauch, but locked when -S or MOD_O |
Thanks, but you must biild the server too, not use |
build scrcpy-server need android sdk that needtoo much dependency... |
I have the same problem on Windows with version 3.0. I'm guessing this problem is related to issue #5529. |
I suspect this change: d193967 |
Also not able to "turn screen off" with the command line option or meta-o. Pixel 9 Fold, running beta 15 qpr 2. screen-off-timeout is nice, though.... I had been using Tasker for that :) here's my command line when hitting meta-o:
|
Please post your framework.jar:
|
here it is: also, just tried new-display and got an error (sorry, code block not working for some reason):
|
You need ``` as delimiter.
Thank you. On your system, the method is: public boolean requestDisplayPower(int displayId, int state) instead of public boolean requestDisplayPower(int displayId, boolean on) (which has never been the case in the Android sources) I don't know if it an old interval version, or if the new method signature will now be with an int. I will upgrade my Pixel 8 to Android 15 to check all these problems. |
Thank you! Let me know if I can provide anything else. I don't have a dev environment set up, but I excel at copy/pasting. |
Everything works fine on Android 15 stable. I will wait a bit before fixing issues on Beta versions (maybe they will be automatically fixed, or the final fix will be different). |
It's not working correctly for me on Android 15 stable (Pixel 9 Pro). When the screen is turned off with meta-o, the scrcpy display stops updating. For example, if I use the scroll wheel on my mouse to scroll a page, the scrcpy display does not update. However, if I turn on the phone display with meta-shift-o, the scrcpy display updates. |
@drothenberger Sorry, I was talking about the exceptions in the previous comments. Indeed, I can reproduce the problem when the screen is turned off. I'm afraid the problem will have to be reported to Android, regarding the new method to turn the screen off: 58ba00f |
@rom1v Now I'm using version 2.7, and the control is normal after the screen of my Android 15 phone is turned off. So, is it possible to use the method to control the screen off before Android 15, or add an option switch? |
Understood. But, like @defix, I just rolled back to scrcpy 2.7 and meta-(shift)-o works fine on the beta android version. |
Yes, because it doesn't use the new method introduced in Android 15. If there is no solution, I will change to use the old method. |
Please test: diff --git server/src/main/java/com/genymobile/scrcpy/device/Device.java server/src/main/java/com/genymobile/scrcpy/device/Device.java
index cd7134993..0aaba9d14 100644
--- server/src/main/java/com/genymobile/scrcpy/device/Device.java
+++ server/src/main/java/com/genymobile/scrcpy/device/Device.java
@@ -127,10 +127,6 @@ public final class Device {
public static boolean setDisplayPower(int displayId, boolean on) {
assert displayId != Device.DISPLAY_ID_NONE;
- if (Build.VERSION.SDK_INT >= AndroidVersions.API_35_ANDROID_15) {
- return ServiceManager.getDisplayManager().requestDisplayPower(displayId, on);
- }
-
boolean applyToMultiPhysicalDisplays = Build.VERSION.SDK_INT >= AndroidVersions.API_29_ANDROID_10;
if (applyToMultiPhysicalDisplays Replace this file in scrcpy 3.0:
|
|
Thank you for your test.
With both fixes:
|
You're amazing!
|
c00l! but cannot MOD-Shift-O to turn device display on again... in terminal show "[server] INFO: Device display turned on", but in face no.. |
After turning off the screen with "alt + o" and then locking it with "alt + p", one has to press both "alt + p" and "alt + shift + o" to light up the screen. |
Please test with this additional change: diff --git server/src/main/java/com/genymobile/scrcpy/control/Controller.java server/src/main/java/com/genymobile/scrcpy/control/Controller.java
index fb9eba105..5b4b4e327 100644
--- server/src/main/java/com/genymobile/scrcpy/control/Controller.java
+++ server/src/main/java/com/genymobile/scrcpy/control/Controller.java
@@ -695,7 +695,8 @@ public class Controller implements AsyncProcessor, VirtualDisplayListener {
int targetDisplayId = displayId != Device.DISPLAY_ID_NONE ? displayId : 0;
boolean setDisplayPowerOk = Device.setDisplayPower(targetDisplayId, on);
if (setDisplayPowerOk) {
- keepDisplayPowerOff = !on;
+ // Do not keep display power off for virtual displays: MOD+p must wake up the physical device
+ keepDisplayPowerOff = displayId != Device.DISPLAY_ID_NONE && !on;
Ln.i("Device display turned " + (on ? "on" : "off"));
if (cleanUp != null) {
boolean mustRestoreOnExit = !on;
|
Thank you again for your excellent work! |
In fact, this is on purpose: cf9d449 When mirroring the physical screen, after the "screen off timeout", you might need to press POWER to turn it on in the scrcpy window, but without turning it on the physical display. |
I've tried it and that's indeed the case. What a clever design!👍 |
It's a bit hacky and becomes inconsistent with the behavior for virtual displays. But not to the point we need to add yet a new option, I think these default behaviors (even if different for physical and virtual display mirroring) are good enough. 👍 |
Can confirm "turn screen off" command line and key combo both working on pixel android 15 beta qpr2b1. |
Thank you for your tests. Merged into |
Is there a release date for this improvement? |
Not yet, it will be included in 3.0.1 with other fixes. Meanwhile, you can use: #5530 (comment) |
Released in 3.0.1. |
Environment
Describe the bug
scrcpy seems locked (out of control via mouse) when -S argument or meta-o pressed, but after meta-shift-o pressed, when phone screen light, it unlocked..
no error on terminal
The text was updated successfully, but these errors were encountered: