Bug 520260 - Connections using the Microsoft RDP client on Android (called "Windows App") often cause visual freezes
Summary: Connections using the Microsoft RDP client on Android (called "Windows App") ...
Status: REOPENED
Alias: None
Product: KRdp
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.6.90
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-16 16:58 UTC by Prajna Sariputra
Modified: 2026-10-28 21:50 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.7.6
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prajna Sariputra 2026-05-16 16:58:15 UTC
DESCRIPTION
When I heard that KRdp now has an implementation of progressive encoding, I decided to try compiling and running KRdp from git master (alongside KDE Plasma, using the command `kde-builder plasma-desktop kscreen spectacle plasma-keyboard plasma-systemmonitor xdg-desktop-portal-kde krdp` on Arch Linux) to see if I can now connect to KRdp using Microsoft's official RDP client on Android (now called the "Windows App") since it doesn't support H264 encoding.

Indeed, I am able to connect using that RDP client now, however I noticed that it quite often results in the visuals being frozen but with input still working, as in I can move the mouse, click on things and type stuff in the client and have the host respond, but the picture on the client is still, aside from the mouse cursor which I believe is rendered client side.

STEPS TO REPRODUCE
1. Run KRdp from git master (my compiled from source setup was at commit 8e1de600a6ea4fcb1662508626da2cf0499f9734)
2. Connect using the "Windows App" on Android
3. Try to use the system as normal through the RDP connection

OBSERVED RESULT
The screen on the client side freezes except the cursor

EXPECTED RESULT
The screen on the client should not freeze

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: Git master from kde-builder
KDE Frameworks Version: Git master from kde-builder
Qt Version: 6.11.1
Kernel Version: 7.0.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 18 × Intel® Core™ Ultra 5 125H
Memory: 32 GiB of RAM (30.8 GiB usable)
Graphics Processor: Intel® Arc (Mesa 26.0.6-arch1.1)

ADDITIONAL INFORMATION
In the logs, I can see a lot of "PipeWire frame did not contain usable image data" messages from krdpserver, and when I try to disconnect from the client side I see two more messages which say "pw_stream_set_active called from wrong context, check thread and locking: Device or resource busy" and "impl_ext_end_proxy called from wrong context, check thread and locking: Device or resource busy". The system tray icon saying that KRdp is exercising remote control privileges also stays even though I have disconnected, and if I try stopping the KRdp service (either from the KCM or through systemctl directly) I notice systemd takes some time to wait for KRdp to exit, but it eventually gives up and issues a SIGKILL to KRdp.

If I just try disconnecting and reconnecting from the client side, it works until it freezes again, and if I keep repeating that the system tray icons saying that KRdp is exercising remote control privileges will start piling up until I stop KRdp.

I tried another Android RDP client called aRDP, which has an option to enable or disable H264 support, and if I disable that support I can sometimes reproduce the same issue, but not consistently, while with the "Windows App" I get the problem practically 100% of the time within a few seconds of moving things around on the screen.

I also tried the KDE Linux live image named "kde-linux_202605160254.raw" from a USB stick, and it behaves the same as my compiled from source setup.
Comment 1 TraceyC 2026-06-25 21:17:24 UTC
I found that there's an existing bug about this, so I'll merge this in with the older one. This should be fixed in Plasma 6.7.0. If it isn't, please reopen this report. Thanks!

*** This bug has been marked as a duplicate of bug 520175 ***
Comment 2 Prajna Sariputra 2026-06-26 01:37:00 UTC
I just retested with Plasma 6.7.1 from the Arch Linux repos, and the issue still occurs, so I don't think this is the same bug as the other one which is supposed to be fixed with 6.7.0.
Comment 3 nyanpasu64 2026-07-19 00:23:26 UTC
I get the same issue connecting from Windows App on macOS (not iOS). When the hang happens, journalctl shows the following errors:

Jul 18 17:06:09 servlet krdpserver[1224]: [AVHWFramesContext @ 0x7f67a817edc0] Failed to create surface from DRM object: 18 (invalid parameter).
Jul 18 17:06:09 servlet krdpserver[1224]: [Parsed_hwmap_0 @ 0x7f67a816ec80] Failed to map frame: -5.
Jul 18 17:06:09 servlet krdpserver[1224]: Failed receiving filtered frame: Input/output error
...
Jul 18 17:06:11 servlet krdpserver[1224]: Failed receiving filtered frame: Input/output error
Jul 18 17:06:11 servlet krdpserver[1224]: Filter queue is full, dropping frame 7752008
Jul 18 17:06:11 servlet krdpserver[1224]: Filter queue is full, dropping frame 7752025
Jul 18 17:06:11 servlet krdpserver[1224]: Failed receiving filtered frame: Input/output error
...

I'm on Arch Linux, with an i7-8559U (Coffee Lake) GPU, and had to install libva-intel-driver to not get a black screen on viewers. Unchecking "Update the screen resolution on resize" did not fix the issue.
Comment 4 Max Quinn 2026-10-10 15:01:52 UTC
I was running into this issue and after I failed to find anything myself I had Claude try to fix it. This report was written by Claude. I am sorry to whoever is reading through this and I am very sorry if it turns out to be useless but I do not have quite the level of technical knowledge to be able to fix this myself. I will try my best to answer any questions or provide any more information, but honestly I can't promise that I'll be of much help. Best of luck and thank you to whatever volunteer is going through this.


I think I have the mechanism for this. Short version: the RDPGFX in-flight
frame window is drained only by client frame acknowledgements and has no
timeout, so a client that stops acknowledging wedges the video stream
permanently while input keeps working.

Environment
  krdp 6.7.4, FreeRDP 3.31.0, Fedora 44 (Nobara), kernel 7.2.8
  Plasma 6.7.4 Wayland
  Client: Microsoft "Windows App" for Android, running on ChromeOS
          [app version: 11.0.26071.13915] [ChromeOS version: 154.0.8037.96]
  Host GPUs: NVIDIA RTX 3050 + AMD Granite Ridge iGPU, one monitor on each

Symptom
  Connection succeeds, the first frame renders correctly, then video never
  updates again. Input continues to work for the whole "frozen" period --
  typing and clicks land on the host and are visible on the physical
  monitors. Disconnect/reconnect gives one fresh frame, then freezes again.

This is not GPU- or DMA-BUF-related
  Worth stating because this thread has been looking at Intel/Arc specifics
  and "Failed to create surface from DRM object". I reproduced the freeze
  identically with --virtual-monitor 1920x1080@1, i.e. a single output, a
  small surface, and no multi-GPU involvement. Same freeze, same timing.
  Whatever the DRM/encoder errors other reporters are seeing, the freeze
  itself reproduces without them.

Measurements taken during a live frozen session
  Capture side is healthy:
    - both PipeWire nodes 'running', and the link between them 'active'
    - injecting pointer motion through the portal delivered ~40 frames on
      the capture node
    - an injected rubber-band drag produced real content damage, not just
      cursor movement
  Send side is completely idle:
    - ss -ti on the RDP socket: bytes_sent frozen at 9911521 across 8s and
      12s samples (full-desktop config), and at 2633169 across 5s and
      across the whole drag test (virtual-monitor config)
    - zero bytes. KRdp is not sending anything at all, not sending
      corrupt or undecodable frames.
  So frames are arriving from KWin and nothing is leaving for the client.

  Suppress Output is ruled out: that path goes through setActive(false),
  which would deactivate the PipeWire stream. The stream stayed active
  throughout.

Where it blocks (line numbers from Plasma/6.7)
  VideoStream.cpp:40   constexpr qsizetype MaximumInFlightFrames = 2;
  VideoStream.cpp:795  hasInFlightCapacity() -> pendingFrames.size() < 2
  VideoStream.cpp:356  submission thread's first gate is !hasInFlightCapacity()
  VideoStream.cpp:845  pendingFrames.insert(frameId) on send
  VideoStream.cpp:635  pendingFrames.erase(itr) in onFrameAcknowledge()

  pendingFrames is erased in exactly one place: onFrameAcknowledge(). The
  only other things that touch it are clear() on an encoding-mode switch
  (:396) and on GFX channel re-advertisement (:531). There is no timeout
  anywhere. Once two frames are outstanding and unacknowledged, the
  submission thread spins on a 1ms sleep forever and the stream is dead
  for the life of the connection.

  Input is unaffected because it travels an entirely separate path through
  the portal, which is exactly why this presents as a client/input bug and
  why there are several open reports describing "black screen but input
  works" (see below).

  This client negotiates RDPGFX_CAPS_FLAG_AVC_DISABLED (0x20), so
  onCapsAdvertise() selects EncodingMode::Progressive. In that mode
  queueFrame() keeps only the newest frame and accumulates damage into it,
  so there is no memory growth -- it just silently stops sending.

Still present in master
  master makes the window RTT-adaptive (maxInFlight recomputed in
  updateInFlightWindow() on rttChanged) but MaximumInFlightFrames = 2 is
  now the *floor*, the drain is still acknowledgement-only, and the
  submission loop is byte-for-byte equivalent. Updating will not fix this.

The one existing recovery path
  onCapsAdvertise() clears pendingFrames when a client re-advertises caps
  (treated as a GFX channel reset). mstsc does this; it may be why desktop
  Windows clients mostly recover. This Android client does not appear to,
  so there is no escape.

What I have NOT confirmed
  That the client actually stops sending RDPGFX_FRAME_ACKNOWLEDGE. I
  inferred it: the pipeline demonstrably worked once (first frame
  rendered), capture stayed healthy, zero bytes left the socke
  in-flight window is the only non-recoverable gate on that path. I did
  not capture the wire or run an instrumented build. Confirmin
  cheap -- a qCDebug of frameId in onFrameAcknowledge() plus
  pendingFrames.size() in the submission loop would settle it
  connection. Happy to run that if someone points me at a build.

Suggested fix
  Store a send timestamp alongside each pending frame id. If t
  outstanding frame exceeds some bound (a few seconds, or N * RTT from
  NetworkDetection), drop it from pendingFrames, warn once, an
  fresh full-damage frame. That turns a permanent freeze into a brief
  stutter and costs nothing for well-behaved clients. A strict
  would also recreate the surface / send RDPGFX_RESET_GRAPHICS.

Possibly the same root cause
  Bug 525818 -- freeze on client minimise/lock, input still ac
             Same signature, different trigger.
  Bug 494715 -- black screen, keyboard and mouse still registe
             server device.
  Bug 507949 -- OOM when a client stops receiving data. In H26
             queueFrame() appends unbounded and only clears on a
             keyframe, so a stuck in-flight window would grow
             without limit. Plausibly this defect with a different
             consequence depending on encoding mode.

Unrelated minor thing noticed while reading logs: capVersionTo
no cases for RDPGFX_CAPVERSION_105/106/107, so modern clients log
"Selected caps: UNKNOWN_VERSION", which is misleading when debugging.
Comment 5 Bug Janitor Service 2026-10-12 08:23:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/krdp/-/merge_requests/254
Comment 6 yurymonzon 2026-10-12 12:04:43 UTC
Fixed in krdp master by https://invent.kde.org/plasma/krdp/-/commit/fe0037384404b74895bff5a5f4cf411a62f1c712 (should be in Plasma 6.9).
Comment 7 David Edmundson 2026-10-13 13:48:31 UTC
Git commit 472584e57758863fa7aea831450e52d09c3900de by David Edmundson.
Committed on 13/10/2026 at 13:46.
Pushed by davidedmundson into branch 'Plasma/6.8'.

VideoStream: Stop waiting for acknowledgements the client suspended

A client can set queueDepth in RDPGFX_FRAME_ACKNOWLEDGE_PDU to
SUSPEND_FRAME_ACKNOWLEDGEMENT to stop acknowledging frames until it sends
a regular acknowledgement again. Frames sent after that stayed pending
forever, the in-flight window filled up and no more frames were
submitted: the picture froze while input kept working. The Windows App
on Android does this after about 20 frames.

Do not track sent frames as pending while acknowledgements are
suspended.


(cherry picked from commit fe0037384404b74895bff5a5f4cf411a62f1c712)

Co-authored-by: Yury MonZon <yurymonzon@gmail.com>

M  +12   -1    src/VideoStream.cpp

https://invent.kde.org/plasma/krdp/-/commit/472584e57758863fa7aea831450e52d09c3900de
Comment 8 anomaly256 2026-10-24 00:14:42 UTC
Hello, I seem to be hitting this same issue today with krdp 6.8.1, which after looking at the source debs appears to already contain this patch.

Same symptom, can auth and see the desktop initially for a few frames, then it appears frozen in the remote client despite the local console showing the input and graphical updates.
Comment 9 anomaly256 2026-10-24 00:16:00 UTC
Oct 24 11:15:33 glow krdpserver[150457]: New client connected:  Unspecified platform Unspecified version
Oct 24 11:15:33 glow krdpserver[150457]: PAM unable to dlopen(pam_lastlog.so): /usr/lib/security/pam_lastlog.so: cannot open shared object file: No such file or directory
Oct 24 11:15:33 glow krdpserver[150457]: PAM adding faulty module: pam_lastlog.so
Oct 24 11:15:33 glow krdpserver[150457]: Tried to make uncreated stream active
Oct 24 11:15:33 glow krdpserver[150457]: eglChooseConfig returned this many configs: 1
Oct 24 11:15:42 glow krdpserver[150457]: PipeWire frame did not contain usable image data
Oct 24 11:15:42 glow krdpserver[150457]: PipeWire frame did not contain usable image data
Oct 24 11:15:42 glow krdpserver[150457]: PipeWire frame did not contain usable image data
Oct 24 11:15:42 glow krdpserver[150457]: PipeWire frame did not contain usable image data
Comment 10 Prajna Sariputra 2026-10-24 22:08:08 UTC
I'm also still seeing the bug on Plasma 6.8.1 from the Arch repos, although at least now the system tray icons don't pile up anymore if I disconnect and reconnect. The logs I see are the same as what anomaly256 reported in comment 9, but without the two PAM lines, and the "PipeWire frame did not contain usable image data" repeats until I disconnect the client.

Operating System: Arch Linux 
KDE Plasma Version: 6.8.1
KDE Frameworks Version: 6.31.0
Qt Version: 6.12.0
Kernel Version: 7.2.11-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 14 × Intel® Core™ Ultra 5 125H
Memory: 32 GiB of RAM (30.8 GiB usable)
Graphics Processor: Intel® Arc (Mesa 26.2.5-arch1.1)
Comment 11 anomaly256 2026-10-28 21:50:31 UTC
(In reply to Prajna Sariputra from comment #10)
> I'm also still seeing the bug on Plasma 6.8.1 from the Arch repos, although
> at least now the system tray icons don't pile up anymore if I disconnect and
> reconnect. The logs I see are the same as what anomaly256 reported in
> comment 9, but without the two PAM lines, and the "PipeWire frame did not
> contain usable image data" repeats until I disconnect the client.
> 
> Operating System: Arch Linux 
> KDE Plasma Version: 6.8.1
> KDE Frameworks Version: 6.31.0
> Qt Version: 6.12.0
> Kernel Version: 7.2.11-arch1-1 (64-bit)
> Graphics Platform: Wayland
> Processors: 14 × Intel® Core™ Ultra 5 125H
> Memory: 32 GiB of RAM (30.8 GiB usable)
> Graphics Processor: Intel® Arc (Mesa 26.2.5-arch1.1)

Sorry I shouldn't have included those PAM lines in the paste, they're not relevant