A Python wrapper for accessing DP/eDP-connected displays via AUX lines using SoC vendor-specific APIs.
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 https://github.com/bitlab-rgb/pydpaux.git
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
-
Clone the repository:
git clone https://github.com/bitlab-rgb/pydpaux.git cd pydpaux
-
Install build dependencies:
pip install build scikit-build-core pybind11
-
Build the extension:
python -m build
Or for development/editable installation:
pip install -e .
-
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("LG")
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/identifierserial: str- Display serial numberedid_size: int- Size of EDID data in bytesedid: bytes- Complete EDID data
Methods
aux_read(address: int, size: int) -> bytes- Read from AUX channelaux_write(address: int, data: bytes) -> int- Write to AUX channeli2c_read(address: int, offset: int, size: int) -> bytes- Read from I2C busi2c_write(address: int, offset: int, data: bytes) -> int- Write to I2C busrefresh_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
pypyin 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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydpaux-0.1.1.tar.gz.
File metadata
- Download URL: pydpaux-0.1.1.tar.gz
- Upload date:
- Size: 81.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7a8601aadbf4a5d0ddb7420ccc121c4349f78eb6a8c7460e56118fbedf7900f
|
|
| MD5 |
2346126d674ee1c61c5d423dfd9b8142
|
|
| BLAKE2b-256 |
24a0a42f45541f7a5c8e4466500284aed85dc4b140cbd0713beb2a954eaed374
|
File details
Details for the file pydpaux-0.1.1-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: pydpaux-0.1.1-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 107.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9c024c75586e4b3cf5e35230c4502852505c7cd1c451b8c19c893190b272971
|
|
| MD5 |
e385dd3f6da6b3d0a9eb7b25c53ff37d
|
|
| BLAKE2b-256 |
d72e7072abf41c3b6f11a32ac1a271610d0a47b976169c701152047f41543c94
|
File details
Details for the file pydpaux-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: pydpaux-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 104.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb59918fe41c79754948198e6c4ca27a614c3de5d3b814bffc670bc0e628d860
|
|
| MD5 |
63ebc719d7880d301ace9b2bee5dfe1d
|
|
| BLAKE2b-256 |
6c3244f2b6c7462eb8016a8b9a066c87d6f1be5170e3db2ca07d2b59b7f49150
|
File details
Details for the file pydpaux-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: pydpaux-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 104.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70e407aa20071c57c880f263b06c537e9e731b298ea4c304cced34659e1be276
|
|
| MD5 |
97983a30460651b4edb64062322ee4b7
|
|
| BLAKE2b-256 |
13eae08d93f5d029852d0fae7a9feaa9018c0d75dd0726d49562fb8228fc4151
|
File details
Details for the file pydpaux-0.1.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: pydpaux-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d23e4bb5957bb14f9fb0313c4c0de8a660a2e296648c11d5424375507d457ae
|
|
| MD5 |
1bdd77dc1e4c34292dac78dd34470fe9
|
|
| BLAKE2b-256 |
f1a881697be70d1fe82ffabf14f6daa9bde97ae208eb153b10a04a7d26d3769c
|
File details
Details for the file pydpaux-0.1.1-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: pydpaux-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 103.4 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a3e0192d32ed921f8db96f4d0d928ca8d20f945437ae8a5f6965ed431bb590a
|
|
| MD5 |
f91516aefecb0efe18351c09aba14c2e
|
|
| BLAKE2b-256 |
a120bb38f54f5b97daf7602fb1adb6347e4f92394a63cb0f5e3ff6238e9bf55f
|
File details
Details for the file pydpaux-0.1.1-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: pydpaux-0.1.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 103.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4045e84b79b7bbb8a0ab2f847fd1547365bd17de7381e8ea02cc67f428217f8
|
|
| MD5 |
68c6ebb7786ff2f01cf4ab7e729982ee
|
|
| BLAKE2b-256 |
7cb9ff19eb2d05c2e8e2856dea2eccdf4686883f7f4443aa82adb7846c21485f
|