Skip to content

Latest commit

ย 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ฅ๏ธ AndroiDisplay for Mac

Zero Lag Extended Workspace โ€” 120 FPS, 10-Bit HEVC, Full OLED Dynamic Range macOS-to-Android Display Bridge

Live Showcase License: MIT Platform: macOS Apple Silicon Refresh Rate: 120Hz Color Pipeline: 10--Bit HEVC Cost: 100% Free

Turn any Android tablet or phone into a true 120Hz, pixel-perfect secondary monitor for your Mac.
No subscriptions. No 30/60 FPS caps. Single-digit millisecond latency. Pure OLED pitch-blacks.

๐ŸŒ Live Interactive Website โ€ข ๐Ÿš€ How to Use / Controls โ€ข ๐Ÿ“– Step-by-Step Walkthrough โ€ข โšก Quick Install โ€ข ๐Ÿ“Š Comparison Matrix


โšก Quick Shortcuts


๐Ÿ’ก Why AndroiDisplay?

Proprietary tablet second-screen utilities like Duet Display and Luna Display charge recurring subscription fees ($15โ€“$50/yr), cap refresh rates at 30โ€“60 Hz, introduce noticeable input lag, and wash out blacks on high-end AMOLED screens. Apple's native Sidecar is strictly locked to iPads.

AndroiDisplay bridges Apple Silicon's hardware video encoder (hevc_videotoolbox) with Android's hardware decoder via Sunshine, Moonlight, and ADB USB reverse tetheringโ€”delivering a native, hardware-accelerated 120 FPS second-screen experience completely for free.


๐Ÿ“Š Feature Comparison Matrix

Feature AndroiDisplay Duet Display Apple Sidecar Luna Display
Cost 100% Free / Open Source $15โ€“$50 / Year Free (Apple only) $80 Hardware Dongle
Max Refresh Rate ๐Ÿš€ 120 FPS Locked 60 FPS (often drops) 60 FPS 30โ€“60 FPS
Glass-to-Glass Latency โšก <5ms (Wired USB-C) 25โ€“45 ms ~15 ms 20โ€“35 ms
Android Tablet Support โœ… Any Android Device โš ๏ธ Partial โŒ iPad Only โŒ iPad / Mac Only
OLED Pure Blacks (#000000) โœ… Full Range [0โ€“255] โŒ Washed Out Grey โš ๏ธ Scaled โŒ Washed Out
Window Persistence โœ… Yes (Virtual Canvas stays) โŒ Collapses on exit โŒ Collapses on exit โŒ Collapses on exit
HiDPI Scaling Selection โœ… 1440p / 1680p / 1920p โš ๏ธ Limited โš ๏ธ Preset โš ๏ธ Preset

๐Ÿ—๏ธ System Architecture

+-----------------------------------------------------------------------------------+
|                                  macOS Host (Apple Silicon)                       |
|                                                                                   |
|  +------------------------+      +--------------------+      +-----------------+  |
|  | Native Menu Bar App    | ---> | tab-ctl CLI Engine | ---> |  displayplacer  |  |
|  | (Swift / MenuBarExtra) |      | (Zsh orchestration)|      | (Layout & HiDPI)|  |
|  +------------------------+      +--------------------+      +-----------------+  |
|               |                            |                          |           |
|               v                            v                          v           |
|  +------------------------+      +--------------------+      +-----------------+  |
|  |      DeskPad.app       |      |    Sunshine Host   |      |  Apple Silicon  |  |
|  | (Headless Virtual Disp)| ---> | (ScreenCaptureKit) | ---> |  VideoToolbox   |  |
|  +------------------------+      +--------------------+      |  (10-bit HEVC)  |  |
|                                            |                 +-----------------+  |
+--------------------------------------------|--------------------------------------+
|
[USB-C ADB Reverse / LAN Stream]
Ports: 47984, 47989, 47990, 48010
|
+--------------------------------------------v--------------------------------------+
|                          Android Client Tablet / Device                           |
|                                                                                   |
|  +-----------------------------------------------------------------------------+  |
|  | Moonlight Android App (Forced HEVC, 80-100 Mbps Bitrate, 120 FPS, 16:10)    |  |
|  | AMOLED / High-Refresh Display (True Pixel-Off Blacks, Zero Letterboxing)    |  |
|  +-----------------------------------------------------------------------------+  |
+-----------------------------------------------------------------------------------+

๐ŸŽ›๏ธ Architecture & Technical Highlights

  1. Headless Virtual Display Canvas (DeskPad.app): Creates an off-screen native macOS display buffer so the OS treats your tablet as an independent physical display with its own Spaces and Mission Control.
  2. Apple Silicon VideoToolbox Hardware Encoding: Direct GPU framebuffer capture via ScreenCaptureKit, encoded into 10-bit HEVC at 120 FPS with ultra-low compute overhead.
  3. HiDPI Scaling via displayplacer: Positions the virtual canvas relative to your primary display (-width, 0) with crisp Retina scaling (1440x900, 1680x1050, or 1920x1200).
  4. ADB High-Speed Port Reversal: Automatically maps streaming ports (47984, 47989, 47990, 48010) over USB-C, ensuring single-digit millisecond latency immune to Wi-Fi congestion.
  5. Intelligent Teardown & Workspace Retention: Pausing/stopping the stream halts Sunshine and Moonlight while preserving DeskPad, preventing windows and IDEs from collapsing onto your main screen.

๐Ÿงช Tested Reference Setup (Workflow Benchmark)

This pipeline was engineered and benchmarked against the following reference hardware setup:

Component Tested Hardware / Version Role in Pipeline
Host Machine Mac Mini (Apple M4, macOS 15 Sequoia) Host workstation & VideoToolbox 10-bit encoder
Primary Display Dell P2419H (1080p @ 60Hz) Primary desktop workspace at origin: (0,0)
Client Tablet Samsung Galaxy Tab S10+ (12.4" Dynamic AMOLED 2X, 120Hz) Client display running Moonlight with zero letterboxing
Connection USB-C 3.2 Gen 2 Cable (ADB Reverse Tethered) <5ms glass-to-glass wired display transport

Note: The codebase is fully modular and compatible with any Mac (M1โ€“M4) and any Android tablet or phone.


๐Ÿ“‹ Prerequisites & Hardware

  • Mac Host: Any Apple Silicon Mac (M1, M2, M3, M4 / Pro / Max / Ultra) running macOS 13 (Ventura), 14 (Sonoma), 15 (Sequoia) or later.
  • Android Client: Any 60Hz/120Hz Android tablet or phone (e.g., Galaxy Tab S-Series, Xiaomi Pad, Lenovo Tab, Pixel Tablet, OnePlus Pad).
  • Connection: High-speed USB-C 3.2 cable (recommended for sub-5ms wired streaming) or local 5GHz/6GHz Wi-Fi network.
  • Android Client Software: Moonlight Game Streaming (Android) installed on your tablet.

๐Ÿš€ Quick Start & Installation

๐Ÿ“– Looking for full step-by-step instructions? Read the Comprehensive User & Operation Guide.

Option 1: One-Line Automatic Install

Clone and run the installer:

git clone https://github.com/abhay2008/AndroiDisplay.git
cd AndroiDisplay
./install.sh

Option 2: Build from Source with Makefile

git clone https://github.com/abhay2008/AndroiDisplay.git
cd AndroiDisplay
make
make install

๐Ÿ’ป Usage & How to Use

1. Native Menu Bar Application (AndroiDisplay)

The AndroiDisplay Status Item lives in your macOS menu bar with real-time status indication:

  • ๐Ÿ–ฅ๏ธ Status Header: Live display state & USB connection indicator.
  • ๐Ÿ“ Extend to Tablet (e2t):
    • 1440 ร— 900 (Large UI / HiDPI - Recommended)
    • 1680 ร— 1050 (Medium UI / HiDPI - Balanced)
    • 1920 ร— 1200 (Dense Workspace / HiDPI)
  • ๐Ÿชž Mirror Main Screen (m2t): Instant 120 FPS mirroring of the primary display.
  • ๐Ÿ›‘ Stop Stream (t2stop): Pauses media and halts Sunshine while keeping window arrangements intact.
  • โšก Quick Actions: Reverse ADB ports, restart Sunshine, open Web UI.
  • โš™๏ธ Preferences: Launch at Login, Auto-Detect USB daemon.

2. Command-Line Interface (tab-ctl)

# Extend display with interactive resolution selection
e2t

# Extend display with direct resolution flag
e2t -r 1440       # 1440x900 (Large UI)
e2t -r 1680       # 1680x1050 (Medium UI)
e2t -r 1920       # 1920x1200 (Dense UI)

# Mirror primary display
m2t

# Stop stream cleanly
t2stop

# Check pipeline status
tab-ctl status

# Manually reverse ADB ports
tab-ctl reverse

โš™๏ธ Moonlight Android Client Settings

For the ultimate 120 FPS experience on AMOLED tablet panels:

  1. Resolution: Match display (16:10 / 16:9) or 1440p / 1080p.
  2. Framerate: 120 FPS (or 60 FPS).
  3. Bitrate: 80 Mbps โ€“ 100 Mbps (Wired USB-C) or 40โ€“60 Mbps (Wi-Fi).
  4. Video Codec: Force HEVC (H.265).
  5. Stretch Video to Fit Screen: Enabled.
  6. Enable HDR: Disabled (Host 10-bit HEVC handles full OLED dynamic range natively).

๐Ÿ› ๏ธ Engineering Log & Troubleshooting

Challenge Root Cause Implemented Solution
ScreenCaptureKit Permission Error Non-sandboxed daemon lacked TCC screen recording entitlements. Granted Screen Recording permission to /opt/homebrew/bin/sunshine & terminal wrappers.
Dynamic Display ID Shifts macOS cycles display IDs on restart (e.g., id: 3 to id: 16), breaking static configs. Built live regex parser (tail -n 40 sunshine.log | grep "DeskPad Display") to dynamically update sunshine.conf.
OLED Washed-Out Blacks Default Rec. 601 limited color range (16โ€“235) raised shadow floor. Forced color_range = 1 (Full Range 0โ€“255), color_space = 1 (Rec. 709), and hevc_mode = 2 (10-bit).
Moonlight HDR Warning Virtual displays lack HDR10 EDID metadata. Disabled HDR toggle in Moonlight while keeping host 10-bit pipeline intact.
Window Scatter on Stop Killing virtual display destroyed framebuffer and scrambled windows. Redesigned t2stop to keep DeskPad active while stopping Sunshine and Moonlight.

For complete troubleshooting instructions, see docs/TROUBLESHOOTING.md.


๐Ÿ“š Documentation Links


๐Ÿ“„ License

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

About

Zero-lag 120FPS 10-bit HEVC macOS-to-Android display extension bridge

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages