Skip to main content

A python wrapper to access DP/eDP-connected display via aux lines.

Project description

pyDpaux

A Python wrapper for accessing DP/eDP-connected displays via AUX lines using SoC vendor-specific APIs.

Overview

pyDpaux provides a high-level Python interface to interact with DisplayPort-connected displays through the AUX protocol. It enables reading EDID data, performing I2C communication, and accessing DPCD (DisplayPort Configuration Data) registers.

Currently, only Intel IGCL (Intel Graphics Control Library) API on Windows is implemented. Support for other platforms and vendors is planned. Contributions are welcome!

License: MIT

System Requirements

  • Processor: 12th generation (or later) Intel Core processors
  • Operating System: Windows 10 or later
  • Python: 3.9 or later
  • Permissions: Administrator/elevated privileges required for AUX / I2C Write operations

Key Features

  • Display Discovery: Enumerate all connected DP/eDP displays
  • Display Search: Find displays by partial name matching
  • EDID Access: Read and parse Extended Display Identification Data
  • AUX Channel Communication: Direct read/write access to DisplayPort AUX channels
  • I2C Bus Access: Read/write data via AUX-OVER-I2C protocol
  • DPCD Support: Access DisplayPort Configuration Data registers
  • Display Properties: Query display name, serial number, and metadata

Installation

From PyPI

pip install pydpaux

From Source

Clone the repository and install in development mode:

git clone <repository-url>
cd pydpaux
pip install .

Building from Source

Prerequisites

  • Python 3.9+ with development headers
  • Microsoft Visual C++ Build Tools or Visual Studio 2015 or later (for C++ compilation)
  • CMake 3.15 or later
  • Git

Build Instructions

  1. Clone the repository:

    git clone <repository-url>
    cd pydpaux
    
  2. Install build dependencies:

    pip install build scikit-build-core pybind11
    
  3. Build the extension:

    python -m build
    

    Or for development/editable installation:

    pip install -e .
    
  4. Verify installation:

    python -c "import pydpaux; print(pydpaux.__version__)"
    

Quick Start

Basic Usage

Here's a simple example to discover and interact with displays:

import pydpaux

# Get all connected displays
displays = pydpaux.get_displays()

if displays:
    display = displays[0]
    print(f"Found display: {display.name}")
    print(f"Serial: {display.serial}")
    print(f"EDID Size: {display.edid_size} bytes")
else:
    print("No displays found")

Finding a Specific Display

import pydpaux

# Find a display by partial name match
display = pydpaux.find_display_by_name("HDMI")

if display:
    print(f"Found: {display.name}")
else:
    print("No matching display found")

Reading EDID Data

import pydpaux

display = pydpaux.get_displays()[0]

# Read EDID via I2C (first 8 bytes)
edid_header = display.i2c_read(0xa0, 0x00, 8)
print("EDID Header:", ", ".join(f"0x{b:02x}" for b in edid_header))

# Access complete EDID
full_edid = display.edid
print(f"Full EDID size: {len(full_edid)} bytes")

Reading DPCD Registers

import pydpaux

display = pydpaux.get_displays()[0]

# Read individual DPCD registers
print("Reading DPCD registers:")
for addr in [0x00, 0x01, 0x02, 0x03, 0x0C, 0x22, 0x101]:
    value = display.aux_read(addr, 1)[0]
    print(f"  0x{addr:04x}: 0x{value:02x}")

Writing to I2C Bus

import pydpaux

display = pydpaux.get_displays()[0]

# Write data to I2C device at address 0x6e, offset 0x51
data = bytes([0x82, 0x01, 0x10, 0xAC])
try:
    result = display.i2c_write(0x6e, 0x51, data)
    if result == 0:
        print("Write successful")
    else:
        print(f"Write failed with code: 0x{result:08x}")
except PermissionError:
    print("Error: Insufficient permissions. Please run with elevated privileges.")
except RuntimeError as e:
    print(f"Error: {e}")

Complete Example Script

For a comprehensive example, see test/test.py:

import pydpaux
import sys

# Find display by name (if provided as argument) or use first available
name = sys.argv[1] if len(sys.argv) > 1 else ""

if name:
    display = pydpaux.find_display_by_name(name)
    if not display:
        print(f"No display named {name}")
        exit()
else:
    displays = pydpaux.get_displays()
    if not displays:
        print("No display found")
        exit()
    display = displays[0]

print(f"Found display: {display.name}")

# Read EDID via I2C
print("\nTest EDID read with i2c_read():")
edid_data = display.i2c_read(0xa0, 0x00, 8)
print(", ".join(map(lambda x: f'0x{x:02x}', edid_data)))

# Read DPCD registers
print("\nTest DPCD read with aux_read():")
for addr in [0x00, 0x01, 0x02, 0x03, 0x0C, 0x22, 0x101]:
    value = display.aux_read(addr, 1)[0]
    print(f"0x{addr:04x}: 0x{value:02x}")

API Reference

Module Functions

get_displays() -> List[Display]

Get all connected DP/eDP displays.

Returns: List of Display objects

find_display_by_name(keyword: str) -> Display | None

Find a display by partial name match (case-sensitive).

Parameters:

  • keyword - Search keyword to match in display names

Returns: First matching Display object or None

Display Class

Properties

  • name: str - Display name/identifier
  • serial: str - Display serial number
  • edid_size: int - Size of EDID data in bytes
  • edid: bytes - Complete EDID data

Methods

  • aux_read(address: int, size: int) -> bytes - Read from AUX channel
  • aux_write(address: int, data: bytes) -> int - Write to AUX channel
  • i2c_read(address: int, offset: int, size: int) -> bytes - Read from I2C bus
  • i2c_write(address: int, offset: int, data: bytes) -> int - Write to I2C bus
  • refresh_handle() -> int - Refresh display output handle

All methods may raise:

  • PermissionError - If insufficient privileges (requires administrator mode)
  • RuntimeError - If the operation fails

Troubleshooting

"PermissionError: Insufficient permission"

This error indicates that administrator/elevated privileges are required. Run your Python script or terminal with administrator privileges:

  • Command Prompt: Right-click and select "Run as administrator"
  • PowerShell: Right-click and select "Run as administrator"
  • Or use pypy in administrator mode

"No display found"

  • Verify that your display is connected via DisplayPort or eDP
  • Check that your system has a 12th-gen or later Intel Core processor
  • Some systems may have DisplayPort functionality disabled in BIOS

AUX/I2C operations failing with RuntimeError

  • Ensure you have a supported Intel GPU with IGCL API support
  • Verify display connection is stable
  • Try calling refresh_handle() to update the display handle

Contributing

Contributions are welcome! Areas for improvement include:

  • Support for other platforms (Linux, macOS)
  • Support for other GPU vendors (AMD, NVIDIA)
  • Additional display control functionality
  • Bug reports and fixes

Supported Platforms

Platform Status GPU Support
Windows 10+ ✅ Supported Intel IGCL API (12th gen+)
Linux 📋 Planned -
macOS 📋 Planned -

Resources

License

This project is licensed under the MIT License. See LICENSE file for details.

Citation

If you use pyDpaux in your research or project, please cite it as:

pyDpaux - Python DisplayPort AUX Access Wrapper
https://github.com/<username>/pydpaux

Support

For issues, questions, or suggestions:

Disclaimer

This software provides direct access to display hardware interfaces. Improper use may affect display functionality. Use at your own risk and always test in a controlled environment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydpaux-0.1.0.tar.gz (80.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pydpaux-0.1.0-cp314-cp314-win_amd64.whl (108.0 kB view details)

Uploaded CPython 3.14Windows x86-64

pydpaux-0.1.0-cp313-cp313-win_amd64.whl (104.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pydpaux-0.1.0-cp312-cp312-win_amd64.whl (104.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pydpaux-0.1.0-cp311-cp311-win_amd64.whl (104.1 kB view details)

Uploaded CPython 3.11Windows x86-64

pydpaux-0.1.0-cp310-cp310-win_amd64.whl (103.5 kB view details)

Uploaded CPython 3.10Windows x86-64

pydpaux-0.1.0-cp39-cp39-win_amd64.whl (103.3 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file pydpaux-0.1.0.tar.gz.

File metadata

  • Download URL: pydpaux-0.1.0.tar.gz
  • Upload date:
  • Size: 80.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 472bfd6b4022f605acb2748b6d86f9718d94b69e4896a45ea93a320cc94f93af
MD5 6977925b462e00794d5789c0dd1c4f3b
BLAKE2b-256 97ed7344d14727206de24c903531901942767c29b066e43dfd9b1adb23f41c9a

See more details on using hashes here.

File details

Details for the file pydpaux-0.1.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pydpaux-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0057864feea933268d8a5a5db969e217c6078aba1ae600af5b7bd8401a2426c6
MD5 cbd0acd5a3c3d0035f2d4cdc5ccb608c
BLAKE2b-256 4acadd489c6e13abbe4c8be37cf37ddc8b07892fd8ac1817fa7ebd7e6b2a7169

See more details on using hashes here.

File details

Details for the file pydpaux-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pydpaux-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 104.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0d65a632ff7fafc2e5711a916b0d02e49ffb96cc07fcea6581957697ed8ac461
MD5 36413fe2e8e87b9668048a890b975b74
BLAKE2b-256 201e7c37f77d1afb2edfed3ac4916a222a6f2472a7594a418c96400362151ff5

See more details on using hashes here.

File details

Details for the file pydpaux-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pydpaux-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 104.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cfb2825c8b6bed510f55fe3c60b289ea7ae4c0247e6c755b2dd206c13cc35b69
MD5 2fcdea54629d3a7d4aa7c727ee41511f
BLAKE2b-256 460e61971cbbf26e4f8f5076d3db845d474413ec5f32bb679f8ac33eccb14b9f

See more details on using hashes here.

File details

Details for the file pydpaux-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pydpaux-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 104.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 71ce26e6e01c71ab6736102aef0520029aab706153a5b31f6f0501a22d5e4423
MD5 1f9705a22351e51334f741bdeb3697f6
BLAKE2b-256 867afdb491d8a88351239896b16e8394b0cf94597ef7f24894fef1e8e03664cc

See more details on using hashes here.

File details

Details for the file pydpaux-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pydpaux-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 103.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cb2fa6b958bfa478c81f284f0a52165a522a9a2b10c9decf6b938f6e731c9e6e
MD5 fbd3d4d49c48d34710a2e0829f68876d
BLAKE2b-256 3abce1ce16bf5f8d2e16e135ee5edef42e855c80296c91cb238bf1ee0ed03ffb

See more details on using hashes here.

File details

Details for the file pydpaux-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pydpaux-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 103.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydpaux-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cf55cbf866a8f10655ae46732693a5d01b302d0669572a6c14910be2a12ede43
MD5 431d71d68f10709f21c470f950cccac1
BLAKE2b-256 a23b76dc38dc6b0d73cffdecc25f745473e465b7717eed64cd86e90c645cd34c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page