Skip to content
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

Suspending scrcpy while keeping device awake #3112

Open
madduck opened this issue Mar 14, 2022 · 4 comments
Open

Suspending scrcpy while keeping device awake #3112

madduck opened this issue Mar 14, 2022 · 4 comments

Comments

@madduck
Copy link
Contributor

madduck commented Mar 14, 2022

scrcpy has totally revolutionised the way I work with my phone at my desk. Thank you so much for this magnificient tool.

Thanks to #3101, I basically have it always running, but I found that this means it's constantly eating CPU time, hence consuming power. I can use Mod+p to power off the display, and that means scrcpy also goes to sleep, but then when I want to use the device again, I am forced to enter my password to gain access again to the device.

I wonder if there is a hybrid, a way to marry --stay-awake with some sort of suspend mode that the scrcpy client-server pair negotiate. The device stays awake (and hence does not lock), but the server stops sending data to the client on request (e.g. Mod+z), or after a period of inactivity, until the client wakes the server because of interaction.

@rom1v
Copy link
Collaborator

rom1v commented Mar 14, 2022

I wonder if there is a hybrid, a way to marry --stay-awake with some sort of suspend mode that the scrcpy client-server pair negotiate.

No. Currently, the easiest way to get this behavior is to enable "stay awake" independently of scrcpy (adb shell settings put global stay_on_while_plugged_in 7), and start/stop scrcpy as needed (but that does not work with your auto-start mechanism).

I don't see a clear and obvious generic behavior to suspend (a shortcut? on minimize? on focus lost/inactivity?), and I'm a bit reluctant to add yet another option/shortcut for such a use case.

I keep it in mind though, as a similar shortcut might be useful to "restart" the encoding part manually for foldable devices (like it is done on every device rotation, but even without device rotation), since apparently there is no way to detect display change when the device is folded/unfolded (but restarting the encoding works). Restart/suspend/resume are quite similar.

@madduck
Copy link
Contributor Author

madduck commented Mar 14, 2022

Lost focus & inactivity would be best. Let's get that done first, and then we can worry about the question of whether it's worth to add another key accel for this.

@rom1v
Copy link
Collaborator

rom1v commented Mar 14, 2022

Focus or inactivity are not pertinent IMO, since I may want to see my (unfocused) device while I'm browsing a website, or watch my device playing a video but without explicit activity on the desktop side.

@madduck
Copy link
Contributor Author

madduck commented Mar 14, 2022

I don't think this is behaviour suitable to everyone, and so needs to be toggleable, I am afraid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants