Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.86k stars 10.55k forks source link

OMX.hisi.video.encoder can not mirror video when the screen automatically displayed off #3846

Open mahengrui1 opened 1 year ago

mahengrui1 commented 1 year ago

Environment

Describe the bug

.\scrcpy.exe --tcpip=192.168.0.1 --video-encoder=OMX.hisi.video.encoder.hevc -m 1024 --max-fps=25 --power-off-on-close

[server] INFO: Device: HUAWEI COL-AL10 (Android 9)

[server] WARN: Audio disabled: it is not supported before Android 11

INFO: Renderer: direct3d

WARN: Demuxer 'audio': stream explicitly disabled by the device

INFO: Initial texture: 488x1024

WARN: Killing the server...

The expectation is, the video mirror equals to what have displayed on the screen of phone. However, my phone has an auto display off in ~ 3 minutes if no touching, or, if I use MOD+M or MOD+P to awake the screen but does not unlock the phone, the screen will be off in ~10 seconds. (It is trivial I guess)

In the case, MOD+M or MOD+P can awake the physical screen and mouse can toggle the screen, but the mirror keeps black. No terminal info provided.

If I manually MOD+P to screen off then MOD+P again instantly, it works. Only when the screen set off by Android itself, the sync breaks.

It is not 100%, but ~70% in daily use.

It has 3 encoders:

[server] INFO: List of video encoders:
    --video-codec=h264 --video-encoder='OMX.hisi.video.encoder.avc'
    --video-codec=h264 --video-encoder='OMX.google.h264.encoder'
    --video-codec=h265 --video-encoder='OMX.hisi.video.encoder.hevc'

Only in OMX.hisi.video.encoder.avc or OMX.hisi.video.encoder.hevc, it happens.

rom1v commented 1 year ago

Looks like a device/ROM/encoder bug.