Skip to content

fix(viewer): skip the Writeback connector in the eglfs headless guard#2968

Merged
vpetersson merged 1 commit into
masterfrom
fix/viewer-eglfs-ignore-writeback
Jun 1, 2026
Merged

fix(viewer): skip the Writeback connector in the eglfs headless guard#2968
vpetersson merged 1 commit into
masterfrom
fix/viewer-eglfs-ignore-writeback

Conversation

@vpetersson
Copy link
Copy Markdown
Contributor

Issues Fixed

Pi 4 devices on balenaOS 2026.x crash-loop the viewer with no screens available / AnthiasViewer exited before emitting D-Bus handshake, despite the headless guard from #2962.

Root cause: 2026.x exposes a KMS card0-Writeback-1 virtual connector that always reports unknown. #2962's eglfs_has_display() counted any non-disconnected status as "display present" (to tolerate bridge chips reporting unknown). On a headless Pi 4 (both HDMI-A-1/HDMI-A-2 = disconnected), the writeback connector's unknown made the guard think a display was attached → it skipped the wait → launched eglfs → crash-loop. Confirmed on live devices 094231c3, 098fa957 (both: HDMI disconnected, Writeback-1 unknown).

Description

Skip *Writeback* connectors in eglfs_has_display() so only real display outputs (HDMI/DSI/DP/…) count toward "a display is present." A genuinely headless board now waits gracefully (as #2962 intended) instead of crash-looping; the unknown-as-present hedge is kept for real connectors.

Verified locally: headless (HDMI disconnected + Writeback unknown) → waits; HDMI connected → launches; HDMI unknown (bridge) → launches. bash -n + shellcheck clean.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

#2962 added wait_for_eglfs_display so a screenless eglfs (Pi 4) board waits
for a display instead of crash-looping on Qt's "no screens available".
eglfs_has_display() treated any connector status other than "disconnected"
as a present display (to tolerate bridges that report "unknown").

balenaOS 2026.x exposes a KMS `card0-Writeback-1` virtual connector that
ALWAYS reports "unknown". On a headless Pi 4 (both HDMI ports
"disconnected") the writeback connector's "unknown" satisfied the guard, so
it skipped the wait, launched eglfs, and the viewer crash-looped on
"no screens available" / "AnthiasViewer exited before emitting D-Bus
handshake" — exactly the failure #2962 was meant to prevent. Confirmed on
multiple live pi4 on 2026.1.0 (card0-HDMI-A-1/-2 = disconnected,
card0-Writeback-1 = unknown).

Skip `*Writeback*` connectors so only real display outputs (HDMI/DSI/DP/…)
count. A genuinely headless board now waits gracefully; the bridge-"unknown"
hedge is preserved for real connectors. Verified locally for headless,
connected, and bridge-unknown layouts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from a team as a code owner June 1, 2026 11:34
@vpetersson vpetersson self-assigned this Jun 1, 2026
@vpetersson vpetersson requested a review from Copilot June 1, 2026 11:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@vpetersson vpetersson merged commit fc744c1 into master Jun 1, 2026
7 checks passed
@vpetersson vpetersson mentioned this pull request Jun 2, 2026
5 tasks
vpetersson added a commit that referenced this pull request Jun 2, 2026
- CalVer (YYYY.0M.MICRO); still June 2026, micro 0 -> 1
- Ships the QML VideoOutput presentation path (#2975), the pi2/pi3
  GStreamer HW video pipeline (#2972), and the x86 WLR_DRM_NO_ATOMIC
  display-freeze fix (#2978)
- Also picks up Pi 4 eglfs rotation (#2971, #2973), the armv7 viewer
  spawn retry (#2969), the Writeback-connector headless guard (#2968),
  and viewer log cleanups (#2977, #2979)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants