Skip to content

Linux (GNOME Wayland): no floating capsule + hotkey depends on focused app + resilience gaps (with working prototype) #1156

Description

@questionjie-max

Issue 提案:Linux(GNOME Wayland)缺少悬浮胶囊 + 热键焦点依赖 + 韧性缺口

建议发到 Open-Less/openless 的 Discussions 或 Issues(中文即可,社区以中文为主)。

标题

Linux (GNOME Wayland): no floating capsule on GNOME 50 + hotkey depends on focused app + resilience gaps found in real usage

现象(Ubuntu 26.04 / GNOME 50 / Wayland,ThinkPad E14 实测)

  1. 听写状态只有 fcitx5 辅助区纯文本:GNOME Wayland 无 layer-shell,
    GNOME 50 又移除了 X11 会话(/usr/share/xsessions 为空、gnome-shell --x11
    不存在),悬浮胶囊窗口在 GNOME 上无法存在;v2 契约也标注 Linux 无胶囊。
  2. 热键时好时坏:fcitx5-diagnose 显示 Using Wayland native input method protocol: 0——插件热键只在焦点应用恰好以 fcitx IM 模块启动时可达。焦点切到
    非 fcitx 应用后 toggle 丢失,会话卡在 Listening 持续录音 18 分钟(麦克风与
    ASR 流持续消耗),直到进程重启。
  3. 服务端抖动时的三个韧性缺口(2026-10-07 火山故障窗口实测,服务端 00:14–00:32
    收音频不识别、00:35 自愈):
    • 静默重试新连接后,旧会话 audio worker 经共享 writer 槽位把旧 seq 帧泄漏进
      新连接 → 45000000 sequence mismatch,重试必败(325 秒录音未能挽救);
    • 重试彻底失败后向已关闭 WS 持续推帧 1910 次;
    • 每次录音首块为削波垃圾(inRMS≈0.999)作为首包上行;
    • 空转写以红色 Error 胶囊呈现,用户误以为是自己出错(实际是服务端问题)。

提案(已在本机完成原型并稳定使用一周思路验证)

  1. 状态桥:emit_capsule_with_context_locked 增加 Unix socket 广播
    (~/.cache/openless/capsule-state.sock,JSON 行 state/level,30Hz);
    has_clients() 时抑制 fcitx aux 文字避免双指示。Rust 侧 ~100 行,
    #[cfg(target_os = "linux")],不影响其他平台。
  2. GNOME Shell 扩展(GJS/ESM,随附 zip):addTopChrome(reactive:false)
    悬浮渲染 GLSL Siri 流体光球(振幅主通道、亮度增益 ≤40%,对齐 Wispr Flow/
    Echo/macOS 惯例);Main.wm.addKeybinding 全局听写热键(合成器抓取,
    任意窗口可用,DBus 发 DictationKeyEvent,与插件热键天然不双触发);
    OpenLess 不在时零存在感。支持着色器 frag 热替换(2 秒调参)。
  3. 韧性修复:volcengine audio worker 加 session 代数守卫 + 发送失败 break;
    recorder 丢弃首块削波垃圾;emptyTranscript 改中性 Cancelled 胶囊。
  4. UI 电平动态化:level_handler 内噪声门+归一化+包络(静音 189 帧全 0,
    说话时幅度跟手;不影响 silence_auto_stop)。

已在本机稳定运行(听写全链路 + 光球 + 全局热键),全部代码原创、AGPL-3.0
兼容、无凭据/遥测。如果方向 OK,我可以把以上整理成分 PR 提交(状态桥+韧性
修复先行,扩展作为独立组件随后);也欢迎指出现有 v2 eframe 架构下更合适的
挂载点(Remote Input / linux-egui popup 通道)。

环境信息

  • Ubuntu 26.04.1 · GNOME Shell 50.1 · Wayland · fcitx5 5.1.19
  • OpenLess v1.3.18(deb)· 火山引擎大模型流式语音识别(API Key 链路)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions