## Problem and outcome / 问题与结果 This phase adds lightweight room interaction without making media depend on chat, and adds Windows source-audio exclusion and optional SFU-only hosting at their existing owners. It also corrects confirmed encoder/capture ownership and native color-conversion defects. Host microphone commentary remains on the shared media path; room voice and 4K are outside this phase. ## Release notes ### 中文 这是一次功能更新:Piik 加入了文字聊天与表情互动,并完善了 Windows 声音采集、画面颜色和自部署选项。 #### 新功能 - **边看边聊。** 在可移动、可缩放的聊天窗口中发送消息,或开启弹幕。停止分享后,房间中的朋友仍可继续聊天。 - **表情互动。** 点击沙发上的人物,给自己发表情,或把番茄等表情送给朋友;各端按同一事件显示动画。 - **排除应用声音。** Windows App 分享整个屏幕时,可排除一个应用及其子进程的声音,适合同时使用语音软件。所选应用退出后,来源声音停止,避免恢复为未过滤的系统声音。 - **可选的纯 SFU 模式。** 自部署管理员可让共享画面和声音统一通过媒体服务器转发。默认仍为优先 P2P;App 公网邀请保持纯 P2P。 - **Windows HDR 转 SDR。** 原生采集与缩略图自动将 HDR 来源转换为 SDR,沿用现有观看链路。 #### 修复与改进 - 修复原生颜色转换的范围与矩阵处理,避免已复现的暗部丢失、高光裁切和颜色偏差。 - 修复共享编码器切换时使用过期需求或过期帧信息的问题,保护正在观看的画面;修复换源后旧采集事件可能影响新来源的问题。 - 统一新控件、浮窗与来源选择文案,补充中英文使用说明。 #### 使用与升级 聊天与表情需要新版站点页面和 Server;声音排除需要新版页面与支持此能力的 Windows App。聊天只保留本页最近收到的消息,刷新后清空,不补发历史,且不提供端到端加密。 HDR 转换输出为 SDR,不代表端到端 HDR 或多声道支持。既有房主麦克风与立体声能力保留。 ### English This feature update brings text chat and reactions to Piik, alongside improvements to Windows audio capture, picture colors and self-hosting options. #### New features - **Chat while watching.** Send messages in a movable, resizable window, or enable on-screen chat. Friends can keep chatting after the host stops sharing. - **Reactions.** Select a person on the sofa to react above yourself or send a tomato and other reactions to a friend. Participants animate the same shared event. - **Exclude application audio.** When sharing a whole screen with Windows App, exclude one application and its child processes, useful when using a separate voice app. Source audio stops if the selected app exits, preventing a return to unfiltered system sound. - **Optional SFU-only hosting.** Site operators can require shared video and audio to pass through the media server. P2P-first remains the default; App Public invite remains P2P-only. - **Windows HDR-to-SDR conversion.** Native capture and source thumbnails automatically convert HDR sources to SDR for the existing viewing path. #### Fixes and improvements - Correct native color-conversion ranges and matrices, addressing reproduced crushed shadows, clipped highlights and color shifts. - Correct stale demand and frame evidence during shared-encoder handoffs to protect the current picture. Prevent events from a replaced capture from affecting its successor. - Align new controls, floating panels and source-picker copy, with updated Chinese and English guides. #### Using this update Chat and reactions require updated site pages and Server. Audio exclusion requires updated pages and a Windows App that supports the capability. Chat retains only recent messages received by the current page, clears on refresh and does not replay history. It is not end-to-end encrypted. HDR conversion produces SDR; it does not add end-to-end HDR or surround sound. Existing host microphone commentary and stereo support remain available. ## Verification / 验证 - Web type checks, 78 test files / 1275 tests and production build: PASS. - Go core tests, formatting/vet and target builds: PASS; Darwin cgo remains platform-limited on this Windows runner. - Native build/check/color probes and synthetic HDR-to-SDR H.264/VP8 browser reception: PASS. - Access/privacy gate, Native H.264 SFU-only media gate and local Auto/H.264 Host gate: PASS. - Three real production pages: chat/reactions, stop/resume, idle-room join, host departure/return, offline draft recovery and invitation revocation: PASS. - Synthetic parent/child process-audio exclusion and target lifetime: PASS; no raw audio retained. - Windows candidate archive extraction and packaged Local startup/shutdown: PASS. - Documentation and website build: PASS. - [Candidate CI](https://github.com/TNTcraftHIM/Piik/actions/runs/36873766646) at `f26cd208d03bc0dcbe353f8cac217f993216b0a3`: Go core and race checks, Web tests, Server/container checks and Windows/macOS/Linux App packaging all PASS. Publication was skipped as intended. The owner accepted the UI/model and bounded local walkthrough for phase closure. Physical HDR/mixed displays, mobile keyboard, real voice applications across output devices and macOS/Linux capture remain unverified. Existing field reports without matched evidence are not claimed resolved. The owner authorized v1.7.0 publication on 2026-10-02. The final documentation-only commit records that authorization; product code matches the verified candidate above. ## Impact / 影响 Authorized version: **v1.7.0**, matching the local release planner. Current wire contracts remain Browser/server 23, Native control 9 and capture 7. Optional capabilities gate new functionality; existing room/media authority remains owned by the existing services. No new ports, message persistence, room voice or automatic room creation on page visit. Updated README, guides, standards, research evidence and TODO stay with the candidate phase.
7.1 KiB
Project Memory
Last updated: 2026-10-01
Piik is private, low-latency screen sharing for one Host and up to 20 authenticated friends. The current product surface is Web Host, Web Viewer, and Browser relay; desktop and mobile Browsers are Viewer targets, and camera-capable mobile Browsers can also host. It is not a public broadcast service. Hosted and App run one shared Go core (ADR-0012); Node and Vite build the Browser UI and are not a runtime. Source includes a cross-platform App that runs that same core in a self-contained Local deployment or opens one configured Site through the system Browser. Its single Go process presents Local, temporary public-link, and saved-Site choices on every launch, starts one process-level loopback capability service, owns the Local room authority in-process when selected, and owns the explicit native media path chosen in the same Web UI. Room source and media implementation are independent: a topology may mix Browser and Native peers without changing participant, signaling, capacity, or route identity. Local is LAN-first; explicit one-link mode exposes that same authority through a temporary public control tunnel while media remains P2P. Host authority belongs to a tab, with one separate persistent origin resume hint. The App admits two independent native control sessions under its one loopback service.
The current source embeds Binding-only STUN and optional SFU forwarding in the Hosted Go process. Native and SFU use one shared Pion/LiveKit media adapter; Native parents reuse suitable encoded outputs and derive a missing lower output only for direct-child demand. Source-owned groups retain the highest needed output and lower fallbacks, while each child receives its selected output. Native Host SFU publication reuses the encoded source directly; its loopback Browser stream supplies local preview and Browser quality candidates. Eligible Browser capture and relay now share independent local WebRTC producers for compatible direct children under ADR-0014; unsupported APIs and failed pooling retain ordinary senders. Windows, macOS and Linux producers share one encoded-frame boundary and Host quality controls. Source replacement retains route and connection identity; lower-output adaptation preserves the original and higher sibling outputs. Status owns the remaining physical and release acceptance boundary; runtime release descriptors own deployed identity. The Local launcher keeps an optional user-chosen site-access password; leaving it blank keeps the self-contained site open.
Product Map
- Rooms and access owns room codes, invitations, code entry, credentials, room interactions and lightweight/SQLite persistence.
- Routing and transport owns P2P-first distribution, endpoint capacity, SFU fallback, recovery, and privacy limits.
- Capture and media quality owns Browser capture, profiles, codec selection, audio, and framework adaptation.
- Presentation and lifecycle owns Host and Viewer workflows, playback authority, roster, state, and Browser lifecycle.
Non-obvious decisions live in ADRs; reproducible evidence and platform limits live in research. Source code and tests own self-evident implementation and routine UI detail.
Core Invariants
- Rooms use random four-digit codes, exact Host ownership, room-scoped Viewer
invitations and independent
open | privatecode entry. Room authority ends through explicit replacement/deletion, with separate invitation rotation or revocation. Hosted defaults to SQLite, with explicit process-memory opt-out; App Local remains process-only. Site access has a separate 24-hour idle cookie lifetime within one service run. Production persists SQLite room authority; live participants, routes, and media remain process-only. - Media is automatic and distributed. Ordinary peers are STUN-only and prefer direct/peer UDP. A deployment may enable same-host auxiliary STUN for bounded, room-wide, connection-local NAT prediction; its Host switch defaults on when available, and anonymous provenance distinguishes ordinary from predicted selected paths. The configuration default remains stock ICE. The only application fallback is one bounded embedded SFU/UDP publication; Piik configures no TURN or TCP media route. Hosted operators may require SFU-only media through the same controller. On P2P-first sites, a pre-share peer-only policy can exclude that SFU suffix for one share generation.
- Every endpoint shares one steady outbound-copy cap, default
2and limited to1..3. One room controller owns one committed graph, one reconcile loop, and one serial child operation. First decoded frame commits availability work; accepted quality work adds native edge proof before commit in that operation. - Browser WebRTC and the shared Pion/LiveKit media adapter own congestion control, media adaptation, pacing and layer selection. Parent demand is local to direct children and never a room-wide minimum or topology rebalance. Current source defaults persistent native-edge local P2P convergence on, with a pre-share Host opt-out. SFU quality work is limited to multi-root Host fanout relief and each Viewer must prove its own candidate non-regression before commit. A persistently limited edge with no different Peer parent may use one same-parent connection regeneration through that same operation; its exact post-commit sender identity damps only another same-edge regeneration. No weighted score, all-pairs probe, general parent-wide prediction, or periodic rebalance is accepted.
- Browser video uses
motion; each share chooses H.264 with VP8 fallback through an actual sender probe unless the Host explicitly selects VP8 or H264. Screen audio uses 64/128/192 kbps ceilings with 128 default. - Viewer playback uses one native video element. Presentation and recovery are fenced by current route/media identity and current-frame proof; hidden-page time alone is not media-failure evidence or a keepalive guarantee.
Current Snapshot
The current contract tuple is owned by status. Embedded SFU SDP/ICE and demand travel over the authenticated room WebSocket, without an external room service or media token. Committed first-frame readiness, bounded candidate-relative progress, durable room authority and the H.264/VP8 sender gate remain. Status indexes source and deployment evidence; protocol rollback requires matching Browser and App artifacts, not only an application symlink.
Current work is owned by the TODO ledger. Open physical evidence is owned by verification status. Environment and initial services are owned by configuration and self-hosting; application release is owned by deployment, with exact deployed identity retained in the release descriptor and deployment record. Git history and pull requests own completed timelines.