From ebe6a7e19a9df56e38361d0e6d85b04b1201f7a0 Mon Sep 17 00:00:00 2001 From: VallierDev <24893073+VallierDev@users.noreply.github.com> Date: Thu, 15 Oct 2026 11:22:20 +0800 Subject: [PATCH] Clarify mute logs with the virtual sink; document the PipeWire fallback Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 7 ++++--- README.en.md | 7 ++++--- README.md | 5 +++-- src/system_actions.rs | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 430d8f9..c4549a6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -236,14 +236,15 @@ with a warning. Intel/AMD hardware acceptance is still required (未实机验证 ### Virtual audio / 虚拟声卡 -The viewer's 静音运行 switch creates `uu-remote-sink` with `pactl module-null-sink`, +The viewer's 静音运行 switch creates the null sink `uu-remote-sink`, moves streams from the original default output and captures `uu-remote-sink.monitor`. New output goes to this sink; streams explicitly pinned to other outputs are untouched. The last desktop session restores the previous default output and unloads the module. `mute_permanent` retains the physical mute policy, but still releases the virtual sink. A private recovery record beside the config and a process lock recover crash leftovers on startup. -PulseAudio and PipeWire-pulse use the same `pactl` interface (install `pulseaudio-utils` on Debian, -`libpulse` on Arch). When routing is unavailable, the existing mute/monitor path remains. +`pactl` is used when installed (PulseAudio / PipeWire-pulse); plain PipeWire systems without it (default +Ubuntu desktop) use `pw-cli`/`wpctl` for the same sink and WirePlumber moves playing streams. Accepted on +Ubuntu 24.04 with the official Mac viewer. When routing is unavailable, the existing mute/monitor path remains. Changing the switch restarts only the scoped audio encoder; normal non-muted capture is unchanged. `virtual-audio-probe` temporarily routes output for five seconds and restores it (local diagnostic). diff --git a/README.en.md b/README.en.md index b7b69ae..96834dd 100644 --- a/README.en.md +++ b/README.en.md @@ -274,14 +274,15 @@ with a warning. Intel/AMD hardware acceptance is still required (未实机验证 ### Virtual audio / 虚拟声卡 -The viewer's 静音运行 switch creates `uu-remote-sink` with `pactl module-null-sink`, +The viewer's 静音运行 switch creates the null sink `uu-remote-sink`, moves streams from the original default output and captures `uu-remote-sink.monitor`. New output goes to this sink; streams explicitly pinned to other outputs are untouched. The last desktop session restores the previous default output and unloads the module. `mute_permanent` retains the physical mute policy, but still releases the virtual sink. A private recovery record beside the config and a process lock recover crash leftovers on startup. -PulseAudio and PipeWire-pulse use the same `pactl` interface (install `pulseaudio-utils` on Debian, -`libpulse` on Arch). When routing is unavailable, the existing mute/monitor path remains. +`pactl` is used when installed (PulseAudio / PipeWire-pulse); plain PipeWire systems without it (default +Ubuntu desktop) use `pw-cli`/`wpctl` for the same sink and WirePlumber moves playing streams. Accepted on +Ubuntu 24.04 with the official Mac viewer. When routing is unavailable, the existing mute/monitor path remains. Changing the switch restarts only the scoped audio encoder; normal non-muted capture is unchanged. `virtual-audio-probe` temporarily routes output for five seconds and restores it (local diagnostic). diff --git a/README.md b/README.md index 083eb2a..16226c3 100644 --- a/README.md +++ b/README.md @@ -255,11 +255,12 @@ Intel/AMD 硬编**未实机验证**,不能把 virtio 的 CPU 回退测试当 ### 静音运行与虚拟声卡 -控制端开启「静音运行」后,程序用 `pactl module-null-sink` 创建 `uu-remote-sink`,保存原默认输出, +控制端开启「静音运行」后,程序创建虚拟输出 `uu-remote-sink`,保存原默认输出, 迁移其播放流并采集 `uu-remote-sink.monitor`。新播放也走虚拟输出;其他输出上的流不迁移。 最后一个桌面连接结束后恢复原默认输出并卸载模块;`mute_permanent` 仍保留原物理静音策略。 恢复记录保存在配置旁,权限 0600;进程锁避免重复实例抢占,异常退出后下次启动会恢复遗留路由。 -PulseAudio 和 PipeWire-pulse 都使用该接口(Debian 安装 `pulseaudio-utils`,Arch 安装 `libpulse`)。 +有 `pactl` 时用它(PulseAudio / PipeWire-pulse);没有 `pactl` 的纯 PipeWire 系统(如默认的 Ubuntu 桌面) +自动改用 `pw-cli`/`wpctl` 创建同名虚拟输出,正在播放的声音由 WirePlumber 自动迁移。已在 Ubuntu 24.04 实机上用官方 Mac 控制端验收。 路由失败时保留原静音/monitor 方案。开关变化仅重启当前音频编码器,未开启时采集方式保持不变。 本地诊断命令 `virtual-audio-probe` 会临时切换输出五秒并恢复。 diff --git a/src/system_actions.rs b/src/system_actions.rs index 364ce59..d3568fb 100644 --- a/src/system_actions.rs +++ b/src/system_actions.rs @@ -147,20 +147,20 @@ impl PeerActions { let on = toggle_value(value, args); state.settings.keep_mute = on; if on { mute_for_session(&mut state); } else { restore_mute(&mut state); } - log::info!("System action mute (action {}): on={} muted={:?}", action, on, host_muted()); + log::info!("System action mute (action {}): on={} virtual_sink={} default_muted={:?}", action, on, crate::virtual_audio::active(), host_muted()); } // Keep the host muted after the session (远程结束后,恢复被控端声音设置 unchecked). MUTE_PERMANENT => { let on = toggle_value(value, args); state.settings.mute_permanent = on; if on { state.settings.keep_mute = true; mute_for_session(&mut state); } - log::info!("System action mute_permanent: on={} muted={:?}", on, host_muted()); + log::info!("System action mute_permanent: on={} virtual_sink={} default_muted={:?}", on, crate::virtual_audio::active(), host_muted()); } MUTE_RESTORE => { state.settings.keep_mute = false; state.settings.mute_permanent = false; restore_mute(&mut state); - log::info!("System action mute_restore: muted={:?}", host_muted()); + log::info!("System action mute_restore: virtual_sink={} default_muted={:?}", crate::virtual_audio::active(), host_muted()); } SET_AUTO_LOCK => { // Observed: enabling 远程结束后自动锁屏 sends value 2 and disabling value 1.