Genymobile / scrcpy

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

Screen remains off when folded #2155

Open limacohen opened 3 years ago

limacohen commented 3 years ago

Environment

Describe the bug I want to use scrcpy while my phone screen is folded/closed. However it seems unresponsive to any input from either scrcpy or adb, it just stays off or shows a fading image for a few seconds. I've obviously tried RMB and all combinations of --stay-awake and --turn-screen-off. I've also tried sending all kinds of adb commands (mostly key inputs) to power the screen back on, to no avail. Also, all on/off combinations of auto-lock and always-on display. The result is always the same: screen is off or a still image of the always-on display. I was able to control the little external screen targeting it with --display while the phone was folded, but that's it.

I know this is an edge case, but as folding phones rise in popularity (at least I hope so, I love the form factor of this one) I think using scrcpy would be a very useful way to avoid unnecessary mechanical wear.

marseille commented 2 years ago

Didn't think I'd find something so exactly matching my situation.

I have z flip3 5G. While I don't know what "RMB" is, and I have little experience with android+adb. Any developer or contributor to scrcpy, please chime in to confirm/deny speculation:

I have a feeling that it is pretty impossible to accomplish this. My guess is that this functionality isn't even exposed, it's a low-level power-controller function on the manufacturer level. Maybe it's low-level enough that changing it has unexpected volatile effects. It's possible it works like a laptop screen closing and shutting off. Not that Windows is any similar, but there are a sequence of kernel events that occur when the lid is closed or opened.

I looked at the output of "adb shell dumpsys display" and there are additional displays with "has_content=false" , while conveniently the displays with "has_content=true" are the cover screen and unfolded display. Also relevant is "mState=DOZE_SUSPEND" --- maybe it works like sleep mode in that it would require a more involved wake-on-lan (magic-packet?) solution.

I've attached the log.

other seemingly relevant vars are: display-output.txt

blockScreenOn coverType mPowerRequest dozeScreenState

also this apparently: https://github.com/Genymobile/scrcpy/issues/816

limacohen commented 2 years ago

While I don't know what "RMB" is

Right Mouse Button.

Thank you for your contribution, I'm looking forward to the day this gets sorted out.

vinc17fr commented 2 years ago

I have the same issue with my Cosmo Communicator when the cover is closed.