This article has been fully updated to cover the latest Raspberry Pi models (including the Raspberry Pi 5) and Raspberry Pi OS versions (Bookworm and Trixie as of late 2025). We preserve the original tutorials for older models and Raspberry Pi OS versions (pre-Bookworm, e.g., Bullseye and earlier) while adding modern methods. Many legacy commands (like tvservice and vcgencmd display_power) no longer work in Bookworm/Trixie due to the switch to the full KMS driver and Wayland.

Introduction to HDMI on Raspberry Pi
The HDMI (High-Definition Multimedia Interface) port transmits both high-definition digital video and audio over a single cable. On Raspberry Pi, it is the primary output for screens and supports multi-channel audio (up to Dolby Digital/DTS passthrough on compatible displays).

HDMI Ports by Model
| Model | HDMI Ports | Connector Type | Max Single Display | Dual Display Support |
|---|---|---|---|---|
| Raspberry Pi 1/2/3/Zero | 1 | Full-size or Mini | 1080p60 | N/A |
| Raspberry Pi 4 | 2 | Micro-HDMI (Type D) | 4K60 (HDMI0 only) | Dual 4K30 or 4K60 + 1080p |
| Raspberry Pi 5 | 2 | Micro-HDMI (Type D) | Dual 4K60 | Dual 4K60 (native, no config needed) |
Choosing a Quality HDMI Cable
Always use high-quality, certified HDMI cables. Cheap cables may have incomplete wiring (missing pins for CEC or hotplug), causing no signal, no audio, or unreliable connections.

For Raspberry Pi 4/5: Use micro-HDMI to full-size HDMI cables (official Raspberry Pi cables recommended).
Connecting the Raspberry Pi to an HDMI Screen
Important (All Models): Connect the HDMI cable and power on the display before booting the Raspberry Pi. Older models (Pi 1–4 with legacy driver) often disable HDMI output if no display is detected at boot.
In modern Raspberry Pi OS (Bookworm/Trixie), hotplug detection is better, but connecting first is still recommended for reliable EDID reading.
Forcing HDMI Output (Hotplug Simulation)
Legacy Method (Pre-Bookworm OS, e.g., Bullseye and earlier): Edit /boot/config.txt:
sudo nano /boot/config.txt
Add:
hdmi_force_hotplug=1
Save and reboot. This forces HDMI output even if no display is detected at boot.
Modern Method (Bookworm/Trixie): The above setting is ignored (legacy). The KMS driver handles detection better, but if issues persist, ensure the display is connected at boot or use graphical tools.
Using HDMI-to-VGA Adapters or Projectors
Active HDMI-to-VGA adapters (with external power) can work, but many cheap ones do not properly pass EDID data, leading to no signal or wrong resolution. Prefer native HDMI displays.
For DVI monitors: Use a simple HDMI-to-DVI cable (video only, no audio).
Enabling/Disabling HDMI Output During Operation
Legacy Method (Pre-Bookworm – using firmware tools): These commands work on older OS with the legacy driver:
- Turn off HDMI: vcgencmd display_power 0
- Turn on HDMI: vcgencmd display_power 1
- Preferred on + switch to GUI: /opt/vc/bin/tvservice -p followed by sudo chvt 6 then sudo chvt 7
- Switch to console: /opt/vc/bin/tvservice -p followed by sudo chvt 2 then sudo chvt 1
- Fully disable: /opt/vc/bin/tvservice -o
- Check status: /opt/vc/bin/tvservice -s
Modern Method (Bookworm/Trixie – Wayland/KMS): Legacy tools like tvservice and vcgencmd display_power are deprecated and do not work. Use:
xrandr --output HDMI-A-1 --auto # Enable/turn on
xrandr --output HDMI-A-1 --off # Disable/turn off
Or graphically via Control Centre.
Preventing Monitor Standby on HDMI
Older displays may go into standby if no signal changes. In modern OS, use the graphical Control Centre > Power to disable screen blanking, or set via xset commands in scripts.
Setting Screen Resolution
The Pi automatically detects the best resolution via EDID.
Graphical (Recommended – All Modern Desktop Versions): Open Control Centre (Raspberry Pi menu > Preferences > Control Centre > Screens) and select resolution.
Legacy config.txt Method (Still works as fallback on all versions): Edit /boot/firmware/config.txt (Bookworm+) or /boot/config.txt (older):
hdmi_group=1 # 1=CEA (TVs), 2=DMT (monitors)
hdmi_mode=16 # Example: 1080p60; full list in official docs
Modern Command Line (Wayland): Install wlr-randr if needed:
sudo apt install wlr-randr
wlr-randr --output HDMI-A-1 --mode 1920x1080@60Hz
4K Resolution Support
Older Models (Pi 4 and earlier): 4K possible but limited (e.g., 4K60 only on HDMI0 with hdmi_enable_4kp60=1 in config.txt).
Raspberry Pi 5: Native dual 4K60 support on both ports – no extra configuration needed.
For the most accurate and up-to-date details, refer to the official Raspberry Pi documentation: https://www.raspberrypi.com/documentation/
Leave a Reply