Skip to content

fix: UAC aplay 欠载恢复 + 大缓冲 - #285

Closed
arounyf wants to merge 1 commit into
mofeng-git:mainfrom
arounyf:fix/hid-reload-on-gadget-rebuild
Closed

fix: UAC aplay 欠载恢复 + 大缓冲#285
arounyf wants to merge 1 commit into
mofeng-git:mainfrom
arounyf:fix/hid-reload-on-gadget-rebuild

Conversation

@arounyf

@arounyf arounyf commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

UAC USB 麦克风透传功能已在 PR #282 合并。此 PR 为补充修复。

修复内容

  1. 空闲后重新连接时强杀旧 aplay — 避免复用时处于欠载坏状态导致无声音
  2. aplay buffer-size 16384 → 32768 — 680ms 缓冲,容忍 WebSocket/Opus 编码抖动
  3. aplay stderr → /dev/null — 抑制持续欠载警告刷屏
  4. 空闲超时 2s → 5s — 更宽容语音停顿

变动

单文件 src/audio/uac_streamer.rs

- Bump buffer-size 32768 (680ms) to tolerate WebSocket jitter
- Force-spawn fresh aplay when resuming after idle (was_idle flag)
- Extend idle timeout 2s→5s for speech pauses
- Suppress aplay stderr (underrun noise)
@arounyf arounyf changed the title fix: UAC aplay underrun recovery and larger buffer fix: UAC aplay 欠载恢复 + 大缓冲 Jul 23, 2026
@mofeng-git

Copy link
Copy Markdown
Owner

后面进行了重构,PCM 直接写 ALSA 设备,去除了 aplay 外部程序依赖,也能获取更详细的工作状态:
image

image

所以就关闭此 pr 了

@mofeng-git

Copy link
Copy Markdown
Owner

5963dfa

@mofeng-git mofeng-git closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants