The 100-500 kbit default keeps NVENC keyframes inside the buffer, but VAAPI quantizes a
whole desktop keyframe when the buffer is that small: on a 2560x1440 H.264 VAAPI stream
capped at 30 Mbit/s the first IDR measured 59,910 bytes and the picture blurred once per
GOP before sharpening back.
UU_VAAPI_BUFFER_MS (10-1000 ms, VAAPI only) sizes the buffer as bitrate x ms/1000. With
250 ms on the same input the first IDR measured 142,397 bytes and the worst-frame Y-SSIM
over 180 static frames went from 0.9492 to 0.9933, with no rise in average bitrate.
Opt-in: unset, out of range or unparsable keeps the old buffer.
Assisted-by: DeepSeek V4.1 Flash-1017
Host: accept the official text_input {content} action on any channel and type it on
X11 via spare-keycode Unicode keysyms (verified with xev); log non-CONTROL JSON
action names. Viewer: Windows-type hosts get only the case-10 text change (a rich
format list overwrote it and was never rendered), Mac gets only the rich offer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Log unsupported CONTROL input actions (names only) and the server NumLock
state for numpad keys; skip the SDL window test on macOS (main-thread SDL).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The official Mac host answers check_env on the BINARY terminal channel next
to TERM frames; the viewer parsed it as a TERM frame and closed. Verified
live: Mac host terminal opens and echoes input.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Mac host offers pasteboard text as format 0 "public.utf8-plain-text"
(UTF-8), not CF_UNICODETEXT, so the viewer never requested it. Accept and
request that format, and offer it next to CF_UNICODETEXT from the viewer.
Host-side offers to official clients are unchanged. Mac -> viewer verified
live; viewer -> Mac not yet. Adds format-name/echo diagnostics (no data).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FFmpeg 9 removed -vsync, so v0.2.2/v0.2.3 decoders exited at start and every
frame failed. Verified against the official Mac host on FFmpeg 9.0.2.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
POST /api/v1/device/{id}/unbind, the path the official Windows host and Mac
viewer use for 「删除设备」. Verified live on a disposable test device; the
shared-device path (/api/v1/device/share/{id}/unbind) comes from strings only.
CLI: uuremote-viewer unbind DEVICE [--shared]; launcher: 更多工具 → 删除设备
with a confirmation dialog.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Fix viewer Dock churn by reusing SDL clipboard window
* Handle clipboard text boundaries and read only after changes
* Keep SDL clipboard scoped to the focused desktop and validate CI call sites
The official Windows host only acknowledges the rich format-list offer
and never asks for the data. Each local change now also sends RpcRequest
case 10 ClipboardTextChangeRequest with the text (its
handle_text_change_request -> notifyReceiveText path); the host answers
case 6 err=1 (CB_SUCCEEDED), logged as a status only. This project's
host ignores case 10 and keeps using the rich offer. Note: on the tested
Windows host the acknowledged text still did not reach the desktop
clipboard; under investigation.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live against an official Windows host (PowerShell via ConPTY):
- Its rpc_main.proto has no check_env (requests end at 25), so a missing
answer within 3 s no longer aborts; a negative answer still does.
- OPEN carries "option":"none"; the host rejects an OPEN without it
("terminal open: missing 'option' field", kError 1004). This
project's host ignores the key.
- The host answers OPEN with {code,message}, header session 0, and keeps
one terminal per connection as session 0; a nonzero header still
overrides the body for this project's host.
- Echo requests whose SimpleAction omits the default action 0 are
answered too.
Create/reattach on this project's host unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The official Windows host answers every PortMappingFrame with session_id
1 regardless of the viewer's value, so the random 64-bit session never
matched and every stream ended with a SYN timeout. One port-mapping peer
carries one session; use 1 (this project's host echoes it). Stream
failures and unmatched frames are now logged with reasons and wire types
only. Verified: HTTP through the official Windows host and this
project's host.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live against an official Windows host:
- Uploads split Windows targets (C:\dir\name) on either separator and
keep the host's separator for the directory; '/x' keeps the root.
- The upload request carries FileInfo.modified_time, the zlib FileList in
list_data (field 6) and a task_unique_id, as official viewers with the
list-compress feature do; the Windows host rejected the inline-only
request with code 2. The inline copy stays for older hosts.
- Downloads accept blocks up to 256 KiB: the Windows host sent a 64 KiB
file as one block, which the old 32 KiB limit rejected with code 3.
64 KiB and 1 MiB round trips matched by sha256 on the Windows host and
on this project's host.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Offer H.265 (RFC 7798) next to H.264 and list H.265 and 4:4:4 decoder
caps; the host picks the codec. Depacketize single NAL, AP and FU units
with the existing reorder/loss handling and decode with the ffmpeg CLI
(-f hevc). UU_VIEWER_CHROMA=444 requests true color via
CaptureSettingRequest field 7 and follows CaptureSettingSync;
UU_VIEWER_CODEC=h264 keeps H.264 only.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without polkit permission (for example no active local session)
systemctl reboot/poweroff waited for an authentication dialog on the
controlled screen. Pass --no-ask-password so the action fails and is
logged instead. README: the viewer's terminal session list, reboot and
shutdown, and its Wayland window/clipboard were tested in a VM.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Add the experimental native viewer (uuremote-viewer)
A Linux viewer/controller for UU Remote hosts, built separately with
--features native-viewer,viewer-sdl; the host build and behaviour are
unchanged.
- Cloud join by device and remote assistance by share ID + code (code
via stdin only), WebRTC offer side, SDL desktop window with ffmpeg CLI
H.264 decoding, Opus sound, keyboard/mouse, view-only mode, text
clipboard on TEXT_DATA_CHANNEL.
- Tools: file browser/transfer (zero- and one-based download blocks),
terminal and terminal session list, port mapping (127.0.0.1 only),
reboot/shutdown; tools reuse the desktop peer while one is open.
- GTK launcher with device list and tool windows.
- CI builds and tests the viewer; release tarballs include it.
Logs carry field numbers, sizes and states only.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* ci: install the ffmpeg CLI for the viewer audio tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: VallierDev <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
The X11 engine has one process-wide display connection, but every
ScreenCapture closed it on drop. During guest assistance the device
init's screen-size probe created and dropped a capture after the main
one, closing the display under it: the stream stopped with
"X11 display wake failed" and the viewer got no video. A capture
replaced after a resize had the same hazard. Count live X11 captures
and close only on the last drop.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(portal): bootstrap video for iPhone locked auto unlock
* docs: keep the #29 experiment record in the PR instead of the repository
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: VallierDev <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
* fix(portal): establish locked desktop control before capture
* test(portal): preserve v4 pixel inventory after deferred capture settings
* fix(control): refresh lock state after viewer Echo handshake
* fix(portal): announce desktop target before locked capture wait
* ci: run the desktop_power native test under ASan/UBSan
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* input: skip the Portal release sweep while no session is bound
The first locked connection creates its peer before any Portal exists; the sweep
then logged two failed injections and a 'reset incomplete' warning for nothing.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* docs: describe locked cold connections, auto unlock limits and iPhone status
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* fix(portal): treat a cached screen with a closed Portal session as not ready
begin() now marks the state as waiting when the cached session is dead, and
permission/video/clipboard consumers honor it instead of reporting Allow and
starting the stale video path before maintain() has rebuilt capture.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* fix(portal): gate input on a ready desktop and share recovery backoff
Input dispatch kept only the cached screen and dropped State.waiting, so a closed
Portal passed the gate once the screen unlocked. The supervisor's recover() and the
encoder's stream-loss recovery now share failure backoff and a terminal-denial flag,
so a denied consent is not re-prompted by the other path.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* fix(control): keep unknown lock state unlocked, stop waits on Closing, never drop capture settings
- QuerySystemState with no logind lock state (Xvfb/linger) reports unlocked as before.
- The Portal wait loop also exits while the channel is Closing.
- Capture-setting requests back-pressure instead of try_send dropping the latest setting.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Co-authored-by: VallierDev <[email protected]>
The codec-negotiation and ICE/SCTP acceptance tests used real local sockets
and occasionally hit the 30 s connect timeout when the whole suite ran in
parallel. They now use webrtc-rs vnet (shared test_network helper), so they
are deterministic and the acceptance test no longer needs #[ignore].
Test-only change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
UU_PROBE_INPUT=<video or image sequence> bypasses desktop capture and encodes
the file with the production FFmpeg encoder arguments, so encoder
measurements no longer depend on desktop content; UU_PROBE_LOOP=1 repeats the
input up to UU_PROBE_FRAMES. Missing/undecodable input exits non-zero. The
session path is unchanged. Verified with Y4M, MP4 and PNG sequences (repeat
runs byte-identical); NVENC/VAAPI not hardware-verified.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Follow-up to #26: retire_if_closed errors (poisoned lock, panicked task) are
logged and treated as not stale instead of returning from serve().
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(portal): recover capture after live scaling changes
* fix(portal): keep input available during session recovery
* fix(portal): serialize reconnect recovery and throttle lock probes
Large folders (5600 entries) were sent both inline and as zlib dir_data in one
message, beyond the 256 KB SCTP limit, so the reply was dropped and the viewer
spun until its timeout. dir_data (what current viewers read) is always sent.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
display_info/capability/codec negotiation reported a fixed 60 fps; they now
use the monitor mode (hyprctl on Hyprland, xrandr on X11, UU_DISPLAY_FPS
override, 60 otherwise; external tools bounded to 1 s). NVENC 4:2:0 without
scaling takes bgra/bgr0 input and converts on the GPU (BT.601 limited range,
same tagging as swscale), saving the CPU conversion; UU_NVENC_RGB=0 restores it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(portal): map scaled GNOME input through EIS regions
Keep unsupported portals on legacy input and leave capture/uinput independent of EIS. Cache logical geometry without the native handle lock and reject geometry changes during recovery.
Add native capability, handshake, geometry and lifecycle regression coverage with sanitizer checks; preserve existing non-portal paths. Refs #23.
* fix(portal): keep version 4 capture settings in pixel coordinates
Keep native, selectable and current screen rectangles in pixels with DPR 1 so legacy setting requests cannot implicitly downscale a scaled desktop. Leave Portal and EIS coordinate mapping local and unchanged.
Add inventory/request/ack/sync roundtrip regression coverage, including repeated settings changes and restoring native output. Refs #23.
* Adapt FFmpeg output timing args to detected capabilities
Probe the selected FFmpeg (PATH or UU_FFMPEG_ROOT/config ffmpeg_root)
once per process with `-h full` and cache the result per executable
environment (program + LD_LIBRARY_PATH + PATH). FFmpeg 5+ gets
`-fps_mode vfr -enc_time_base 1/<fps>`; older builds such as Ubuntu
22.04's FFmpeg 4.4 fall back to `-vsync 0`. Probe failures, timeouts
and unparseable help output all take the legacy path, and no output
side `-r` is ever emitted. HEVC availability probing stays independent.
Verified on FFmpeg 4.4.2: 20 video tests pass and desktop-video-probe
emits 5 H.264 frames with the first frame an IDR.
Co-Authored-By: Claude Code <[email protected]>
* Keep modern timing args when the FFmpeg probe fails
A failed probe (spawn error, non-zero exit, timeout, or no parseable
help text) previously fell back to -vsync 0, but -vsync is deprecated
since FFmpeg 5.1 and a newer build may reject it, killing the encoder.
Legacy is now selected only from a completed help dump that visibly
lacks -fps_mode/-enc_time_base; everything else keeps
-fps_mode vfr -enc_time_base 1/fps. Also fix the encoder comment: the
same-slot drop belongs to vfr on a 1/fps timebase, while -vsync 0
passes catch-up frames through (a known degradation on FFmpeg 4.x).
Co-Authored-By: Claude Code <[email protected]>
---------
Co-authored-by: Claude Code <[email protected]>
Pairing every host interface (VPNs, IPv6) let ICE exceed the 10 s connect
timeout when the suite ran in parallel; the suite now finishes in 5 s.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The probe always used Auto (CRF), so the ABR path of the bitrate presets
(#15) could not be measured without a viewer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-ups to #20: the copy-failure fallback cleared frame state
but no longer released cached dma-buf buffers, and after a backpressure
stall the engine's prefetched frame was as old as the stall. Release
v0.1.22.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
reqwest used only the bundled webpki roots, so TLS-intercepting proxies
with a custom CA (SSL_CERT_FILE) failed with a bare "error sending
request". Enable native roots (rustls-native-certs honors SSL_CERT_FILE
and SSL_CERT_DIR) and report the error source chain with URL user-info
and query strings removed. Release v0.1.20.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The final send after the viewer closes fails with "codec is not supported
by remote", which read like an encoder negotiation bug.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Documents what the viewer and cloud send in be-controlled (ConnectOptions
nesting, streamer_data and header value types) without rendering string
or byte contents, large numbers or identifiers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only a close frame or read error ended the signaling loop, so a half-open
socket after suspend or a NAT drop left the host believing it was online.
Per Engine.IO 4, report Disconnected when no ping arrives within the
server's pingInterval + pingTimeout so the existing reconnect loop runs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-ups to f0506bc: a stalled encoder read no longer shortens the
next capture interval, and the capture process exit status is logged
because nothing awaits its task.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The root geometry and XShm image were read once at startup, so after a
RandR or xrdp resize every new connection asked x11grab for the old size
and stalled on "transferring picture". Query the root geometry before
each desktop connection and rebuild the capture when it changed; guard
capture with a lock and reject a stale-sized buffer instead of
overflowing it. The HEVC fallback log now includes the actual failure.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The native Wayland session relayed each 33 MB 4K frame through this process
and the capture loop wrote synchronously, so a slow encoder read delayed the
next screencopy request (~65 fps at a 144 fps request versus 87-92 fps for
bare capture, #16). Hand the capture stdout to FFmpeg directly, double-buffer
capture against the pipe write on a separate thread, and enlarge the pipe.
Terminal: hold the size lock across the ioctl so the delayed redraw restore
cannot reapply a stale size, and record scrollback and live output under the
sink lock so a reattach never replays a chunk that is also sent live.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sent/skipped are cumulative while max_* are per-window peaks, which was
easy to misread (#16). Add window_s, window_sent and window_skipped.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reattaching replays the scrollback tail, which starts mid-redraw for
full-screen programs (tmux, vim, TUIs), and an unchanged size raises no
SIGWINCH. Shrink the PTY by one row and restore the latest requested size
after a pause so the program repaints (#17).
Apply the #15 ABR change to the libx265 path as well, clarify the
non-wayland build error, and document the Wayland systemd unit and uinput
module autoload (#16).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Wayland: keep capturing when output power management is unavailable
keep_display_awake() runs on the desktop video start path, so a compositor\nwithout wlr-output-power-management made uu_wl_wake() return -1 and aborted\nthe whole desktop stream. Treat the missing protocol as nothing to wake.
* x264: average bitrate for the bitrate presets so 4K keyframes fit
Capped CRF plus VBV cannot fit a large IDR frame at 4K and a low cap, so\nkeyframes came out near-grey. NVENC and VAAPI already carry a target bitrate;\ngive x264 the same and keep CRF only for automatic quality.
One video track carries H.264 or H.265 (RFC 7798 payloader); the host
announces its encoders with CONTROL Message 18 CodecNegotiation and picks
H.265 when the viewer negotiated it (the official Mac viewer offers H265
first; CaptureSettingRequest field 13 only reports the current codec).
hevc_nvenc / libx265 / hevc_vaapi with fallback to software HEVC, then
H.264; UU_VIDEO_CODEC=h264 forces H.264. True color 4:4:4 applies to H.265.
Verified with the official Mac viewer on NVENC.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The viewer sends CaptureSettingRequest field 7 = 3 when 真彩 is enabled
(ff_capture_setting versions are cumulative, so our version 4 already
implies chroma sampling). Encode yuv444p with NVENC high444p / x264
high444 and report the encoded chroma in CaptureSettingSync; VAAPI and
inproc stay 4:2:0. Log ConnectOptions decoder_cap_list (numbers only).
Co-Authored-By: Claude Opus 5.5 <[email protected]>