-
-
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
Turn screen off disabling screen turn off after disconnect #1605
Comments
I haven't had the chance yet to compile the new version, I will test tomorrow. However, I am not sure that the two issues cover really the same problem I have here: after disconnecting, my screen does turn on pressing the power button, and then I can operate the phone normally. When pressing power again or waiting a couple of seconds, the screen turns black but the screen doesn't turn off anymore - the backlight is still onandn the phone starts heating up notably in my pocket. So, yes something turns off (screen goes black), but backlight/the physical screen is not turned off anymore. |
OK, looks like a problem in the device ROM then. Scrcpy just requests the device to set the power mode, the way the device handles it is not defined by scrcpy. There were also similar bugs with turning the screen on some time ago, see discussion: #175 (comment) |
Compiled scrcpy from master, same problems persist. I can still use As it works the first time though, I wonder if we could find some kind of cleanup that can put the phone in a normal state even when running scrcpy twice. I wonder if it is some kind of timing issue? I am trying to find something suspicious in the log, but I can't find anything, I think this is the relevant part when turning the screen off, but only reaching black state with display light set to full:
Anything weird up there? I just wonder what this excessive delay is. Full log:
|
I did some further testing (compared a lot of dumpsys and settings listings) and I think the only possible fix would be to let the server be installed and running as the inconsistency seems to only occur when it stops (only one process allowed to use that surface based display power setting feature?). Maybe extracting the "turning display off" into its own service could make sense too. If we run into permisson problems we could potentially just put the server into a detached adb-session and connect to that the second time we run scrcpy. Would that be possible and how much effort would it involve? |
Environment
Describe the bug
I am building a small open source convergence solution using my phone as communication hub (like Franz or Rambox) getting notifications via kdeconnect and then answering and viewing messages on a phone sitting on the top of my screen.
Using --turn-screen-off works sometimes, sometimes it only turns the screen black and keeps the backlight on - it does always still show the desktop. I see the same behavior using ctrl-o and (even when using ctrl-shift-o before disconnecting).
When I disconnect the phone or terminate scrcpy it breaks the capability of my phone to ever switch off the display again (using only ctrl-o and not --turn-screen-off) until I reboot the phone - I wonder if #1143 is related.
Can I see somewhere what exactly is done to switch off the screen (eventually as shell commands run via adb, but I assume it's somehow done in scrcpy-server), so I can debug things more step by step? My system also uses a clean-up hook - so, I could do some resetting if I knew what was happening. However, I would actually even like to make sure that turning the screen off works all the time.
On errors, please provide the output of the console (and
adb logcat
if relevant).console:
[server] INFO: Device screen turned off (at start)
I am actually not sure what I should provide here best as phone starts misbehaving after disconnect.
When the error occurred (did not switch off even before), I managed to capture the attached
logcat.txt
log when just terminating scrcpy. Screen cannot turn off now anymore. Scrcpy was stated this way:
scrcpy -m 1920 -w --turn-screen-off
logcat output is too long, can't upload - here is it in my drive: https://drive.google.com/file/d/1dRZt1_T0Yd1H3izHs9I9m2t-onD363-O/view
The text was updated successfully, but these errors were encountered: