Repository navigation
fix(linux): explain a missing graphical session when no capture method starts - #6095
Conversation
There was a problem hiding this comment.
Reviewed 0dd6356 against current master (801abd5). Requesting changes for the missing regression coverage described inline and the incomplete PR template described below.
The PR description also needs the complete inherited PR template. Its opening instruction requires retaining every section and HTML comment, including sections that do not apply. The current body omits Testing, Checklist, AI Usage, Screenshot, Issues Fixed or Closed, Roadmap Issues, the remaining Type of Change options, and the template comments. Please restore the full template, put the reproduction and build-limit notes under Testing, select the fix and AI-use checkboxes, and retain the existing AI disclosure in the AI Usage section. Unused sections may remain empty and inapplicable boxes unchecked.
Local whitespace and changed-line clang-format checks passed against a copy verified to match the PR blob. Semantic PR, Read the Docs, and Sonar checks report success.
Verification limit: CI, common lint, and CodeQL await maintainer approval, and no Linux build or runtime tests were run locally on this macOS host. GitHub currently reports the PR mergeable with its target.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
…d starts When Sunshine starts without WAYLAND_DISPLAY and DISPLAY (for example as a systemd user service that started before the session exported its environment), every capture method fails, every encoder then fails the probe, and the last message asks to check that a display is connected. Name the missing session variables instead, unless KMS capture is selected, which works without a session.
- Move the hint into a documented platf::log_missing_graphical_session_hint() helper - Test that it logs without WAYLAND_DISPLAY/DISPLAY for automatic and kwin capture - Test that kms capture or a set session variable suppresses it
336d7bd to
4b41ca5
Compare
|
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6095 +/- ##
========================================
Coverage 50.32% 50.33%
========================================
Files 148 148
Lines 32357 32366 +9
Branches 13692 13700 +8
========================================
+ Hits 16285 16292 +7
- Misses 14004 14781 +777
+ Partials 2068 1293 -775
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 34 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
Screenshot ComparisonPR #6095 screenshots vs Matrix:
|























































































Description
When Sunshine starts on Linux without
WAYLAND_DISPLAYandDISPLAY(for example as a systemd user service that started before the desktop session exported its environment), every capture method fails, then every encoder fails the probe, and the last lines say:The real cause is only visible earlier in the log (
[kwingrab] WAYLAND_DISPLAY not set), so it is easy to go looking at monitors and GPUs instead. I hit this on KDE Plasma 6 (Wayland, NVIDIA) withcapture = kwin.This adds one error line right after "Unable to initialize capture method" when neither variable is set, naming the missing session and how to export it to systemd. It is skipped when
capture = kms, which works without a session. The check lives in a documentedplatf::log_missing_graphical_session_hint()helper so it can be tested without running capture or encoder probes.Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
LinuxCaptureSessionHint.LogsOnlyWithoutSessionVariablesAndWithoutKmsintests/unit/platform/linux/test_misc.cpp. With both variables unset it expects the hint for automatic andkwincapture and no hint forkms; withWAYLAND_DISPLAYorDISPLAYset it expects no hint.test_sunshinelocally on Arch-based Linux (CachyOS) and ran./cmake-build-debug/tests/test_sunshine --gtest_filter='LinuxCaptureSessionHint.*:ProcessEnvironmentSecurity.*': all 3 tests passed. The fulltest_sunshinesuite also passed (937 passed, 5 skipped).uv run --locked lb-update-clang-formatproduced no changes.env -u WAYLAND_DISPLAY -u DISPLAY.Type of Change
Checklist
AI Usage
See our AI usage policy.
The change and this description were prepared with the help of an AI coding assistant (Claude Code); I reviewed them and reproduced the problem on my machine.