Skip to content

oberdfr/gtk4-edid-editor

Repository files navigation

EDID Editor

A comprehensive GTK4-based EDID (Extended Display Identification Data) editor for Linux. This application allows you to view, edit, and validate EDID data with a user-friendly graphical interface.

Features

Complete EDID Support

  • Base Block Editing: Manufacturer info, display parameters, color characteristics
  • CTA-861 Extension Blocks: Audio/video capabilities, VIC codes, data blocks
  • DisplayID Extension Blocks: Advanced display capabilities
  • Block Map Support: Multi-block EDID structures

Advanced Editing Capabilities

  • Hierarchical Tree View: Navigate EDID structure easily
  • Field-Specific Editors: Specialized widgets for different data types
  • Real-time Validation: Automatic checksum calculation and validation
  • Hex Dump View: Live preview of binary data with byte highlighting
  • Timing Editor: Advanced detailed timing descriptor editor with calculated refresh rates

File Operations

  • Binary I/O: Load/save raw EDID binary files (.edid, .bin)
  • Hex Import/Export: Copy/paste hex data for easy sharing
  • Multiple Format Support: Works with various EDID file formats

Validation & Tools

  • Comprehensive Validation: Check EDID compliance and detect errors
  • Checksum Management: Automatic checksum calculation and verification
  • Live Updates: Real-time preview of changes

Installation

Prerequisites

  • GTK4 development libraries
  • GCC with C++17 support
  • Make

On Arch Linux / CachyOS:

sudo pacman -S gtk4 gcc make

On Ubuntu/Debian:

sudo apt-get install libgtk-4-dev build-essential

On Fedora:

sudo dnf install gtk4-devel gcc-c++ make

Building from Source

# Clone or download the source files
cd pythongtk

# Build the application
make

# Run the application
make run

# Install system-wide (optional)
sudo make install

Usage

Starting the Application

# If installed system-wide
edid_editor

# If running from build directory
./edid_editor

Basic Workflow

  1. Load an EDID:

    • File → Open to load a binary EDID file
    • File → Import from Hex to paste hex data
  2. Navigate the Structure:

    • Use the tree view on the left to explore EDID blocks and fields
    • Click on any field to see its details and edit it
  3. Edit Fields:

    • Select a field in the tree view
    • Use the property editor on the right to modify values
    • Changes are applied immediately with automatic checksum updates
  4. Monitor Changes:

    • Watch the hex dump view (bottom right) for live binary representation
    • Selected fields are highlighted in the hex view
    • Validation status is shown in real-time
  5. Save Your Work:

    • File → Save to update the current file
    • File → Save As to create a new file
    • File → Export to Hex to get hex representation

Advanced Features

Detailed Timing Editor

When editing timing descriptors, you get a specialized editor with:

  • Individual fields for all timing parameters
  • Real-time refresh rate calculation
  • Proper bit-field encoding/decoding
  • Validation of timing values

Validation System

The built-in validator checks for:

  • Proper EDID header format
  • Correct checksums for all blocks
  • Valid field ranges and dependencies
  • Standard compliance issues

Field Types

The editor supports various field types:

  • Numeric Fields: 8-bit, 16-bit values with hex display
  • Enumeration Fields: Predefined value lists with descriptions
  • Bitfield Fields: Individual bit editing with labels
  • Manufacturer ID: 3-character PNP ID encoding
  • Timing Descriptors: Complex 18-byte timing structures

File Formats

Supported Input Formats

  • Binary EDID: Raw binary files (_.edid, _.bin)
  • Hex Text: Plain text hexadecimal representation
  • Any extension: The editor auto-detects format by content

EDID Structure Support

  • Base Block: 128-byte EDID base block (always present)
  • CTA-861: Consumer Technology Association extension
  • DisplayID: VESA DisplayID extension blocks
  • Block Maps: Support for >2 extension blocks
  • Unknown Extensions: Basic byte-level editing for unsupported blocks

Architecture

Design Pattern

The application uses a Model-View-Controller (MVC) architecture:

  • Model: EdidData class manages the raw EDID data and structure
  • View: GTK4 widgets for tree view, property editor, and hex dump
  • Controller: Field-specific editors handle user interactions

Key Components

EdidData

Central data container that:

  • Parses EDID binary data into structured blocks
  • Manages field definitions and access
  • Handles validation and checksum calculation
  • Provides serialization to/from various formats

EdidBlock

Represents individual EDID blocks:

  • Base block (manufacturer, display parameters)
  • CTA-861 extension (audio/video capabilities)
  • DisplayID extension (advanced features)

EdidField

Type-safe field accessors:

  • Handles different data types (uint8, uint16, enums, etc.)
  • Creates appropriate GUI editors
  • Manages value validation and encoding

Widget System

Custom GTK4 widgets provide specialized functionality:

  • PropertyEditor: Dynamic form generation for field editing
  • EdidTreeView: Hierarchical display of EDID structure
  • HexDumpView: Live hex representation with highlighting

Development

Building for Debug

make debug

Code Structure

edid_editor.hpp      - Main header with class definitions
edid_parser.cpp      - EDID parsing and field implementations
edid_gui.cpp         - GTK4 widget implementations
timing_editor.cpp    - Specialized timing descriptor editor
edid_main.cpp        - Main application window and entry point

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly with various EDID files
  5. Submit a pull request

Testing

# Create sample EDID files for testing
make samples

# Test with the generated samples
./edid_editor samples/sample_1080p.edid

Troubleshooting

Common Issues

Application won't start:

  • Ensure GTK4 is properly installed
  • Check that all dependencies are met
  • Run from terminal to see error messages

Can't load EDID file:

  • Verify file is valid EDID format (multiple of 128 bytes)
  • Check file permissions
  • Try importing as hex if binary load fails

Validation errors:

  • EDID may have pre-existing issues
  • Some fields may be vendor-specific
  • Use the validation tool to identify specific problems

Build errors:

  • Ensure GTK4 development packages are installed
  • Check that C++17 compiler is available
  • Verify pkg-config can find GTK4

Performance Notes

  • Large EDID files (>4 blocks) may load slower
  • Real-time validation can be disabled for better performance
  • Hex view updates are optimized for typical EDID sizes

License

This project is licensed under the MIT License. See the license headers in source files for details.

Acknowledgments

  • Based on the edid-decode project by Hans Verkuil
  • Uses GTK4 for the graphical interface
  • Inspired by the need for better EDID editing tools on Linux

Technical Details

EDID Structure Overview

EDID data consists of:

  1. Base Block (128 bytes): Essential display information
  2. Extension Blocks (128 bytes each): Additional capabilities
  3. Checksums: Each block has a checksum for integrity

Supported Extensions

  • CTA-861: Audio/video capabilities, VIC codes, speaker allocation
  • DisplayID: Tiled displays, color characteristics, timing ranges
  • Block Map: Support for >253 extension blocks

Field Types Implemented

  • UInt8Field: Single byte values with validation
  • UInt16Field: Two-byte values (little/big endian)
  • EnumField: Predefined value lists
  • BitfieldField: Individual bit control
  • ManufacturerIdField: PNP ID encoding/decoding
  • TimingField: Complex timing descriptor editing

This comprehensive EDID editor provides professional-grade EDID editing capabilities with an intuitive GTK4 interface, making it suitable for display engineers, system integrators, and anyone working with display technology.

About

A simple work-in-progress GTK4 edid editor for linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors