Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b112e1e
Initial plan
Copilot Dec 14, 2025
1762e52
Add EVDI support to Linux CI builds and dependencies
Copilot Dec 14, 2025
4dde941
Add EVDI to Fedora/COPR spec file
Copilot Dec 14, 2025
fd15274
Address code review feedback for EVDI changes
Copilot Dec 14, 2025
f963ca5
Add EVDI startup logging and display detection for KMS/EVDI
Copilot Dec 14, 2025
2fa4ce2
Ensure EVDI virtual display supersedes configured Display Id
Copilot Dec 14, 2025
037607e
Improve EVDI display detection with VIRTUAL connector type
Copilot Dec 14, 2025
88dd875
Add proper header declaration for find_virtual_display
Copilot Dec 14, 2025
1f491f6
Enable EVDI in Arch Linux CI builds
Copilot Dec 14, 2025
b5dc40b
Make EVDI required and add cmake config to Arch PKGBUILD
Copilot Dec 14, 2025
4626590
Fix Arch CI: use builder home directory for AUR build
Copilot Dec 14, 2025
ec44375
Build evdi library from source instead of AUR package
Copilot Dec 14, 2025
15382b7
Fix Arch CI: add build dependencies and correct install paths
Copilot Dec 14, 2025
fce46c9
Fix PKGBUILD: remove evdi from makedepends, use evdi-dkms for runtime
Copilot Dec 14, 2025
2ffbf7c
Fix Arch CI: explicitly copy evdi_lib.h to /usr/include
Copilot Dec 14, 2025
467bb7c
Fix missing kms_display extern declaration in evdi.cpp
Copilot Dec 14, 2025
44d48b3
Fix compilation errors: add evdi_is_active() function
Copilot Dec 14, 2025
deabf7c
Add diagnostics and ensure evdi library is in correct location
Copilot Dec 14, 2025
c791a97
Fix verify_evdi to not require kernel module at startup
Copilot Dec 14, 2025
8a7d1f7
Fix EVDI to always show as selectable display
Copilot Dec 14, 2025
03dfdb0
Fix EVDI device opening to use device path instead of ID
Copilot Dec 14, 2025
0cfa2f1
Fix EVDI device opening to use integer device ID not path
Copilot Dec 14, 2025
cb62356
Fix EVDI device creation to use evdi_open_attached_to API
Copilot Dec 14, 2025
f5943c2
Remove device checking at startup to avoid errors when no devices exist
Copilot Dec 14, 2025
5c73dcc
Improve EVDI error messaging and reduce wait time
Copilot Dec 14, 2025
959939a
Add comprehensive debug logging to EVDI implementation
Copilot Dec 14, 2025
d1c7a3e
Fix CI error: remove device_id field access from opaque handle
Copilot Dec 14, 2025
2ce073b
Fix potential segfault: add null checks and exception handling
Copilot Dec 14, 2025
72046da
Fix test segfault by improving error handling and skipping EVDI devic…
Copilot Dec 15, 2025
ec9db61
Add safety checks in verify_evdi to prevent segfault during initializ…
Copilot Dec 15, 2025
b887729
Update EVDI to v1.14.11 and remove device check from verify_evdi to p…
Copilot Dec 15, 2025
02555b5
Add exception handling and enhanced debug logging around evdi_open_at…
Copilot Dec 15, 2025
4ea236f
Defer EVDI device creation during encoder validation to prevent segfa…
Copilot Dec 15, 2025
d532d1a
Add sysfs checks to detect EVDI kernel module issues before calling l…
Copilot Dec 15, 2025
92bfd49
Fix EVDI segfault by preventing device creation during encoder valida…
Copilot Dec 15, 2025
a753dc5
Refactor encoder validation to support virtual displays with two-phas…
Copilot Dec 15, 2025
316d51b
Add Phase 2 encoder capability refinement when streaming starts
Copilot Dec 15, 2025
3cc3c0d
Fix EVDI display creation and client configuration matching
Copilot Dec 15, 2025
9dbd426
Refactor EVDI to use explicit device creation instead of state flag
Copilot Dec 15, 2025
a64764e
Apply code review feedback: improve EVDI preparation logic
Copilot Dec 15, 2025
8f36848
Add diagnostic logging to debug why evdi_prepare_stream() is not bein…
Copilot Dec 15, 2025
71ab7f8
Add EVDI preparation to captureThread for PARALLEL_ENCODING encoders
Copilot Dec 15, 2025
9e1a735
Add permission checks and exception handling for EVDI library calls
Copilot Dec 15, 2025
46f4c45
Fix segfault by using evdi_add_device() instead of deprecated evdi_op…
Copilot Dec 15, 2025
1cd3427
Fix EVDI to use evdi_check_device() instead of evdi_add_device() for …
Copilot Dec 15, 2025
537e98a
Fix EVDI crash by removing evdi_handle_events() and adding KMS detect…
Copilot Dec 15, 2025
85b72a8
Implement proper EDID generation for client-requested resolutions
Copilot Dec 15, 2025
ce6e629
Implement HDR support via CTA-861 extension block in EDID
Copilot Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/ci-archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,68 @@
xorg-server-xvfb
pacman -Scc --noconfirm

