scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

[Question] Any way to use '--turn-screen-off' and '--stay-awake' options when using Server only?

Open gurtonbuster opened this issue 3 years ago • 2 comments

  • [x] I have read the FAQ.
  • [x] I have searched in existing issues.

Environment

  • OS: Raspberry Pi OS Lite (Legacy)
  • scrcpy version: 1.24
  • installation method: manual build
  • device model: OnePlus 3
  • Android version: 11 (crDroid 7.19)

Describe the bug

I am using scrcpy on my Raspberry Pi to mirror my phone screen using this script :

#!/bin/bash
adb push /usr/local/share/scrcpy/scrcpy-server /data/local/tmp/scrcpy-server.jar
adb forward tcp:1234 localabstract:scrcpy
adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.24 raw_video_stream=true tunnel_forward=true control=false &
omxplayer --no-keys --no-osd --fps 60  --advanced=0 --loop --timeout 0 --lavfdopts probesize:250000 --video_queue 1 --avdict rtsp_transport:tcp tcp://localhost:1234 &
exit 0

Is there a way to use the '--turn-screen-off' and '--stay-awake' options in this case? My phone display is broken and is causing lags if these options are not used.

gurtonbuster avatar Dec 10 '22 07:12 gurtonbuster

  • --stay-awake, yes: stay_awake=true (source)
  • --turn-screen-off, possible but not straightforward: a control event is sent from the client on the control socket (source)

rom1v avatar Dec 10 '22 09:12 rom1v

  • --turn-screen-off, possible but not straightforward: a control event is sent from the client on the control socket (source)

I'm sorry but I don't understand. How do I send this control event in my script?

gurtonbuster avatar Dec 10 '22 10:12 gurtonbuster