Files
piik/docs/guide/troubleshooting.zh-CN.md
T
AAA a9b7507488 feat(app): add camera sharing and Host microphone controls
## Problem and outcome / 问题与结果

Add camera sharing and Host microphone commentary to the existing Host workflow,
with shared source cards, device selection, input gain and grouped sharing settings.
Browser and native capture keep one outgoing audio track and the existing room/media
owners. Include optional password-free invitations, public-tunnel protocol fallback,
capture retirement and App-discovery feedback fixes. This is the complete capture
maintenance phase; interaction, x86 capture and 4K experiments are excluded.

## Release notes

### 中文

这次更新让分享多了两种表达方式:用摄像头展示现场,用麦克风边分享边讲解。
分享设置也重新整理,并修复了公网邀请、音视频切换和采集退出中的一些问题。

#### 新功能与使用改进

- **摄像头分享**:在原有选源器中选择摄像头,支持设备选择和画面预览;支持摄像头访问的手机浏览器也可使用。
- **房主麦克风**:浏览器分享和 App 原生采集均可混入房主声音,支持选择麦克风、静音和输入音量调节。观众仍使用原有音量控件收听。
- **更集中的分享设置**:画质、声音和详细连接选项集中在画面下方,常用操作保持直接可用,并调整了窄屏播控与等待提示的布局。
- **邀请链接可选择是否免密加入**:关闭后,链接不再附带免密邀请;接收者按当前站点和房间的准入设置加入。
- **更清晰的启动设置**:可选站点口令默认收起,已有站点地址提供 `demo.piik.tv` 建议,并澄清 NAT 增强选项的含义。

#### 修复

- 公网邀请在 UDP 受限但 TCP 可用的网络中,可使用隧道组件原有的协议回退,减少这类启动失败。
- 调整音频时保留健康的视频发送;修复旧采集事件干扰当前分享的情况。
- 停止或取消原生采集时,先正常释放采集会话,超时才强制退出;修复本地复现的强制终止后 Windows 黄框残留问题。
- 从 App 打开的页面无法连接 App 时,选源器保留明确提示,不再只剩浏览器和摄像头选项而缺少原因说明。

#### 使用说明

摄像头和音频能力取决于系统、浏览器与设备。Windows 仍可能因权限或其他采集要求显示边框。
使用新增的 App 麦克风功能,请更新 App;连接自部署站点时,也请更新站点以获得对应页面功能。

### English

This update adds camera sharing and Host microphone commentary, alongside a
clearer sharing-settings layout. It also fixes several public-invitation,
audio/video transition and capture-shutdown issues.

#### Features and usability

- **Camera sharing:** choose a camera in the existing source picker, with device selection and thumbnail previews. Phone browsers with camera access can share too.
- **Host microphone:** add commentary to Browser sharing or App-native capture, with device selection, mute and input gain. Viewers listen through their existing volume controls.
- **Grouped sharing settings:** picture quality, sound and detailed connection options sit below the picture, while frequent actions remain directly available. Narrow-screen playback and waiting layouts are refined.
- **Optional password-free invitations:** turn this off to copy a link without an invitation credential. Recipients then follow the site's and room's current admission settings.
- **Clearer startup settings:** optional site-password settings are collapsed, the existing-site field suggests `demo.piik.tv`, and the NAT enhancement option has a clearer description.

#### Fixes

- Public invitations can use the tunnel component's existing protocol fallback when UDP is blocked but TCP is available, reducing startup failures on those networks.
- Audio changes preserve healthy video sending. Retired capture events no longer affect an active share.
- Stopping or cancelling native capture releases the capture session before enforcing the shutdown deadline. This fixes a locally reproduced case where forced termination left a Windows capture border behind.
- Pages opened from the App keep a clear connection warning in the source picker when the App cannot be reached, instead of showing only Browser and Camera without an explanation.

#### Usage notes

Camera and audio support depend on the OS, browser and device. Windows may still
require a border because of permissions or another active capture.
Update the App to use its new microphone feature; update self-hosted sites as
well to receive the matching page controls.

## Verification / 验证

- npm run check: 74 files / 1054 tests passed, TypeScript and production Web build passed.
- npm run check:go: Go tests, vet, target builds and Windows native compile/regressions passed.
- npm run gate:app-native-host: actual Windows H264 Host/Viewer, live/paused profile changes,
  quiet-source recovery, source replacement/failure, subsequent share and cleanup passed.
- Windows 11 capture-border check: parent cancellation retires the actual WGC session and
  clears its border; subprocess tests verify normal, concurrent and timed-out retirement.
- Website build, scripts typecheck, documentation and repository hygiene passed.
- Native macOS/Linux packaging and Linux race checks run in CI before publication.
  Physical phone camera and real audio-level/echo/multiple-device coverage remain recorded
  limits; the owner authorized release with those limits. No universal NAT/border fix is claimed.

## Impact / 影响

Compatible feature release **v1.6.0**, explicitly approved by the owner. Browser/Server v23,
Native control v9 and capture v7 stay unchanged; new App microphone commands use capability
negotiation. No new dependency, port, media route, room lifecycle or storage migration.
Published Server cutover retains configuration and room storage and uses bounded health
checks with the previous executable available for rollback. Source, tests and owned
documentation ship together; exact artifact/deployment identities remain outside the repo.
2026-09-21 18:34:56 +08:00

9.7 KiB
Raw Blame History

问题排查

English · 简体中文 · 文档中心

按遇到的现象查找下方说明,恢复正常后就不必继续。 如果问题仍然存在,可以收集诊断报告反馈。

常见问题

你遇到的情况 可以先试什么
有画面,没来源声音 先取消视频静音。房主应选择支持分享声音的来源,并在选源器中打开声音。
听不到房主说话 房主可在画面下方开启 麦克风,在 分享设置 → 声音 中检查输入设备和音量,并确认设备连接与麦克风权限。如控件不可用,请更新 App 并刷新页面。
没有屏幕选择弹窗 按系统提示允许浏览器或 App 录制屏幕。浏览器采集需要 HTTPS 或 localhost,请在电脑上尝试分享。
App 的窗口或屏幕列表为空 先查看选源器中的提示,再按 App 来源排查 操作;也可以选 浏览器 → 浏览器选择器 使用浏览器采集。
分享的窗口或屏幕周围出现黄框 这是 Windows 的采集提示。查看采集边框说明,了解 Windows 11 的开关和 Windows 10 的可选处理方法。
App 启动失败 先查看页面和终端中的具体原因。重新打开 App,在主题按钮后的芯片图标开启「诊断启动」再重试。启动失败时会自动导出报告,保存位置见终端。
本地邀请打不开 确认两台设备在同一网络且可以互相访问。访客 Wi-Fi 或防火墙规则可能阻止本地连接。
网页能打开,画面连不上 重新连接 按钮可用时先点击,否则刷新观看页。仍然失败时,查看 画面连接排查。
休眠或挂起后分享中断 唤醒设备,回到分享标签页,必要时重新开始分享。浏览器或系统挂起可能中断采集和播放。

反馈问题时,请附上版本、系统与浏览器、预期结果和复现步骤。 诊断与导出 说明如何收集本地报告,以及分享前需要检查哪些内容。

App 找不到窗口或屏幕

在分享画面的这台电脑上保持 Piik App 运行,并从 App 打开当前站点。 使用已部署的站点时,在 App 的 站点 模式中填写该站点地址。 浏览器询问本地网络权限时允许访问,再刷新来源列表;如果之前拒绝过,先检查当前站点的浏览器权限。

选源器会区分以下情况:

提示 处理方法
未能连接 Piik App 确认 App 正在运行,且通过 App 打开了当前站点。关闭其他正在使用 App 的闲置 Piik 标签页后刷新列表;最多两个页面可以同时使用 App 的原生采集或收看功能。
Piik App 与当前页面不兼容 更新 Piik App 并刷新页面。
Piik App 采集功能当前不可用 查看 App 诊断信息中的采集和编码能力,检查编码设置,或使用浏览器采集。
未能读取 App 的窗口和屏幕列表 刷新重试;若持续失败,请导出同一次尝试的 App 和网页诊断报告。
暂无可用来源 已成功读取列表,但当前分类没有可选来源,可以查看其他分类。

本地网络权限用于让网页连接 App,与下文的 WebRTC 媒体设置不同。 仅凭 App 未连接,不能确定是权限被拒绝。

Windows 分享时出现黄框

Windows 用黄色边框标出正在采集的窗口或屏幕。在支持的 Windows 版本上, App 选源器提供 显示采集边框 开关,默认关闭;系统权限或其他正在进行的采集 仍可能要求显示边框。Windows 10 的采集接口没有这个开关。

Windows 11 关闭开关后仍有黄框

  1. 从 Piik 的 程序 / 窗口 或 屏幕 列表选源,保持 显示采集边框 关闭。 通过浏览器选源时,采集标识由浏览器管理。
  2. 停止其他软件或标签页对同一窗口、屏幕的采集,再重新开始分享。
  3. 如果之前拒绝了无边框采集权限,在 Windows 隐私设置中检查 屏幕截图边框。 支持该设置页的系统也可以按 Win+R,输入 ms-settings:privacy-graphicscapturewithoutborder 打开。

Windows 需要用户授权;其他采集要求显示边框时,边框仍会保留 (微软接口说明,英文)。 仍未解决时,反馈中请附上 Windows 版本、选源方式和 App 诊断报告。

Windows 10 可选处理方法

DWM Custom Projection Border 是适用于 x64(64 位)Windows 的 Windhawk 第三方模组,可以在保持原有采集方式的情况下隐藏黄框。 它会修改 Windows 桌面合成器的行为,也会影响其他软件的采集提示。 作者提供了 Windows 10 21H2 的效果示例;以下步骤尚未在 Windows 10 设备上配合 Piik 实测。

  1. 从官方网站安装 Windhawk。
  2. 打开 Windhawk 全局的 设置 → 高级设置 → 更多高级设置, 在 包含的进程列表(Process inclusion list) 中追加一行 dwm.exe 并保存,保留已有条目。
  3. 搜索并安装 DWM Custom Projection Border,在模组设置中开启 Disable border(关闭边框) 并保存。
  4. 在 Piik 中停止后重新开始分享,检查黄框是否消失。

恢复原状时,禁用该模组并重新开始分享。如果 dwm.exe 这一项是专门为该模组添加的, 也可以移除。若桌面出现异常,或 Windows 更新后不再兼容,先禁用模组。

最新操作说明见模组作者说明 和 Windhawk 进程设置文档(英文)。

画面连接不上

没有可用的媒体线路 表示 Piik 还没有找到能把画面送到你设备上的连接。 网页和媒体使用不同的连接,所以可能出现网页能打开、画面却连不上的情况。

NAT(网络地址转换)让多台设备共用一个上网地址。不同路由器和运营商对地址转换、 外部数据进入的规则不同,有些组合会让设备难以直连。防火墙和浏览器策略也可能阻止媒体连接, 仅凭这条提示还不能确定具体原因。

可以依次尝试,画面恢复后就不必继续:

  1. 重新尝试观看连接。 如果 重新连接 可用,先点击;按钮不可用或没有效果时, 刷新观看页或重新打开邀请链接。每次等连接尝试结束,重试一两次即可;反复刷新无法解除网络限制。
  2. 检查观看端浏览器的 WebRTC 设置。 浏览器设置、VPN 或隐私扩展如果禁用了 WebRTC, 或禁止未经代理的 UDP,可能导致网页能打开、画面却连不上。仅隐藏本机 IP 地址不一定会阻止 WebRTC。 可以用未安装这类扩展的浏览器配置打开同一邀请进行对照,或检查对应的 WebRTC 设置后重新加载 Piik。 具体示例及隐私影响见 浏览器连接设置,保留其他无关保护。
  3. 换个网络测试。 例如试用手机热点。如果使用了 VPN 或代理,检查其 UDP 策略;受管理的网络请联系管理员。
  4. 开启可用的 IPv6。 先确认宽带、路由器和设备都支持。连接双方都有可用 IPv6 时, Piik 可以多尝试一条直连路径;它仍受防火墙规则约束,同时保留 IPv4 即可。
  5. 检查自己管理的路由器。 在可信家庭网络中,路由器支持的 UPnP、PCP 或 NAT-PMP 可以让 App 的原生媒体连接申请端口映射;纯浏览器采集不会申请这些映射。 如果光猫和路由器都在做 NAT,可按对应型号的桥接或 AP 模式说明减少一层。 运营商共享公网地址(CGNAT)位于路由器上游,需要向运营商咨询公网 IPv4 或 IPv6 服务。 修改路由器工作模式前,先备份配置。
  6. 请另一网络的朋友加入。 如果对方能正常看到画面,且有余力转发,Piik 可能经由这位观众 把画面送到你这里。线路由 Piik 自动选择,能否帮上忙取决于这些连接是否可用。
  7. 使用有媒体兜底的站点。 管理员需要先启用 SFU 转发,房主在分享前关闭 隐私模式。 公开站点 demo.piik.tv 和 App 的 公网邀请 模式均没有 SFU 兜底。 有服务器的用户也可以按 部署指南 配置,属于进阶操作。 目前 P2P 和 SFU 媒体都使用 UDP;网络完全禁止 UDP 时,仍需换网络或由管理员放行。

不同型号的路由器菜单会有差异,可参考厂商的 IPv6 条件说明、 UPnP 说明 和 双重 NAT 调整示例(英文)。 想了解连接机制,可以阅读 WebRTC 官方说明(英文)。

仍然失败时,收集出现问题的观众端与房主端同一次尝试的 诊断报告,反馈时附上发生时间、Piik 版本和所用网络类型。

想为朋友搭一个站点?从 部署指南 开始。 其他指南可在 文档中心 找到。