-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Terminating scrcpy when screen is off (normally via POWER) would turn it on with all-black display #1667
Comments
Thank you for the report with precise and relevant information 👍 (I wish all bug reports were like this one 😉) The root cause of the problem is that some devices (including yours) handle the restoration of the "power mode" to Specifically, in your logs:
Scrcpy requests to set the power mode to 2 ( In v1.14, I still decided to reactivate this feature via Ctrl+Shift+o, because on many devices it works without problems (and it's convenient): dcde578 In v1.15, #1576 always restored power state mode to So I see two possibilities:
What do you think? |
Is it possible to detect this situation automatically? If we can detect it without actually sending command, we can use correct behavior on each device and reduce issues like this. |
I think it is not possible. There is not even a function to get the current power mode. |
Ok, if we cannnot detect it, I vote to keep this behavior by default, and add an option --do-not-restore-power-mode-on-exit (with a better name). Because most of user will benefit on restoring power state. |
Oh you guys may want to know both phones A and B run those custom ROMs packed with a load of features. I just tried with another very old phone running a more 'pure' CyanogenMod ROM, and it worked fine. I don't know if there's any correlation between the ROM 'purity' and the chance it mishandle the said power state. See what do you think most devices would behave. For me, either Thank you every developer for your wonderful work! |
Even though we don't have access to API to tell if the screen is off, we have access to API on whether the phone is sleeping. But even so, we may not need it. I can't reproduce, so: |
I face the same issue and would also love to see the addon parameter so everybody who isn't affected doesn't have to do anything .... those of us who are will provide the addon flag and we're good to go to add my phone to the "affect-list" --> oneplus 5t stock rom on android 10 (OxygenOS-Version 10.0.1) thx for the scrcpy tool - love it :) |
jep - just saw it .... running pop 20.10 - so ubuntu repos .... there is good and bad in running ubuntu based distros :) thx for your reply -- will think about how to move on from there all options except 3 are fine with me :) .... hope it works with the new version ... will check for open issues or create one if it doesn't once again - great tool ... very well done @rom1v 👏 |
Now that's very easy: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#simple |
perfect thx 👍 |
--power-off-on-close is a slightly confusing to me, since it doesn't turn off the device, just the screen? I was looking for something to power off the device FWIW...which I think this doesn't, peace! |
Environment
Describe the bug
A clear and concise description of what the bug is.
I launched
scrcpy
with no options except-s SERIAL
, then turned off the phone screen via each of the following ways:adb -s SERIAL shell input keyevent POWER
.Specifically I didn't supply
--turn-screen-off
,-S
, or pressMOD + o
. I terminated scrcpy while the screen is off, either by closing the window or pressing^C
in the terminal.As a result, Phone B turned on with an all-black display, visible due to the backlight. For phone A, it was impossible to tell wherever the screen turned on just by looking, due to the AMOLED (or so) panel. However its 'wake on screen touch' feature was not working which is a clue phone A wasn't in its screen-off state normally.
Both phones resumed normal after say another physical POWER press or scrcpy connection. Terminating scrcpy before turning off the screens produces no issues. V1.14 never had this issue.
I checked #1653 but it seems my case is not totally the same.
Extract of
logcat
from phone B on v1.16 (please tell me if more complete log is needed):https://gist.github.com/automatata/b36a1ff2614125ad8d3f1e73c62d3f53
The text was updated successfully, but these errors were encountered: