191 Commits
Author SHA1 Message Date
VallierDevandClaude Opus 5.5 94039c092a Remote assistance (experimental) and unified host window
Like the official client: share a device ID + verification code; the other
person connects from 开始协助. Guest identity before sign-in, account identity
after (same share ID). One GTK window: 本设备 (allow switch, ID/code with copy,
verification modes incl. custom code, rotation schedule, copy & share) and
账号 (QR before sign-in, masked account + sign out after). Logged-in hosts keep
the window hidden; `uuremote-server show` / the desktop launcher opens it.
App icon and .desktop entry in contrib/desktop.

Protocol from the official Windows lite host; guest flow, wrong-code rejection,
rotation, switching off, sign-in/sign-out verified with the official Mac
viewer. Signed-in assistance from another account is not yet verified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 22:17:25 +08:00
cnetst 1b7ec0a94f Fix terminal session replies for Windows and iOS clients (#12) 2026-10-15 20:53:22 +08:00
VallierDevandClaude Opus 5.5 b5cc5ed736 Release input at desktop session boundaries; pipelined native Wayland capture
Squashed from the Codex v0.1.9 branch (reviewed):
- Clear stale input when a desktop session starts or ends and at service
  start/stop: X11 releases every pressed key/button on the display (a stuck
  XTest button blocked all clicks after a VM reboot), uinput resets its own
  devices, Wayland/portal sweep the keys this host can emit. A per-desktop
  lease stops late callbacks of an old connection from touching a new one;
  file/terminal/port-mapping peers never release desktop input.
- Native Wayland (--features wayland): double-buffered screencopy pipeline,
  viewer frame rate drives the capture rate, opt-in dma-buf (UU_WAYLAND_DMABUF=1,
  linear only, falls back to SHM). VM-measured only.
- Internal QA records (docs/validation, contrib/tests) removed from the public
  tree and ignored; they stay in the private project.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 19:45:12 +08:00
VallierDevandClaude Opus 5.5 6dda2e16a4 x264: VBV buffer of one second of bitrate so large keyframes fit (#8)
The 500 kbit cap left a 3296x2036 IDR (~130 KB at the 2M preset) no room, so
x264 emitted near-grey keyframes that sharpened over each 0.5 s GOP. Reproduced
with a static 3296x2036 desktop-like image at the 2M preset over 6 s: 250k and
1000k buffers produce grey keyframes (154/360 frames at 1000k), 2000k and 4000k
none. NVENC ull and VAAPI keep the small low-latency buffer. Thanks to
@liangjiahui01 for the analysis.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 12:12:16 +08:00
VallierDevandClaude Opus 5.5 a01fd39f06 Try NVENC only when an NVIDIA driver is present (#10); document the Hyprland screencopy frame-rate cap (#9)
ffmpeg lists h264_nvenc even without NVIDIA hardware, so AMD/Intel hosts ran a
doomed NVENC process before every libx264 stream. UU_VIDEO_ENCODER=nvenc forces it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 12:06:57 +08:00
VallierDevandClaude Opus 5.5 ebe6a7e19a Clarify mute logs with the virtual sink; document the PipeWire fallback
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 11:22:20 +08:00
VallierDevandClaude Opus 5.5 09f7169f62 Virtual audio without pactl: PipeWire-native null sink
Default Ubuntu desktops ship PipeWire/WirePlumber without pulseaudio-utils,
so the pactl-only route silently fell back to plain muting. When pactl is
missing, create the null sink with pw-cli (object.linger), switch the default
with wpctl and destroy only our own null-audio-sink node on restore;
WirePlumber moves default-following streams itself. Recovery records carry
the backend (old records default to pactl).

Verified on Ubuntu 24.04 (PipeWire 1.0.5, WirePlumber 0.4.17): a playing
stream moves to the sink and back, the monitor is readable, SIGKILL leftovers
are recovered on the next start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 11:16:11 +08:00
VallierDevandClaude Opus 5.5 9125e51350 Review fixes: tolerate a vanished default sink, recover stale virtual displays
- virtual_audio: when the previous default output no longer exists, still
  unload the null sink instead of keeping all output on it.
- uu-virtual-desktop: a socket/lock left by a dead Xvfb no longer blocks the
  service forever (Restart=always loop); a live owner is still refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 11:03:42 +08:00
VallierDev d461ef9bed Add opt-in linear KMS capture prototype with explicit security limitations 2026-10-15 10:49:12 +08:00
VallierDev f123f0ba05 Document Arch and Omarchy setup and exercise native desktop input and clipboard 2026-10-15 10:48:45 +08:00
VallierDev ac0f2bf2c6 Route muted sessions through a recoverable Pulse null sink 2026-10-15 10:47:31 +08:00
VallierDev 8a8a4c165f Add explicit VAAPI encoding with CPU fallback in both pipelines 2026-10-15 10:28:24 +08:00
VallierDevandClaude Opus 5.5 26d4812480 Headless mode, virtual desktop scripts, tool peers without a desktop
- UU_DESKTOP_BACKEND=none: host goes online without a display; terminal, file
  transfer and port mapping stay available, desktop offers are ignored.
- Tool peers (file/terminal/port mapping) get a nominal ScreenSources/CaptureChange
  and Allow permissions when no desktop is available: the port-mapping viewer
  aborts otherwise (also affected portal hosts before local consent).
- x11_engine: an explicit DISPLAY that cannot be opened no longer falls back to
  :0/:1 (would silently capture the physical screen).
- contrib/virtual-desktop: Xvfb + desktop session on the systemd user bus
  (or a private dbus-run-session bus) and a uuremote-native drop-in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 10:13:58 +08:00
VallierDevandClaude Opus 5.5 49edf1d389 uinput input backend and terminal-aware paste
- uinput.rs: kernel virtual keyboard + absolute pointer (Sunshine-style),
  physical evdev keycodes so the compositor's keysym lookup cannot drop
  shifted symbols (#3). Auto on Wayland/portal when /dev/uinput is
  accessible (udev uaccess rule), XTest kept on X11 (it suppresses
  autorepeat for held keys over latency). UU_INPUT_BACKEND=auto|uinput|native.
- Mac viewers send Cmd+V as Ctrl+V (verified: Cmd and Ctrl both arrive as
  VK_LCONTROL). In a focused X11 terminal Ctrl+V becomes Ctrl+Shift+V so it
  pastes instead of quoting the next key; Ctrl+C always interrupts (copy is
  Cmd+Shift+C). UU_TERMINAL_SHORTCUTS=0 disables.

Verified on the 3090 with the official Mac viewer: paste, interrupt,
uinput typing incl. underscores.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 09:49:03 +08:00
VallierDev 9fbe7d63c5 Recognize delayed reconnect-key refresh acknowledgements without regressing keys 2026-10-15 08:25:12 +08:00
VallierDev 3a78491f25 Close stale signaling writers even when live peer callbacks retain the sender 2026-10-15 08:25:12 +08:00
VallierDev fc8c10cde9 Refresh official room reconnect key periodically and stop obsolete signaling receivers 2026-10-15 08:25:12 +08:00
VallierDev c5aa238f73 Distinguish cloud release events and trace signaling heartbeat progress without credentials 2026-10-15 08:25:12 +08:00
ferstar 59a45e092b Address review on the XDamage capture PR
- Viewer PLI/FIR: dedupe only while an IDR is pending; drop the 1 s gap so a lost IDR cannot block recovery.
- XShm: release the local mapping on every attach failure; mark the segment for removal in all cases.
- Damage events no longer defer an overdue capture.
- After idle, the next tick is one frame after now instead of now.
2026-10-15 08:22:14 +08:00
ferstar a870f7d041 Limit viewer keyframe requests to one per second and none while one is pending
Accepted PLI/FIR feedback now goes through KeyframeGate: at most one request per
second, and none while the previous request still waits for the encoder.
2026-10-15 08:22:14 +08:00
ferstar 367be30a0f Capture only changed frames with XDamage on the in-process path
The in-process encoder can now capture through XShm and XDamage in pure Rust
(x11rb) instead of libav's x11grab. Damage marks the picture dirty; a dirty
picture is captured and encoded on a fixed frame tick so the stream keeps a
steady cadence. An idle screen sends a keepalive every 40-67 ms (15-25 fps,
random) so the viewer does not treat a static desktop as stalled.

- src/damage_capture.rs: XDamage NonEmpty reports and XShm copy-out
- src/inproc_encoder.rs: run_damage loop; x11grab stays as the fallback
- UU_CAPTURE=grab forces the x11grab path
- x11rb is an optional dependency, enabled by the inproc-av feature only

Measured on a static desktop, CPU drops from about 12% to about 1% versus
x11grab. Moving content costs about the same CPU as x11grab.
2026-10-15 08:22:14 +08:00
VallierDevandClaude Opus 5.5 ebef246486 Port mapping: advertise and accept 256 KB data-channel messages
The viewer assumed webrtc-rs's missing a=max-message-size meant 64 KB and
refused larger port-mapping frames, stalling uploads after the first
frame. Advertise 262144 in the answer sent to the viewer and vendor webrtc
with a 256 KB data-channel receive buffer (upstream u16::MAX). Verified
with the official Mac viewer: 20 MB upload 10 MB/s, 20 MB download and
5 concurrent downloads, checksums match. Docs and v0.1.4 notes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 08:14:24 +08:00
VallierDevandClaude Opus 5.5 fe991c4a7d Implement 端口映射 (port mapping) on the controlled side
Message field 27 PortMappingFrame {session_id, rule_id, stream_id, type,
payload} on FILE_DATA_CHANNEL: SYN {version, target_host, target_port} ->
TCP connect (10 s timeout) -> SYN_ACK {version, ok, error}; DATA both ways;
FIN closes; DATA_ACK ignored, matching the official PortMappingHandler.
Bounded write queue per stream, data-channel backpressure, all streams
closed with the peer. UU_PORT_MAPPING=0 disables it. Replaces the unused
port_forward.rs placeholder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 07:43:25 +08:00
ferstar 5b248c24ec Keep the 0.5 s keyframe interval on the ffmpeg child path
Only the in-process encoder answers PLI/FIR with an IDR, so the 2 s GOP is used
there alone. UU_VIDEO_GOP_SECONDS still overrides both paths.
2026-10-15 07:43:21 +08:00
ferstar e05fd44f22 Feed NVENC BGR0 capture frames directly
The GPU path skipped the CPU colour conversion to YUV420P: frames already in
BGR0 at the encoder size go straight to h264_nvenc, other sizes are scaled to
BGR0. The libx264 path keeps YUV420P. Probe: 300 frames cut CPU from ~2.4 s to
~0.8 s with the same bitrate.
2026-10-15 07:43:21 +08:00
ferstar 2355790e17 Make in-process capture and encoding an opt-in feature
Address PR review:

- The FFmpeg 6 bindings (AVChannelLayout, ffmpeg-next 6.1) do not build on
  the 22.04 runners, which ship FFmpeg 4.4. The default build no longer
  depends on libav at all, so `cargo test --locked` and the release job on
  22.04 no longer compile that code.
- The release tarball no longer links the build machine's libav SONAMEs.
  Default builds use the FFmpeg child process for video and audio again.
- `UU_FFMPEG_ROOT` / config `ffmpeg_root` now selects the child-process path
  even in an inproc-av build, so a bundled FFmpeg with working NVENC is not
  silently bypassed.

Build with `--features inproc-av` (FFmpeg 6 dev packages, Ubuntu 24.04) to
get in-process capture, encoding and Opus. CI has a test-inproc job for it.
`UU_VIDEO_PIPELINE=process` still forces the child path for video.

Probes on ros2go-gpu (440 Hz tone, 5 s):
  default (ffmpeg child): 44.0 packets/s, 132 kbps, max gap 43 ms
  inproc-av:              49.7 packets/s, 133.5 kbps, max gap 22 ms
desktop-video-probe under inproc-av with UU_FFMPEG_ROOT=/usr uses the child
path (no `pipeline=in-process` in the log); without it, in-process.
2026-10-15 07:43:21 +08:00
ferstar dd5d6a6c13 Lengthen the keyframe interval to 2 s
Static desktop, desktop-video-probe, 600 frames, NVENC CQ18, same run:

  GOP 0.5 s (30 frames)   7740 kbps   20 IDR
  GOP 2 s   (120 frames)  1908 kbps    5 IDR

A broken prediction chain now freezes until the next IDR or a PLI. The
PLI/FIR path from the previous commit makes the recovery prompt when the
viewer sends one. It has not been checked against a viewer that loses
packets, so a lossy link may freeze for up to 2 s. UU_VIDEO_GOP_SECONDS
overrides the interval for tuning.
2026-10-15 07:43:21 +08:00
ferstar 825961e1c2 Encode desktop audio in-process instead of an ffmpeg child
The Opus encoder for desktop sound now runs in this process: PulseAudio
or PipeWire-pulse monitor input, resampled to s16 stereo 48 kHz, grouped
into 20 ms libopus frames, and sent as raw Opus packets. The Ogg muxing
and OpusTags skipping from the child-process path are gone.

Probe on ros2go-gpu with a 440 Hz tone on auto_null (desktop-audio-probe,
8 s): 49.7 packets/s, 134 kbps (target 128 kbps), largest gap between
packets 22 ms. No ffmpeg child process is started while it runs.

Not covered: the full viewer session start has not been checked against a
live UU client.

Also enables ffmpeg-next's software-resampling feature.
2026-10-15 07:43:21 +08:00
ferstar bf0aa6879a Encode desktop video in-process instead of an ffmpeg child
Capture (x11grab) and H.264 encoding (h264_nvenc / libx264) now run in
this process through ffmpeg-next, with the same codec options as the old
ffmpeg CLI. Each encoder packet is one access unit, fed to the existing
DependencyGate. A PLI or FIR from the viewer forces the next frame to be
an IDR. Wayland and portal capture still use the child-process path.

Set UU_VIDEO_PIPELINE=process to fall back to the old ffmpeg child.
desktop-video-probe accepts UU_PROBE_FRAMES to lengthen the sample.

Measured with desktop-video-probe on ros2go-gpu (RTX 4090 D, Xvfb
1920x1080 @60fps, 600 frames, mostly static desktop). CPU is the sum of
the probe process and its children, sampled from /proc once per second.
Probe only: no WebRTC send, no audio.

  encoder     pipeline     CPU (%)    wall (s)   bitrate (kbps)
  nvenc       process      ~138       10.17      5356
  nvenc       in-process   ~43        10.34      5176
  libx264     process      ~135       10.09      5073
  libx264     in-process   ~72        10.08      4986

All four outputs decode without errors and start with an IDR.

Not covered: audio still runs its own ffmpeg child (src/audio.rs), PLI to
IDR has not been checked against a live viewer, and the CI jobs need the
libav*-dev and libclang-dev packages (added to ci.yml, release.yml,
AGENTS.md and the READMEs).
2026-10-15 07:43:21 +08:00
BLACKIELF 078ca026a5 Fix encoder task ordering during desktop settings changes 2026-10-15 06:56:38 +08:00
VallierDevandClaude Opus 5.5 1a3348dfe9 Portal: keep the first valid frame on a fresh session (#2); CI builds wayland,portal
A new portal session started with was_locked=true, so the first unlocked
capture reset the cached frame. A static desktop delivers no new PipeWire
frame, so the viewer stayed black until something redrew. Only an observed
lock (or a closed stream) now discards the cached frame; an unknown lock
state shows a blank frame without clearing it.

CI now also builds and tests --features wayland,portal on ubuntu-24.04.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 02:45:47 +08:00
VallierDev 2ab33b88f0 Log only room-token remaining lifetime to diagnose cloud release timing 2026-10-15 02:10:59 +08:00
VallierDev 66c8bb3249 Preserve granted clipboard capability across locked-session handshake and test closed state 2026-10-15 02:10:59 +08:00
VallierDev a18a69c19e Wait for GNOME portal recovery before deciding clipboard availability 2026-10-15 02:10:59 +08:00
VallierDev 050b8710a8 Fix GNOME fractional-scale absolute pointer coordinates and add precise GTK target probe 2026-10-15 02:10:59 +08:00
VallierDev 7e334bfe69 Separate portal input audit budgets and count native GTK button delivery 2026-10-15 02:10:59 +08:00
VallierDevandClaude Opus 5.5 f3614f243a Release v0.1.1
Version 0.1.1 with release notes; the start-up log reports the package
version instead of a hard-coded v1.0.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 00:01:37 +08:00
VallierDevandClaude Opus 5.5 c99a587afc Reject unknown arguments instead of starting a second host
Any unrecognized first argument fell through to the server start-up, so a
mistyped or missing subcommand launched a second full host next to the
running service. Print usage and exit 2; help/-h/--help print usage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:59:04 +08:00
VallierDevandClaude Opus 5.5 d93e42340d Add CI and tag-triggered release workflows, v0.1.0 notes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:53:16 +08:00
VallierDev f6882d333d Add bounded portal input outcome and failure diagnostics 2026-10-14 23:53:16 +08:00
VallierDevandClaude Opus 5.5 502635b156 Initial import of uu-remote-linux
Unofficial Linux host for NetEase UU Remote: X11 (production-tested on
GNOME/Ubuntu 24.04), experimental Wayland (Hyprland) and portal
(GNOME/KDE) backends; video, input, clipboard, file transfer, terminal,
sound, quality/fps/resolution settings, lock/unlock and system actions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:53:16 +08:00