KRDP stops updating image whenever client window is minimized

Hello, this is about KRDP.

After doing the workaround noted in this topic: https://discuss.kde.org/t/krdp-stopped-working-6-7-0/47955/14?u=skylark13

I am in the same situation as the last comment in that thread. In my case, after connecting it works great, but if I minimize the RDP window and then come back to it a bit later, the image no longer updates (but I still see the mouse moving on the “remote” system’s monitor).

My ~/.config/systemd/user/app-org.kde.krdpserver.service.d/override.conf has these contents, but the last 3 lines were just trying other things to see if I could solve this issue, but it occurs whether I have those or not.

[Service]
NoNewPrivileges=false
Environment=KPIPEWIRE_FORCE_ENCODER=libx264
Environment=LIBVA_DRIVERS_PATH=/nonexistent
Environment=LIBVA_DRIVER_NAME=dummy

Here’s what I see in journalctl between the moment I minimize the client window and the moment I close it to reconnect:

Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] frame I:1     Avg QP: 0.00  size:1392157
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] frame P:52    Avg QP: 2.31  size: 85158
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] mb I  I16..4: 100.0%  0.0%  0.0%
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] mb P  I16..4:  1.9%  0.0%  0.0%  P16..4: 16.1%  0.0%  0.0%  0.0%  0.0%    skip:81.9%
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] coded y,uvDC,uvAC intra: 57.8% 47.6% 47.5% inter: 7.9% 7.1% 7.0%
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] i16 v,h,dc,p: 49% 40%  9%  2%
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] i8c dc,h,v,p: 57% 30% 11%  2%
Jul 20 23:53:54 excalibur krdpserver[1319012]: [libx264 @ 0x7f2b81520e00] kb/s:878548.31
Jul 20 23:55:54 excalibur krdpserver[1319012]: Cannot start recording on a stream without a node ID

I wonder if there’s something that can be found out and fixed from this, or if I can assist in finding the cause of this problem since I have such an easy repro. In case it makes a difference, the client RDP viewer is the one from Windows 11 (mstsc), and the host system is running CachyOS with KDE Plasma 6.7.3 and KRDP 6.7.3-1.1 from cachyos-extra-v3.

It’s really unfortunate because all other solutions I’ve found work even worse (rustdesk is the closest to usable, but it’s slow and sometimes has unacceptable artifacts even on a local network). KRDP would work great except I have to reconnect every time I switch to some other window on the client system.

I hope something can be done to improve this.

Also, I just noticed: I was testing with mstsc connecting to the CachyOS Linux host, but using either Remmina or KRDC from another CachyOS Linux machine as client gives a completely black or white screen, but I can see the mouse cursor change as it goes over different windows. The output (when running KRDC from the terminal) contains these errors repeatedly:

[17:10:46:041] [2719019:00298ea4] [ERROR][com.freerdp.codec] - [libavcodec_decompress]: Failed to transfer video frame (status=-38) (Function not implemented)
[17:10:46:041] [2719019:00298ea4] [WARN][com.freerdp.codec] - [log_decompress]: H264 decompress failed with -1
[17:10:46:041] [2719019:00298ea4] [WARN][com.freerdp.gdi] - [gdi_SurfaceCommand_AVC420]: avc420_decompress failure: -1, ignoring update.

So I think this is the issue reported here in FreeRDP: (issue 13069, looks like I cannot yet post links) , which has been fixed but has not yet made its way to a released version of either KRDC or Remmina.

About the black or white screen issue in KRDP and Remmina, uninstalling the libva-nvidia-driver package resolves it. So it’s indeed not related to KRDP (the host side) at all.

Replying to myself again because I cannot edit the posts above:

I found the related issue on the nvidia-vaapi-driver github: elFarto/nvidia-vaapi-driver issue 434

For anyone watching this thread:

The bug that RDP stops sending the image when you minimize the RDP window from a Windows client seems to be resolved and scheduled to be released with KDE Plasma 6.8 (planned for October). See the bug report and merge request. I am going to be setting up a build environment and testing to confirm the fix.

I also found a few work items related to dynamic resolution (currently when connecting to a KRDP server, it will stream the host monitor’s resolution, rather than allowing the client to specify the resolution it wants like a Windows RDP host or other RDP implementations on Linux do). This is an important QOL feature IMHO, but admittedly less critical than the one above.

  1. Create Virtual Monitor at client-determined resolution (#31) · Tasks · Plasma / KRdp · GitLab
  2. Support multiple operating modes (#33) · Tasks · Plasma / KRdp · GitLab