cvt

displaylinux
The cvt command is one of the most frequently used commands in Linux/Unix-like operating systems. cvt The cvt command calculates VESA CVT (Coordinated Video Timing) modelines for use with X server. It generates the appropriate modeline parameters for a given resolution and refresh rate.

Quick Reference

Command Name:

cvt

Category:

display

Platform:

linux

Basic Usage:

cvt [options] [arguments]

Common Use Cases

    Syntax

    cvt width height [refresh]

    Options

    Option Description
    -v, --verbose Be more verbose
    -r, --reduced Use reduced blanking (for LCD displays)
    -h, --help Display help message

    Examples

    How to Use These Examples

    The examples below show common ways to use the cvt command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    #

    Basic Examples:

    # Generate modeline for 1920x1080 at 60Hz (default refresh rate)
    cvt 1920 1080
    # Generate modeline for 1366x768 at 60Hz cvt 1366 768 60
    # Generate modeline for 2560x1440 at 75Hz cvt 2560 1440 75

    Advanced Examples:

    # Generate modeline for 1920x1080 at 60Hz with reduced blanking (for LCD)
    cvt -r 1920 1080 60
    # Generate modeline for 3840x2160 (4K) at 30Hz cvt 3840 2160 30
    # Use cvt output with xrandr to create a new mode cvt 1920 1080 60 xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync xrandr --addmode VGA1 "1920x1080_60.00" xrandr --output VGA1 --mode "1920x1080_60.00"

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    Understanding Modelines:

    A modeline is a specific format of timing parameters that the X Window System uses to describe video modes. The cvt command simplifies the creation of these parameters based on the VESA Coordinated Video Timing standard.

    Modeline Format:

    The output of cvt is a modeline in the following format:

    Modeline "name" pixel_clock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal [flags]

    Where:

    • name: A descriptive name for the mode, typically containing resolution and refresh rate
    • pixel_clock: The pixel clock frequency in MHz
    • hdisp, hsyncstart, hsyncend, htotal: Horizontal timing parameters
    • vdisp, vsyncstart, vsyncend, vtotal: Vertical timing parameters
    • flags: Additional flags like +hsync, -hsync, +vsync, -vsync to indicate sync polarity

    Practical Usage:

    The cvt command is commonly used for:

    • Setting custom resolutions that are not automatically detected
    • Adding support for new monitors or unusual display modes
    • Creating resolutions optimized for specific displays
    • Troubleshooting display issues where standard modes don't work correctly

    Using with xrandr:

    The typical workflow is:

    1. Generate the modeline with cvt
    2. Use xrandr --newmode to create the mode
    3. Use xrandr --addmode to associate the mode with a specific output
    4. Use xrandr --output to activate the mode

    The -r (Reduced Blanking) Option:

    Reduced blanking is a technique that reduces the time spent in the blanking interval between frames, which is particularly useful for:

    • LCD displays that don't require as much blanking time as CRTs
    • Achieving higher refresh rates
    • Reducing bandwidth requirements
    • Power saving on some displays

    Limitations:

    • The cvt command only generates standard VESA CVT modelines
    • Some displays may not support all modelines even if they claim to support the resolution
    • For older CRT monitors or very specific timing requirements, the gtf command may be more appropriate
    • Some hardware may have limitations on pixel clocks or total resolution

    Related Commands

    These commands are frequently used alongside cvt or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the cvt command works in different scenarios.

    $ cvt
    View All Commands