From 7374ce0b10055fabbbe90dd0b89bc785870cf448 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Sep 2022 12:26:36 +0200 Subject: [remote-access] Get rid of evdi for now Causes problems with certain Intel HD versions, makes acceleration slow on nVidia if no real screen is connected. Why can't we have nice things. :-( --- .../data/etc/X11/Xsetup.d/50-launch-vncserver | 17 +++++++++++++++++ .../data/opt/openslx/scripts/systemd-remote_x_config | 4 ++++ 2 files changed, 21 insertions(+) (limited to 'core/modules/remote-access') diff --git a/core/modules/remote-access/data/etc/X11/Xsetup.d/50-launch-vncserver b/core/modules/remote-access/data/etc/X11/Xsetup.d/50-launch-vncserver index ae48a87f..67c7fec0 100755 --- a/core/modules/remote-access/data/etc/X11/Xsetup.d/50-launch-vncserver +++ b/core/modules/remote-access/data/etc/X11/Xsetup.d/50-launch-vncserver @@ -69,6 +69,7 @@ gotone=false vmvnc=false idle=0 + stepcount=0 # In case of stale entry # TODO: This sucks anyways performance-wise for VMware, maybe remove? iptables -t nat -D PREROUTING -p tcp --dport "$vnc_port" -j REDIRECT --to-ports 5901 @@ -80,6 +81,22 @@ else idle=$(( idle + 1 )) fi + if $gotone; then + # As soon as someone is connected, "blank" the screen by setting brightness to zero. + # This doesn't seem to affect the framebuffer, luckily + # Let's see how well this works in practice. :-( + if (( stepcount == 0 )); then + declare -a args + args=() + for o in $( xrandr | grep -E '^[A-Z0-9-]+ connected.*[0-9]+x[0-9]+' | awk '{print $1}' ); do + args+=( "--output" "$o" "--brightness" "0" ) + done + xrandr "${args[@]}" + fi + if (( stepcount++ > 3 )); then + stepcount=0 + fi + fi if $gotone && [ "$idle" -gt 120 ]; then # 120 * 5 = 10 mins kill "$vncpid" break diff --git a/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config b/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config index fa6fc148..ffa7caf2 100755 --- a/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config +++ b/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config @@ -41,6 +41,10 @@ if [ "$driver" = "intel" ]; then # This only works for very old i915 chips that don't support modesetting sed "s/%DRIVER%/${driver}/g" "/opt/openslx/remote-access/xorg-virtual.conf" > "/etc/X11/xorg.conf.d/16-remote-access-${driver}-virtual.conf" fi + +# Do NOT use evdi for now, makes 3D slow on some nvidias, completely breaks vmware output on some intels +exit 0 + # For everything else, we use th evdi kernel module to add a virtual output if insmod "/lib/modules/$(uname -r)/kernel/extra/evdi.ko" initial_device_count=1 \ || modprobe evdi; then -- cgit v1.2.3-55-g7522