X11 renders fine but HDMI stays black - Pi Zero W + DietPi

Hey everyone! Been stuck on this weird one and would love some help.

TL;DR: My app (and even xeyes) renders perfectly in X, confirmed via scrot over SSH but the HDMI output is just black. Console works fine before X starts.

Setup

  • Raspberry Pi Zero W, DietPi v10.0.1, kernel 6.12.62+rpt-rpi-v6

  • Monitor: Generic 10 inch screen (1280x800 native, HDMI)

  • dtoverlay=vc4-kms-v3d,noaudio, gpu_mem=16, hdmi_force_hotplug=1

  • X started via xinit from a systemd service

What works

  • Console/TTY on HDMI: perfectly fine

  • glxinfo: OpenGL 2.1, direct rendering, VC4 V3D 2.1

  • scrot: captures fully rendered UI with correct live clock

  • Xorg log: Output HDMI-1 connected, using initial mode 1280x800, no errors

Suspicious log

Xorg repeats this every second:

(WW) EDID timing clock 148.50 exceeds claimed max 145MHz, fixing

Service & script

Btw the exact same script and the service works on Raspberry Pi 3,4,5 and Zero 2 perfectly

[Unit]
Description=QR Generator Service
After=network-online.target
Requires=network-online.target
[Service]
Type=simple
User=root
EnvironmentFile=/etc/secrets.conf
StandardInput=tty
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
ExecStart=/usr/bin/xinit /usr/local/bin/qr-baslat.sh -- :0 vt7 -s 0 -dpms -nocursor
Restart=always
WorkingDirectory=/
StandardOutput=journal
[Install]
WantedBy=multi-user.target
#!/bin/bash
# Disable screensaver/blanking
xset -dpms 2>/dev/null
xset s off 2>/dev/null
xset s noblank 2>/dev/null
# Window manager (no title bars for kiosk mode)
matchbox-window-manager -use_titlebar no &
# Wait for WM to settle
sleep 2
# Start the app
export FYNE_SCALE=1.3
exec /v0.1.7

What I’ve tried (all same result: black HDMI)

  • Both vc4-kms-v3d and vc4-fkms-v3d

  • Software rendering with LIBGL_ALWAYS_SOFTWARE=1

  • Lower resolution via xrandr (800x600, 640x480)

  • Custom resolution via hdmi_cvt in config.txt

  • Different VTs (vt1, vt7) + chvt to force switch

  • Installed D-Bus (was missing on DietPi)

  • hdmi_force_hotplug=1

  • video=HDMI-A-1:1280x800@60 in cmdline.txt

  • xorg.conf with UseEDID false

  • Tested with plain xeyes same behavior

My theory

Console works because firmware handles HDMI with safe timings. When X does its own modeset via KMS, the timing changes and the monitor drops the signal. The EDID clock mismatch supports this.

Has anyone seen this? Would switching to Raspberry Pi OS Lite help? Any ideas on forcing X to keep the firmware’s HDMI timings?

Thanks! :folded_hands:

did you checked display settings in dietpi-config? Maybe a different setting is more effektiv.

this is missing by design as it is not needed for majority of installation. But yes for some scenario it’s needed.

Hi @Joulinar

Thanks for taking the time to reply and for the clarification regarding D-Bus.

I wanted to share a quick update: I finally managed to solve the problem by dropping X11 entirely and switching to Wayland instead. By the way, just as I suspected, I also tested the original 32-bit Raspberry Pi OS Lite image and X11 still didn’t work there either.

Not only did Wayland instantly fix the black screen and EDID timing issue, but it also freed up around an extra 40 MB of RAM.

Thanks again for the help!