🛠 Affichage numérique : kiosk double HDMI 4Kp60 sur CM4
Objectives
The CM4 is the Pi board with the most display interfaces: dual HDMI 2.0 up to 4Kp60, 2 × MIPI DSI, 2 × CSI, and parallel DPI. This tutorial builds a real digital signage client: two screens in kiosk mode, accelerated 4K video playback (hardware HEVC 4Kp60 decoding on the BCM2711), and a session that restarts automatically — the use case targeted by the launch article (“over half of the seven million Raspberry Pi units we sell each year go into industrial and commercial applications”).
Hardware
- 1 × CM4 4 or 8 GB on an IO Board (RAM matters for two 4K streams)
- 2 × HDMI 2.0 displays + Ultra High Speed certified cables (a poor-quality cable falls back to 1080p60)
- 12 V power supply on the IO Board barrel jack; passive or active cooling recommended (the module runs hotter than a Pi 4B at equal load, throttling at 85 °C)
- Raspberry Pi OS 64-bit (Bookworm, Wayland/labwc by default)
Full code
# 1) Forcer 4Kp60 sur les deux sorties (config.txt)
sudo tee -a /boot/firmware/config.txt >/dev/null <<'EOF'
hdmi_force_hotplug:0=1
hdmi_force_hotplug:1=1
hdmi_group:0=1
hdmi_mode:0=97
hdmi_group:1=1
hdmi_mode:1=97
EOF
sudo reboot
# 2) Kiosque double écran sous labwc (Wayland)
sudo apt install -y labwc chromium cage
mkdir -p ~/.config/labwc
cat > ~/.config/labwc/autostart <<'EOF'
chromium --kiosk --noerrdialogs --disable-session-crashed-bubble \
--window-position=0,0 --window-size=3840,2160 http://signage.local/ &
EOF
# 3) Session systemd qui relance le kiosque et l'écran de veille vidéo
sudo systemctl --user enable --now labwc
# 4) Test de décodage matériel 4K
mpv --hwdec=vaapi --loop http://tests.local/uhd_2160p_4k_hevc_10bit.mp4
Expected verification
wlr-randr (or xrandr --query under X11) shows HDMI-0 and HDMI-1 connected at 3840×2160 @ 60 Hz; the kiosk page occupies both screens; during 4K video, vcgencmd measure_temp rises but vcgencmd get_throttled remains at 0x0 with a heatsink; after killing a chromium process, the kiosk restarts automatically.
Common errors
- Non-certified HDMI cables: negotiation falls back to 4Kp30 or 1080p; test by swapping the two cables.
- Thermal throttling in a closed enclosure: the module “may run warmer than the Raspberry Pi 4 Model B” (less copper, no dissipating cases) — plan for a cooler.
- Forcing hotplug without a screen at boot: useful in the field, but masks a genuinely unplugged cable during diagnostics.
- Forgetting
vcgencmd get_throttledin monitoring: the undervoltage bit appears before visible crashes.
Other tutorials for this board
- Premier démarrage d'un CM4 Lite depuis la microSD de l'IO Board
- GPIO du CM4 : comprendre les banks 1,8 V / 3,3 V avant de câbler
- Basculer le Wi-Fi du CM4 sur l'antenne externe U.FL (dtparam=ant2)
- Bootloader EEPROM du CM4 : maîtriser BOOT_ORDER via usbboot
- Ajouter une RTC au CM4 (PCF8523 sur I2C1 via dt-blob)
- Son sur CM4 : DAC I2S/PCM (PCM5102) sans prise jack
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash