dkrivoruchko / ScreenStream

ScreenStream Android App
https://screenstream.io
MIT License
1.56k stars 319 forks source link

[Feature Request] Device display timeout but prevent device from sleeping #191

Closed clee604 closed 2 years ago

clee604 commented 2 years ago

Hi,

Not sure if this is the right avenue for feature requests or if this is a bug, but I've been playing around with this app and it works great.

I'm wondering if it is possible for the app to have a physical display time out (ie. turn off the display or backlight after 30 seconds of inactivity) but keep the device from sleeping (wakelock). This way, the device's physical display is off, but the screen stream continues. As it works right now, the stop stream on sleep option (or rather when this option is disabled) is a bit useless, as the stream shows a black screen when the device times out/goes to sleep on my device unless I'm missing something here.

A workaround I was able to get the stream to continue to work with the physical display off was to use wireless ADB with scrcpy to turn off the display (using --turn-screen-off --stay-awake commands). ScreenStream still streams what is running on the device, but the physical display is off. However this requires me to keep scrcpy and wireless ABD constantly connected by a client which uses power and network bandwidth.

My use case is I have a bluetooth battery monitor app that runs on spare device and monitors the voltage of a car battery. Using ScreenStream I can feed the MJPEG feed of the battery app screen into Home Assistant or TinyCam. This works well if I turn disable the screen timeout or use the "stay awake" option in developer options but this uses more power to keep the display on, as well as potential burn-in and unnecessary usage of the backlight.

Thanks! Appreciate your time!

dkrivoruchko commented 2 years ago

Hi, thanks for the idea. Will check once I have time for this.