Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Linux check

on:
pull_request:
paths:
- "client/src-tauri/**"
- ".github/workflows/check.yml"
- ".github/workflows/release.yml"

permissions:
contents: read

concurrency:
group: linux-check-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
linux-client:
name: Linux client (Debian 12)
runs-on: ubuntu-24.04
container: debian:bookworm
timeout-minutes: 45
env:
DEBIAN_FRONTEND: noninteractive
CARGO_TERM_COLOR: always
steps:
- name: Install build and test dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential cmake pkg-config nasm \
libssl-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev \
libxdo-dev libpulse-dev libpipewire-0.3-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base

- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting of changed Rust files
run: |
base="origin/${GITHUB_BASE_REF}"
mapfile -t files < <(git diff --name-only --diff-filter=ACMR "${base}...HEAD" -- 'client/src-tauri/**/*.rs')
if [ "${#files[@]}" -gt 0 ]; then
rustfmt --edition 2024 --check "${files[@]}"
fi

- name: Run client unit tests
working-directory: client/src-tauri
run: cargo test --locked --lib -- --nocapture
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ jobs:
apt-get install -y --no-install-recommends \
ca-certificates curl git file build-essential cmake pkg-config nasm \
libssl-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev \
libxdo-dev libpulse-dev libpipewire-0.3-dev
libxdo-dev libpulse-dev libpipewire-0.3-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

- uses: actions/checkout@v6

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The same program is both the **host** (the device being controlled) and the **co

Every stage from capture to display is built for low latency:

- **Hardware encoding and decoding**: the host encodes on the GPU (NVENC / Quick Sync / AMF, VideoToolbox, MediaCodec) in low-latency mode without B-frames; the controller decodes on the GPU (WebCodecs / MediaCodec). Measured with a 4K screen streamed at 1080p, hardware AV1 encoding takes about 7 ms per frame (RTX graphics card)
- **Hardware encoding and decoding**: the host encodes on the GPU (Windows Media Foundation NVENC / Quick Sync / AMF, macOS VideoToolbox, Linux GStreamer VA-API / NVENC, Android MediaCodec) in low-latency mode without B-frames; the controller decodes on the GPU (WebCodecs / MediaCodec). Measured with a 4K screen streamed at 1080p, hardware AV1 encoding takes about 7 ms per frame (RTX graphics card)
- **The best format**: AV1 > HEVC > H.264, automatically picking the most efficient format both sides support; scaling and color conversion use SIMD, and all buffers are reused
- **No lag build-up**: the host limits the bytes in flight (≈ bitrate × (RTT + 50 ms)) and skips to the latest frame on a slow network; the bitrate follows the measured queueing delay and bandwidth on every acknowledgement, backing off within a few hundred milliseconds and recovering gradually
- **Direct path**: besides the relay, the two ends punch a direct path through their NATs (on the same LAN, or whenever the NAT isn't symmetric), so video and audio stop detouring through the server; the lower-latency path is picked automatically, and if the direct path breaks the session falls back to the relay without dropping
Expand Down Expand Up @@ -55,7 +55,7 @@ See [How it works → Video](docs/architecture.md#video) for details.
|---|:-:|:-:|---|
| Windows 10 / 11 | ✅ | ✅ | Installed; for all users the host runs as a system service |
| macOS 13+ | ✅ | ✅ | The host needs the Screen & System Audio Recording and Accessibility permissions |
| Linux | ✅ | ✅ | The host supports X11 desktops only, with software encoding for now |
| Linux | ✅ | ✅ | The host supports X11 desktops only; hardware encoding via GStreamer VA-API / NVENC with OpenH264 fallback |
| Android 7+ phones / tablets | ✅ | ✅ | Can only be watched until the accessibility service is turned on; the controller connects to one device at a time |
| Android TV / Google TV | — | View only | Operated entirely with the remote |
| iOS / iPadOS 17+ | View only | ✅ | Sharing uses the system screen broadcast; iOS doesn't allow controlling the device |
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Airhand 是一个**高性能、低延迟**的远程桌面:画面用 GPU 硬件

从采集到显示,每一环都为低延迟设计:

- **硬件编解码**:被控端用 GPU 硬件编码(NVENC / Quick Sync / AMF、VideoToolbox、MediaCodec),低延迟模式、无 B 帧;控制端用 GPU 解码(WebCodecs / MediaCodec)。实测 4K 屏输出 1080p 时,硬件 AV1 编码每帧约 7 ms(RTX 显卡)
- **硬件编解码**:被控端用 GPU 硬件编码(Windows Media Foundation NVENC / Quick Sync / AMF、macOS VideoToolbox、Linux GStreamer VA-API / NVENC、Android MediaCodec),低延迟模式、无 B 帧;控制端用 GPU 解码(WebCodecs / MediaCodec)。实测 4K 屏输出 1080p 时,硬件 AV1 编码每帧约 7 ms(RTX 显卡)
- **最好的格式**:按 AV1 > HEVC > H.264 自动选用双方都支持的、压缩率最高的格式;缩放和颜色转换用 SIMD,缓冲区全部复用
- **延迟不堆积**:被控端限制在途字节(≈ 码率 ×(RTT + 50 ms)),网络慢时跳到最新一帧;码率每次确认都按量到的排队时延和带宽调整,几百毫秒内降下来,恢复后逐步回升
- **直连**:两端在中转之外打洞直连(同一个局域网、或者 NAT 不是对称型时),画面、声音不再绕道服务器;自动选延迟低的那条路,直连断了马上回到中转,会话不断
Expand Down Expand Up @@ -55,7 +55,7 @@ Airhand 是一个**高性能、低延迟**的远程桌面:画面用 GPU 硬件
|---|:-:|:-:|---|
| Windows 10 / 11 | ✅ | ✅ | 需要安装,为所有用户安装时被控端作为系统服务运行 |
| macOS 13+ | ✅ | ✅ | 被控端需要“屏幕与系统录音”和“辅助功能”权限 |
| Linux | ✅ | ✅ | 被控端只支持 X11 桌面,目前只有软件编码 |
| Linux | ✅ | ✅ | 被控端只支持 X11 桌面,支持基于 GStreamer 的 VA-API / NVENC 硬件编码(自动回退 OpenH264) |
| Android 7+ 手机 / 平板 | ✅ | ✅ | 开启无障碍服务后才能被操作,否则只能被看;控制端同一时间连一台 |
| Android TV / Google TV | — | 只看画面 | 全部用遥控器操作 |
| iOS / iPadOS 17+ | 只能被看 | ✅ | 共享本机用系统的屏幕广播;iOS 不允许别的应用操作本机 |
Expand Down
Loading