- name: Install EVDI library from source
shell: bash
run: |
# Install build dependencies
pacman -S --needed --noconfirm libdrm make gcc

Check failure on line 72 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Create a build directory in builder's home
mkdir -p /home/builder/evdi-build
chown -R builder:builder /home/builder/evdi-build

Check failure on line 76 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Clone evdi from official DisplayLink repository at tag v1.14.11
cd /home/builder/evdi-build
sudo -u builder git clone --depth 1 --branch v1.14.11 https://github.com/DisplayLink/evdi.git
cd evdi/library

Check failure on line 81 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Build the library as builder user
sudo -u builder make

Check failure on line 84 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Install the library and headers (as root)
make install PREFIX=/usr

Check failure on line 87 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Ensure header is in the correct location
cp -f evdi_lib.h /usr/include/

Check failure on line 90 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Ensure library is in the correct location (evdi makefile might put it elsewhere)
if [ -f /usr/local/lib/libevdi.so ]; then
cp -f /usr/local/lib/libevdi.so* /usr/lib/ || true
fi

Check failure on line 95 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Update library cache
ldconfig

Check failure on line 98 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Verify installation
ls -la /usr/lib/libevdi.so* || echo "Warning: libevdi.so not found in /usr/lib"
ls -la /usr/include/evdi_lib.h || echo "Warning: evdi_lib.h not found in /usr/include"

Check failure on line 102 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
# Create pkg-config file for cmake to find evdi
mkdir -p /usr/lib/pkgconfig
cat > /usr/lib/pkgconfig/evdi.pc << 'EVDI_PC_EOF'
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Check failure on line 110 in .github/workflows/ci-archlinux.yml

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

trailing spaces
Name: evdi
Description: Extensible Virtual Display Interface
Version: 1.14.11
Libs: -L${libdir} -levdi
Cflags: -I${includedir}
EVDI_PC_EOF

# Verify pkg-config works
pkg-config --exists evdi && echo "pkg-config: evdi found" || echo "pkg-config: evdi NOT found"
pkg-config --modversion evdi || true
pkg-config --libs evdi || true
pkg-config --cflags evdi || true

# Clean up
cd /
rm -rf /home/builder/evdi-build
rm -rf /home/builder/evdi-build

- name: Checkout
uses: actions/checkout@v6

Expand Down Expand Up @@ -133,12 +195,14 @@

# Export PKGBUILD options so they're available to makepkg
export _use_cuda="${_use_cuda}"
export _use_evdi="true"
export _run_unit_tests="${_run_unit_tests}"
export _support_headless_testing="${_support_headless_testing}"

# Build the package as builder user (pass through environment variables)
sudo -u builder env \
_use_cuda="${_use_cuda}" \
_use_evdi="true" \
_run_unit_tests="${_run_unit_tests}" \
_support_headless_testing="${_support_headless_testing}" \
makepkg -si --noconfirm
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:

sudo apt-get install -y \
libdrm-dev \
libevdi-dev \
libfuse2 \
libgl-dev \
libwayland-dev \
Expand Down
6 changes: 4 additions & 2 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ if(${SUNSHINE_ENABLE_EVDI})
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/platform/linux/evdi.h"
"${CMAKE_SOURCE_DIR}/src/platform/linux/evdi.cpp")
message(STATUS "EVDI virtual display support enabled")
else()
message(WARNING "EVDI library not found. Virtual display support will not be available.
Install libevdi-dev or build evdi from https://github.com/DisplayLink/evdi")
message(FATAL_ERROR "EVDI library not found but SUNSHINE_ENABLE_EVDI is ON. "
"Install libevdi-dev or build evdi from https://github.com/DisplayLink/evdi. "
"To build without EVDI, set -DSUNSHINE_ENABLE_EVDI=OFF")
endif()
endif()

Expand Down
15 changes: 15 additions & 0 deletions packaging/linux/Arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
: "${_run_unit_tests:=false}" # if set to true; unit tests will be executed post build; useful in CI
: "${_support_headless_testing:=false}"
: "${_use_cuda:=detect}" # nvenc
: "${_use_evdi:=detect}" # evdi virtual display

: "${_commit:=@GITHUB_COMMIT@}"

Expand Down Expand Up @@ -61,6 +62,7 @@ checkdepends=(

optdepends=(
'libva-mesa-driver: AMD GPU encoding support'
'evdi-dkms: EVDI virtual display kernel module (required for EVDI virtual display support)'
)

provides=()
Expand All @@ -80,6 +82,13 @@ if [[ "${_use_cuda::1}" == "t" ]]; then
)
fi

if [[ "${_use_evdi::1}" == "d" ]] && pacman -Qi evdi &> /dev/null; then
_use_evdi=true
fi

# Note: evdi library is built from source in CI before makepkg runs
# It is not added to makedepends to avoid dependency on AUR packages

if [[ "${_support_headless_testing::1}" == "t" ]]; then
optdepends+=(
'xorg-server-xvfb: Virtual X server for headless testing'
Expand Down Expand Up @@ -149,6 +158,12 @@ build() {
fi
fi

if [[ "${_use_evdi::1}" == "t" ]]; then
_cmake_options+=(-DSUNSHINE_ENABLE_EVDI=ON)
else
_cmake_options+=(-DSUNSHINE_ENABLE_EVDI=OFF)
fi

if [[ "${_run_unit_tests::1}" != "t" ]]; then
_cmake_options+=(-DBUILD_TESTS=OFF)
fi
Expand Down
8 changes: 8 additions & 0 deletions packaging/linux/copr/Sunshine.spec
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ BuildRequires: systemd-rpm-macros
BuildRequires: wget
BuildRequires: which

# EVDI virtual display support - optional
# Enable with: rpmbuild --with evdi
# Note: libevdi-devel may not be available in all repositories
%if 0%{?_with_evdi}
BuildRequires: libevdi-devel
%endif

%if 0%{?fedora}
# Fedora-specific BuildRequires
BuildRequires: appstream
Expand Down Expand Up @@ -190,6 +197,7 @@ cmake_args=(
"-DSUNSHINE_ENABLE_WAYLAND=ON"
"-DSUNSHINE_ENABLE_X11=ON"
"-DSUNSHINE_ENABLE_DRM=ON"
"-DSUNSHINE_ENABLE_EVDI=ON"
"-DSUNSHINE_PUBLISHER_NAME=LizardByte"
"-DSUNSHINE_PUBLISHER_WEBSITE=https://app.lizardbyte.dev"
"-DSUNSHINE_PUBLISHER_ISSUE_URL=https://app.lizardbyte.dev/support"
Expand Down
2 changes: 2 additions & 0 deletions packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ modules:
- shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json
- "modules/avahi.json"
- "modules/boost.json"
- "modules/evdi.json"
- "modules/libevdev.json"
- "modules/libnotify.json"
- "modules/miniupnpc.json"
Expand Down Expand Up @@ -73,6 +74,7 @@ modules:
- -DSUNSHINE_ENABLE_WAYLAND=ON
- -DSUNSHINE_ENABLE_X11=ON
- -DSUNSHINE_ENABLE_DRM=ON
- -DSUNSHINE_ENABLE_EVDI=ON
- -DSUNSHINE_ENABLE_CUDA=ON
- -DSUNSHINE_PUBLISHER_NAME='LizardByte'
- -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev'
Expand Down
27 changes: 27 additions & 0 deletions packaging/linux/flatpak/modules/evdi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "evdi",
"buildsystem": "simple",
"build-commands": [
"make -C library",
"make -C library install DESTDIR=/ PREFIX=/app"
],
"sources": [
{
"type": "git",
"url": "https://github.com/DisplayLink/evdi.git",
"commit": "96d7493e35a227e64c2b8475cd5a5d15d1c1cd7e",
"tag": "v1.14.7",
"x-checker-data": {
"type": "json",
"url": "https://api.github.com/repos/DisplayLink/evdi/releases/latest",
"tag-query": ".tag_name",
"version-query": "$tag | sub(\"^v\"; \"\")",
"timestamp-query": ".published_at"
}
}
],
"cleanup": [
"/include",
"/lib/pkgconfig"
]
}
2 changes: 2 additions & 0 deletions scripts/linux_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function add_debian_based_deps() {
"libcurl4-openssl-dev"
"libdrm-dev" # KMS
"libevdev-dev"
"libevdi-dev" # EVDI virtual display
"libgbm-dev"
"libminiupnpc-dev"
"libnotify-dev"
Expand Down Expand Up @@ -534,6 +535,7 @@ function run_step_cmake() {
"-DSUNSHINE_ENABLE_WAYLAND=ON"
"-DSUNSHINE_ENABLE_X11=ON"
"-DSUNSHINE_ENABLE_DRM=ON"
"-DSUNSHINE_ENABLE_EVDI=ON"
)

if [ "$appimage_build" == 1 ]; then
Expand Down
9 changes: 9 additions & 0 deletions src/platform/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
class path;
}

namespace process::inline v1 {

Check failure on line 55 in src/platform/common.h

View workflow job for this annotation

GitHub Actions / Windows / Windows-AMD64

inline namespace must be specified at initial definition
class child;
class group;
template<typename Char>
Expand Down Expand Up @@ -594,6 +594,15 @@
// A list of names of displays accepted as display_name with the mem_type_e
std::vector<std::string> display_names(mem_type_e hwdevice_type);

#if defined(__linux__) && !defined(__ANDROID__)
/**
* @brief Find a VIRTUAL connector display (typically EVDI) in the KMS display list.
* @param hwdevice_type The hardware device type for encoding.
* @return The display ID as a string, or empty string if not found.
*/
std::string find_virtual_display(mem_type_e hwdevice_type);
#endif

/**
* @brief Check if GPUs/drivers have changed since the last call to this function.
* @return `true` if a change has occurred or if it is unknown whether a change occurred.
Expand Down
Loading
Loading