Scrcpy bad experience

I would like to ask you guys, what is your experience using scrcpy? My experience is bad and I wonder if there are others in the same boat with me, because as far as know, this topic has been not discussed here so far.

If I run scrcpy (the latest version 2.3.1 or the earlier versions in the past) no mater on connection, whether via USB or WiFi, no mater to what device, whether phone running Android 13 or TV box running Android 11, it is not well responsive, lags sometimes and drops a ton of frames all the time, see here (the WiFi example, but it is exactly the same for USB too):

tux@rock5b ~> SDL_VIDEODRIVER=wayland scrcpy --tcpip=192.168.1.110 --print-fps
scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: Connecting to 192.168.1.110:5555...
INFO: Connected to 192.168.1.110:5555
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 2.3 MB/s (66007 bytes in 0.027s)
[server] INFO: Device: [Xiaomi] POCO M2012K11AG (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 3.3 (Compatibility Profile) Mesa 23.0.0-devel
INFO: Trilinear filtering enabled
INFO: [FFmpeg] Picture format is yuv420p.
INFO: Texture: 1080x2400
INFO: [FFmpeg] Decoder noticed an info change
rga_api version 1.9.3_[0]
INFO: FPS counter started
INFO: 7 fps (+5 frames skipped)
INFO: 22 fps (+14 frames skipped)
INFO: 10 fps (+48 frames skipped)
INFO: 4 fps (+44 frames skipped)
INFO: 30 fps (+26 frames skipped)
INFO: 21 fps (+26 frames skipped)
INFO: 10 fps (+8 frames skipped)
INFO: 2 fps (+1 frames skipped)
INFO: 20 fps (+19 frames skipped)
INFO: 14 fps (+16 frames skipped)
INFO: 12 fps (+12 frames skipped)
INFO: 16 fps (+10 frames skipped)

While even the old scrcpy version used with the same phone but on Windows 11 runs like a charm with no frames skipped and at nice frame rates (phone screen has 60 Hz refresh rate), see:

C:\Users\win\bin\scrcpy-win64-v1.24> .\scrcpy.exe --print-fps
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
C:\Users\win\bin\scrcpy-win64-v1.24\scrcpy-server: 1 file pushed, 0 skipped. 67.0 MB/s (41159 bytes in 0.001s)
[server] INFO: Device: Xiaomi M2012K11AG (Android 13)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2400
INFO: FPS counter started
INFO: 10 fps
INFO: 8 fps
INFO: 39 fps
INFO: 48 fps
INFO: 61 fps
INFO: 59 fps
INFO: 39 fps
INFO: 54 fps
INFO: 60 fps
INFO: 60 fps
INFO: 26 fps
INFO: 60 fps
INFO: 48 fps
INFO: 38 fps
INFO: 47 fps
INFO: 38 fps
INFO: 25 fps
WARN: Killing the server...

I already tried the --render-driver=software parameter. It seems to be a bit better, but the difference is really marginal. The screen record made by --record shows exactly the same as I see in the scrcpy window.

Really nobody else with the same experience out there?

Do you have ffmpeg for Rockchip? Otherwise it will use software decoding, which is super slow. Also, what is your display renderer, software (llvmpipe) or Panfork?

Yes, I have the correct ffmpeg:

tux@rock5b ~> nala show ffmpeg
Package: ffmpeg
Version: 7:6.0-5+git230804.e243e8d001~j1
Architecture: arm64
Installed: yes
Priority: optional
Essential: no
Section: video
Source: ffmpeg
Origin: LP-PPA-liujianfeng1994-rockchip-multimedia
Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Installed-Size: 2.4 MB
Provides: ffmpeg

And the renderer is not llvmpipe:

tux@rock5b ~> glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mali-G610 (Panfrost)
tux@rock5b ~> glmark2-es2-wayland
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Panfrost
    GL_RENDERER:   Mali-G610 (Panfrost)
    GL_VERSION:    OpenGL ES 3.1 Mesa 23.0.0-devel
=======================================================

I use the Joshua Riek’s Ubuntu and did no changes to the video driver configuration.

It should work… Maybe try playing with the codec?

Yeah, I know, it should, but… There is no obvious reason for not working as it should. Therefore I’ve been using scrcpy like this all the time because I thought it was just normal it works like this. Until I tried in Windows and was shocked how fast it really work.

I tried all the possibilities provided in --list-encoders, but again without any improvement. It seems I can do anything, but it still works the same.

Could someone confirm please, that scrcpy runs for him/her fine with no skipped frames? And if so, to provide some useful info on what OS, X11 or Wayland, scrcpy and adb version, the renderer used, needed system variables in use and so on…?

I’m already out of ideas. Whatever I try, it has completely no effect on how scrcpy runs. I tried all available renderer-drivers and video-encoders available in scrcpy. I tried it on all Ubuntu/Debian flavors I could, on the Joshua Riek’s one, on the Armbian and on the Afterburner Armbian mod. Some running X11, others the Wayland. In all cases I builded and used the most recent scrcpy version 2.3.1, checked that the both Mali-G610 (Panfrost) renderer and the ffmpeg for Rockchip are in use. In all these tests the scrcpy skips frames in exactly the same way, as on the Raxda’s official Debian with no Panfrost, but just the llvmpipe in use. Unfortunately I’m not able to do test on any Arch favor like the BredOS right now.

So my conclusion is that whatever I do, the scrcpy runs with just the software renderer, not the accelerated one. But why so to the hell?

Maybe there is a way to force LD_LIBRARY_PATH? Or compile scrcpy yourself?

Just want to let know that the problem has solved by its own. I used the scrcpy again after couple of days and it runs pretty fine as for now. Although it still skips some frames from time to time, it is finally usable now. The interesting thing is that I did nothing towards solving the problem (because I had no idea what to do). Only applied the system updates as I usually do. Below is the current scrcpy output. The absence of the FFmpeg messages is the only difference.

tux@rock5b ~> SDL_VIDEODRIVER=wayland scrcpy --tcpip=192.168.1.110 --print-fps
scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: Connecting to 192.168.1.110:5555...
INFO: Connected to 192.168.1.110:5555
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 2.6 MB/s (66007 bytes in 0.025s)
[server] INFO: Device: [Xiaomi] POCO M2012K11AG (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 3.3 (Compatibility Profile) Mesa 23.0.0-devel
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2400
INFO: FPS counter started
INFO: 32 fps (+9 frames skipped)
INFO: 31 fps
INFO: 27 fps
INFO: 34 fps
INFO: 15 fps
INFO: 20 fps
1 Like