Skip to content

webui: fix slow mic stop and WAV encode#22480

Merged
ServeurpersoCom merged 5 commits intoggml-org:masterfrom
ServeurpersoCom:webui/mic-stop-pcm-encode
Apr 29, 2026
Merged

webui: fix slow mic stop and WAV encode#22480
ServeurpersoCom merged 5 commits intoggml-org:masterfrom
ServeurpersoCom:webui/mic-stop-pcm-encode

Conversation

@ServeurpersoCom
Copy link
Copy Markdown
Contributor

@ServeurpersoCom ServeurpersoCom commented Apr 28, 2026

Overview

Two fix:

The first one stops the Stop button from feeling stuck after recording.
The UI now flips immediately on tap, MediaRecorder.stop() runs synchronously,
and the heavy work is deferred to a new task. The AudioRecorder also detaches
its state up front so a fast Stop then Rec does not race the previous onstop.

The second one rewrites the WAV PCM encode loop: hoisted channel arrays,
inline clamp, direct Int16Array write. Same output format, around >10x faster
in practice, which turns the freeze into an imperceptible flash.

Additional information

Master (freeze bug)

Bug.mp4

PR, Essentially this commit ed199bc, the rest is a refactor which is useful for long audio: not to freeze the main thread :

Fixed.mp4

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES Opus 4.7 Adaptive / MCP / Disposable Debian container.

@ServeurpersoCom ServeurpersoCom requested a review from a team as a code owner April 28, 2026 14:51
@allozaur allozaur requested a review from ggerganov April 29, 2026 10:24
@ServeurpersoCom ServeurpersoCom merged commit 59237bf into ggml-org:master Apr 29, 2026
6 checks passed
tekintian added a commit to tekintian/llama.cpp that referenced this pull request May 1, 2026
* 'master' of github.com:tekintian/llama.cpp: (659 commits)
  ggml-webgpu: Improve performance of mat-vec and mat-mat for MUL_MAT_ID (ggml-org#22464)
  Update llama-mmap to use ftello/fseeko (ggml-org#22497)
  common : check for null getpwuid in hf-cache (ggml-org#22550)
  vulkan: add get/set tensor 2d functions (ggml-org#22514)
  spec: fix argument typo (ggml-org#22552)
  ci : bump ty to 0.0.33 (ggml-org#22535)
  vendor : update cpp-httplib to 0.43.2 (ggml-org#22548)
  CUDA: fix tile FA kernel on Pascal (ggml-org#22541)
  scripts : add wc2wt.sh - create worktree from current HEAD (ggml-org#22513)
  add fast matmul iquants (ggml-org#22504)
  spec : fix draft model checkpoints (ggml-org#22521)
  spec : fix vocab compat checks in spec example (ggml-org#22426)
  common : do not pass prompt tokens to reasoning budget sampler (ggml-org#22488)
  hexagon: make vmem and buffer-size configurable (ggml-org#22487)
  CUDA: fuse SSM_CONV + ADD(bias) + SILU (ggml-org#22478)
  spec : disacard last drafted token with low prob (ggml-org#22506)
  sync : ggml
  ggml : bump version to 0.10.1 (ggml/1469)
  webui: fix slow mic stop and WAV encode (ggml-org#22480)
  ggml-cpu : disable tiled matmul on AIX to fix page boundary segfault (ggml-org#22293)
  ...

# Conflicts:
#	.gitignore
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
* webui: instant mic stop, race-free recorder restart

* webui: faster WAV PCM encode via hoisted channels and Int16Array

* chore: update webui build output

* webui: drop setTimeout(0) hack and harden cancelRecording

* chore: update webui build output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants