LinuxCommandLibrary

tvservice

Control HDMI display output

SYNOPSIS

tvservice [OPTION]... [ARGUMENT]...

PARAMETERS

-s, --status
    Show the current HDMI status and detected display modes.

-p, --preferred
    Set the HDMI output to the preferred mode reported by the monitor's EDID.

-m, --modes [DMT|CEA]
    List all supported HDMI modes. Can filter by DMT (Display Monitor Timings) or CEA (Consumer Electronics Association) standards.

-e, --explicit="DMT | CEA "
    Force a specific HDMI mode by its group (DMT/CEA) and mode number (e.g., "CEA 16" for 1920x1080 @ 60Hz).

-o, --off
    Turn off the HDMI output and disable the display signal.

-O, --on
    Turn on the HDMI output, restoring the display signal.

-c, --sdtv="PAL|NTSC"
    Switch video output to composite (SDTV), specifying PAL or NTSC standard.

--sdtv_aspect="4:3|14:9|16:9"
    Set the aspect ratio for SDTV composite output.

-d, --dumpedid
    Dump the EDID (Extended Display Identification Data) from the connected monitor to a specified file.

-v, --verbose
    Enable verbose output for more detailed information during execution.

-h, --help
    Display a help message with available options and usage information.

DESCRIPTION

tvservice is a command-line utility primarily found on Raspberry Pi devices, designed to query and control the HDMI (and composite) video output. It directly interfaces with the Broadcom VideoCore GPU firmware, allowing users to manipulate display modes, resolutions, refresh rates, and power states of the connected monitor.

It's an essential tool for headless setups, troubleshooting display issues, or forcing specific video modes that might not be automatically detected by a display. Unlike xrandr, which manages X server displays, tvservice operates at a lower, hardware-firmware level, affecting the console output before any graphical environment starts. Its direct hardware access makes it powerful for precise display configuration on the Raspberry Pi platform.

CAVEATS

tvservice is specific to Raspberry Pi devices and other systems utilizing Broadcom's VideoCore GPU. It is not a standard Linux utility found on general-purpose distributions. Its functionality relies on direct interaction with the GPU firmware and hardware, making it hardware-dependent. Incorrect usage can lead to display issues, potentially requiring a reboot.

COMMON RESOLUTION CHANGE WORKFLOW

To set a specific resolution, first use tvservice -m CEA or tvservice -m DMT to identify the desired mode number. Then, apply it using sudo tvservice -e "CEA " (replace ). For example, sudo tvservice -e "CEA 16" often sets 1920x1080 @ 60Hz. It may also be necessary to update the framebuffer using sudo fbset -depth 32 and sudo fbset -virtual .

HEADLESS OPERATION AND POWER SAVING

In headless Raspberry Pi setups (without a connected monitor), tvservice -o is commonly used to turn off the HDMI output. This can help conserve power and prevent the GPU from continuously polling for a display. To re-enable the output if a monitor is connected, tvservice -p or tvservice -O can be used.

HISTORY

Developed specifically for the Raspberry Pi platform, tvservice has been a fundamental tool for controlling its unique VideoCore IV GPU's display output since the earliest models. It provides command-line control over HDMI and composite video, crucial for both basic setup and advanced display configuration in embedded or headless applications. It complements, and in some ways predates, the more recent kernel modesetting (KMS) drivers on Raspberry Pi.

SEE ALSO

Copied to clipboard