Bug 497765 - krdc: Un- and Refocusing window makes stream (video and input) freeze
Summary: krdc: Un- and Refocusing window makes stream (video and input) freeze
Status: RESOLVED FIXED
Alias: None
Product: KRdp
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.2.4
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-21 21:14 UTC by postix
Modified: 2026-07-04 00:21 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2024-12-21 21:14:58 UTC
SUMMARY

I'm not quiet sure if this is a kwin issue, but it's reproducible with Qt and Gtk RDP-clients.

STEPS TO REPRODUCE
1. Open KRDC 24.12.0 _or_ Remmina 1.4.36 (windowed)
2. Establish an RDP connection using h264 as codec
(Tumbleweed with Plasma 6.2.4 Wayland + opi codecs to Fedora 41 Plasma 6.2.4 Wayland)
3. Tab out or click into  another window such as console or click onto KRDC's or Remmina's task manager icon
4. Focus KRDC or Remmina again

OBSERVED RESULT
The connection broke: The video stream is frozen and the remote receives no more input.

EXPECTED RESULT
Unfocusing does not break the rdp connection.

SOFTWARE/OS VERSIONS
(RDP Client)
Operating System: openSUSE Tumbleweed 20241218
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.11.8-1-default (64-bit)
Graphics Platform: Wayland
Pipewire: 1.2.7
Wireplumber: 0.5.7
Comment 1 Bug Janitor Service 2026-06-26 14:03:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kpipewire/-/merge_requests/263
Comment 2 Bug Janitor Service 2026-06-26 14:24:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/krdp/-/merge_requests/199
Comment 3 Shouvik Kar 2026-06-30 08:59:16 UTC
Git commit 19bb322a5b7253d3882b8c2e6efa804711b645c5 by Shouvik Kar.
Committed on 26/06/2026 at 16:16.
Pushed by davidedmundson into branch 'master'.

PipeWireBaseEncodedStream: clarify pause() doc comment

Spell out that pause() stops the source stream while frames already in the
encode pipeline may still be encoded and emitted briefly, rather than
implying that encoding stops immediately.

M  +3    -2    src/pipewirebaseencodedstream.h

https://invent.kde.org/plasma/kpipewire/-/commit/19bb322a5b7253d3882b8c2e6efa804711b645c5
Comment 4 Shouvik Kar 2026-06-30 08:59:24 UTC
Git commit a4ec9070bd618e1120e1d4d7f7f769f43edf02d9 by Shouvik Kar.
Committed on 26/06/2026 at 13:52.
Pushed by davidedmundson into branch 'master'.

PipeWireBaseEncodedStream: add pause() and resume()

Add pause()/resume(), which deactivate and reactivate the running stream
via pw_stream_set_active() without tearing it down, keeping the produce
thread, encoder, stream and fd alive. While paused no frames are delivered,
so the encoder idles. This lets a consumer suspend encoding (for example
when an RDP client minimizes and sends a Suppress Output PDU) and resume
without re-establishing the PipeWire stream.

M  +36   -0    src/pipewirebaseencodedstream.cpp
M  +15   -0    src/pipewirebaseencodedstream.h
M  +14   -0    src/pipewireproduce.cpp
M  +5    -0    src/pipewireproduce_p.h

https://invent.kde.org/plasma/kpipewire/-/commit/a4ec9070bd618e1120e1d4d7f7f769f43edf02d9
Comment 5 David Edmundson 2026-07-01 08:03:42 UTC
Git commit e58caeaabfae653ead0952d3795aa3a17b882009 by David Edmundson, on behalf of Shouvik Kar.
Committed on 30/06/2026 at 09:00.
Pushed by davidedmundson into branch 'master'.

VideoStream: pause the encoded stream on suppress output instead of stopping

Requires: https://invent.kde.org/plasma/kpipewire/-/merge_requests/263

When a client suppresses output (e.g. its window is minimized) the encoded
stream was stopped via PipeWireEncodedStream::stop() and restarted via
start() on restore. But stop() is terminal in kpipewire - it closes the
single-use PipeWire fd - so start() never resumes and the session freezes
permanently.

Use the new pause()/resume() API instead: pause the encoded stream on
suppress (keeping it alive) and resume it on restore. The stream is only
fully stopped on teardown via close(). The progressive/source-stream path
is unchanged, as it already uses setActive().

Set as draft until the above linked MR is in kpipewire.

M  +6    -2    src/VideoStream.cpp

https://invent.kde.org/plasma/krdp/-/commit/e58caeaabfae653ead0952d3795aa3a17b882009