Genymobile / scrcpy

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

very slow work on android 11 amlogic s905w2 #3936

Open leksmax opened 1 year ago

leksmax commented 1 year ago

Environment

very slow scrcpy. I connect via ip address.Adb latest version .

rom1v commented 1 year ago

Is it slow over USB?

leksmax commented 1 year ago

cant connect via usb now. in logcat many mesages like this 04-21 14:00:53.020 849 849 I ThermalService: CPU temperatures: [56.500004] 04-21 14:00:53.036 3000 3023 D CCodecBuffers: [c2.android.opus.encoder#498:Output[N]] popFromStashAndRegister: output format changed to AMessage(what = 0x00000000) = { 04-21 14:00:53.036 3000 3023 D CCodecBuffers: int32_t bitrate = 128000 04-21 14:00:53.036 3000 3023 D CCodecBuffers: int32_t channel-count = 2 04-21 14:00:53.036 3000 3023 D CCodecBuffers: int32_t flac-compression-level = 10 04-21 14:00:53.036 3000 3023 D CCodecBuffers: int32_t max-bitrate = 128000 04-21 14:00:53.036 3000 3023 D CCodecBuffers: string mime = "audio/opus" 04-21 14:00:53.036 3000 3023 D CCodecBuffers: int32_t sample-rate = 48000 04-21 14:00:53.036 3000 3023 D CCodecBuffers: Buffer *csd-0 = 0xebb0fbd0 04-21 14:00:53.036 3000 3023 D CCodecBuffers: }

rom1v commented 1 year ago

If you record (scrcpy --no-display --record=file.mp4), is the recorded file "laggy"?

leksmax commented 1 year ago

yes, the video recording is also delayed. But on the device itself there is no delay when navigating (up-down, left-right)

rom1v commented 1 year ago

the video recording is also delayed

How do you observed that it is "delayed" when you play the recorded file?

Could you share such a recorded file (for a few seconds)?

If it is laggy, then the problem is on the device video capture.

Does it work better with a lower resolution? (for example scrcpy -m1024)?

leksmax commented 1 year ago

with lower resolution the speed is slightly faster https://drive.google.com/file/d/1JHeGEc1tGNEIGU7P7ygXPlKhfrshyokc/view?usp=share_link

rom1v commented 1 year ago

OK so you have a low capture framerate. It's a problem on the device encoder.

Try with another encoder if several are available (scrcpy --list-encoders).

leksmax commented 1 year ago

scrcpy --list-encoders scrcpy 2.0 https://github.com/Genymobile/scrcpy /usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 177.6 MB/s (52867 bytes in 0.000s) [server] INFO: List of video encoders: --video-codec=h264 --video-encoder='c2.android.avc.encoder' --video-codec=h264 --video-encoder='OMX.google.h264.encoder' [server] INFO: List of audio encoders: --audio-codec=opus --audio-encoder='c2.android.opus.encoder' --audio-codec=aac --audio-encoder='c2.android.aac.encoder' --audio-codec=aac --audio-encoder='OMX.google.aac.encoder'

with any codec it is also slowly displayed on the computer screen and fps is about 10

leksmax commented 1 year ago

Is there any solution to this encoder problem? do i need to patch scrcpy or add another encoder to android tv box?

rom1v commented 1 year ago

This is probably a hardware problem on the device itself (a tv box may not have an efficient encoder because this is not useful like when there is a camera).

Montesuma80 commented 11 months ago

Set the HDMI Resolution to 1080P or 720P then it works fast