XDisplay is a high-performance cross-platform virtual display solution designed for extremely low-latency desktop extension to Android devices.
graph TD
subgraph Host [Linux Host - Rust]
EVDI[EVDI Kernel Module] --> |Virtual Display| DRM[DRM Device]
DRM --> Capture[Screen Capture]
Capture --> Encoder[H.264 Hardware Encoder]
Encoder --> Transport[UDP/USB Transport]
end
subgraph Client [Android Client - Kotlin/Rust]
Transport --> |Network| Reassembly[Native Reassembly]
Reassembly --> MediaCodec[NDK MediaCodec]
MediaCodec --> Surface[Surface Rendering]
end
Input[Touch/Keyboard] -.-> |Feedback Loop| Transport
XDisplay utilizes the EVDI (Extensible Virtual Display Interface) kernel module to create virtual DRM devices. This allows Linux to treat the Android device as a real second monitor, complete with resolution switching and workspace management.
The host application captures frames from the EVDI buffer and pipes them through xd-encoder. It targets H.264 (AVC) exclusively to ensure compatibility with Android hardware decoders. Raw pixel streaming is avoided to preserve bandwidth and reduce jitter.
- UDP: Primary wireless transport. Implements a custom fragmentation and reassembly protocol optimized for real-time video (drops old frames instead of retrying).
- USB (ADB): High-stability wired transport. Uses ADB port forwarding to tunnel traffic with minimal overhead.
The client uses a hybrid architecture:
- Rust (NDK): Handles high-frequency network packets and interacts directly with the Android
MediaCodecC API. This bypasses Java overhead for frame queuing, achieving sub-16ms latency. - Kotlin (Compose): Manages the discovery UI, connection state, and provides a Java-based decoder fallback for maximum compatibility.
- All communication is designed for local networks.
- No cloud dependencies; data stays on your local hardware.
- Source code is open under AGPLv3.