Files
ultix/12-fix-rdp-bigres.sh
T
mrcharles 0beb30e896 Disable EGFX server-wide: Jump decode was the color bars (#611)
With the server proven clean at 5160x2160 (band analysis + freerdp on
every codec), Jump still painted bars - its EGFX large-frame decode is
broken regardless of budget. drdynvc=false blocks EGFX for all clients;
clipboard/audio ride separate channels and survive. Classic codec
verified clean at 5160 via harness. Script part 3 + xrdp bounced.

Details: https://projects.knownelement.com/issues/611
2026-09-01 16:52:25 -05:00

98 lines
4.3 KiB
Bash
Executable File

#!/bin/bash
# 12-fix-rdp-bigres.sh — xrdp EGFX big-resolution fix (Redmine #611)
#
# Symptom: Jump Desktop from iPad -> big external monitor (5160x2160)
# showed color bars / cut sides. Root cause candidate: default EGFX
# compressed-frame budget truncates large frames at this width.
# freerdp UAT at 5160x2160 (all codecs + mid-session resize) is clean;
# this mitigation raises the budget for the Jump client path.
#
# Idempotent: run as root on ultix-streaming.
set -euo pipefail
DROPIN=/etc/systemd/system/xrdp.service.d/bigres.conf
mkdir -p "$(dirname "$DROPIN")"
cat > "$DROPIN" <<'EOF'
[Service]
Environment=XRDP_GFX_MAX_COMPRESSED_BYTES=33554432
Environment=XRDP_GFX_FRAMES_IN_FLIGHT=2
EOF
systemctl daemon-reload
# bounce only when nobody is connected: check for active RDP sessions first
ACTIVE=$(pgrep -c -f 'Xorg.*xrdp/xorg.conf' || true)
if [ "${ACTIVE:-0}" -gt 0 ]; then
echo "Active RDP X sessions: $ACTIVE — NOT restarting; apply at next bounce with:"
echo " systemctl restart xrdp-sesman xrdp"
else
systemctl restart xrdp-sesman xrdp
sleep 2
systemctl is-active xrdp xrdp-sesman
fi
grep -q XRDP_GFX_MAX_COMPRESSED_BYTES "$DROPIN" && echo "drop-in present: $DROPIN"
###############################################################################
# Part 2 — kwin_x11 black-screen fix (root-caused 2026-09-01, #611)
#
# Symptom: RDP login -> KDE spinner -> BLACK screen. Server-side bisect
# showed display :10 rendering pure black (colors=1): kwin_x11 was
# crash-looping (plasma-kwin_x11.service "start operation timed out",
# restart counter 12+). Cause: software-GL compositing init under
# xorgxrdp (no DRI) at 5160x2160 never finishes inside the unit's
# start timeout; systemd kills kwin -> no desktop. The "spinner" the
# user sees is KSplash firing on every kwin restart.
#
# Fix: disable X11 compositing for the RDP accounts (kwin runs
# uncomposited = instant, no GL) and give the kwin unit start-time
# headroom. Wayland console session unaffected (Compositing/Enabled is
# an X11-only key). Verified with the freerdp harness on rdptest:
# fresh 1408x945 / fresh 5160x2160 / resize up mid-session / resize
# down on reconnect — all render real desktops.
###############################################################################
for ACCOUNT in reachableceo reachableceo-offstage; do
runuser -u "$ACCOUNT" -- kwriteconfig6 --file kwinrc \
--group Compositing --key Enabled false
echo "kwinrc Compositing=false: $ACCOUNT"
done
mkdir -p /etc/systemd/user/plasma-kwin_x11.service.d
cat > /etc/systemd/user/plasma-kwin_x11.service.d/bigres-timeout.conf <<'EOF'
[Service]
# big-res xorgxrdp sessions: software-GL init is slow; give kwin room
# instead of kill+crashloop (#611)
TimeoutStartSec=300
EOF
systemctl daemon-reload
###############################################################################
# Part 3 — EGFX off for all clients (drdynvc=false), 2026-09-01 evening
#
# Final piece of #611: with the server rendering CLEAN at 5160x2160
# (verified by band-analysis of live captures + freerdp harness on every
# codec), Jump Desktop still painted color bars down the side — its
# decode of xrdp's EGFX large frames is broken regardless of the
# compressed-frame budget. EGFX rides the drdynvc channel; blocking it
# server-side makes every client (Jump included) fall back to the
# classic codecs, which render this monitor fine. Clipboard (cliprdr)
# and audio (rdpsnd) are separate channels and survive.
###############################################################################
sed -i 's/^drdynvc=true/drdynvc=false/' /etc/xrdp/xrdp.ini
grep -q '^drdynvc=false' /etc/xrdp/xrdp.ini || { echo "drdynvc line missing; check /etc/xrdp/xrdp.ini" >&2; exit 1; }
ACTIVE=$(pgrep -c -f 'Xorg.*xrdp/xorg.conf' || true)
if [ "${ACTIVE:-0}" -gt 0 ]; then
echo "Active RDP X sessions: $ACTIVE — xrdp listener restart will blip clients;"
echo "sessions survive (sesman untouched). Apply with: systemctl restart xrdp"
else
systemctl restart xrdp
fi
echo "EGFX disabled (drdynvc=false) — clients now negotiate classic codecs."
echo "kwin unit override: /etc/systemd/user/plasma-kwin_x11.service.d/bigres-timeout.conf"
echo
echo "If a session is currently black: loginctl terminate-session <id> (or"
echo "loginctl terminate-user <user> for their RDP sessions) and reconnect."