Skip to content

feat: ggml-speech#4 (iOS Metal NULL-safety) + tts-cpp 2026-05-20 (Android dynamic backends)#159

Merged
GustavoA1604 merged 2 commits into
mainfrom
tts-cpp-dynamic-android-backend
May 20, 2026
Merged

feat: ggml-speech#4 (iOS Metal NULL-safety) + tts-cpp 2026-05-20 (Android dynamic backends)#159
GustavoA1604 merged 2 commits into
mainfrom
tts-cpp-dynamic-android-backend

Conversation

@GustavoA1604

@GustavoA1604 GustavoA1604 commented May 20, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

  • tts-cpp is behind upstream: The registry still pins tts-cpp at 2026-05-07#1 / f5f914b9, before qvac-ext-lib-whisper.cpp#29 landed Android registry-only backend selection (init_gpu_backend, Adreno tier policy, EngineOptions::backends_dir / opencl_cache_dir, GGML_BACKEND_DL=ON CMake defaults). Consumers cannot pick up that stack via vcpkg until this bump.
  • ggml-speech needs iOS Metal hardening for registry init: tts-cpp’s new init_gpu_backend() walks every registered GPU backend, including Metal on Apple targets. Without qvac-ext-ggml#10 (merged as 08d39f0c on @speech), transient MTLCreateSystemDefaultDevice / ggml_metal_library_init failures could crash (e.g. EXC_BAD_ACCESS on warm iOS relaunch) instead of returning NULL and falling back to CPU.
  • Loose ggml-speech floor on tts-cpp: version>=: 2026-04-09#1 allows ancient prebuilds that lack both the Android per-arch CPU variant layout (pv3) and the Metal NULL-safety fix (pv4).

How does it solve it?

ggml-speech → port-version 4

  • Bump upstream REF to 08d39f0c on tetherto/qvac-ext-ggml@speech (PR-10 merge: iOS Metal NULL propagation through ggml_metal_device_init / ggml_metal_buffer_init and backend registration).
  • Android backend stack unchanged vs port-version 3: GGML_BACKEND_DL=ON, GGML_CPU_ALL_VARIANTS=ON, GGML_CPU_REPACK=ON, Vulkan + OpenCL MODULE .so install — only the ggml source revision moves forward from 9562ed04.
  • Non-Android targets: Metal init failures surface as a clean log + CPU fallback instead of a crash inside the Metal driver bundle.

tts-cpp2026-05-20#0

  • Bump upstream REF to 60dc1504 (Merge pull request #29 on tetherto/qvac-ext-lib-whisper.cpp@master; content commit 907f3151).
  • Tighten dependency from ggml-speech >= 2026-04-09#1 to >= 2026-04-09#4, so manifest resolutions pull the Metal-safe ggml build this port is validated against.
  • Portfile comment documents the PR QVAC-5031: Synced llama-cpp port with upstream build b5932 #29 behavior for the next bump.

Breaking changes

None for consumers that already rebuild from the registry baseline. Version ordering:

Port Before (baseline) After
ggml-speech 2026-04-09#3 2026-04-09#4
tts-cpp 2026-05-07#1 2026-05-20#0

Android installs continue to require staging libqvac-speech-ggml-*.so next to the host .bare module (unchanged since pv3).

Consumer impact

Consumer Action
@qvac/tts-ggml Will resolve tts-cpp >= 2026-05-20#0 once the registry baseline updates; follow-up PR should wire backendsDir / openclCacheDir into EngineOptions (mirror @qvac/transcription-parakeet).
@qvac/transcription-parakeet No portfile change required; rebuild picks up ggml-speech#4 automatically. Optional follow-up: tighten manifest to ggml-speech >= 2026-04-09#4 for explicit iOS safety.
Other speech-stack ports parakeet-cpp / whisper-cpp benefit from ggml-speech#4 on the next vcpkg refresh.

GustavoA1604 and others added 2 commits May 20, 2026 17:33
Picks up the iOS Metal NULL-safety hardening from
tetherto/qvac-ext-ggml#10 (PR-10's 3 commits f21ff9a0 + b7dc01c7 +
0f54d9f7) now merged into the `speech` branch as PR-10 merge
08d39f0c.

Android backend stack unchanged: GGML_CPU_ALL_VARIANTS=ON +
GGML_CPU_REPACK=ON shape introduced in port-version 3 stays. Only
the Apple Metal init path changes -- transient
`MTLCreateSystemDefaultDevice` / `ggml_metal_library_init` / buffer-
alloc failures now surface as a clean
`ggml_backend_metal_init: error: Metal device init failed - falling
back to CPU` log line + NULL return, instead of crashing inside
AGXMetalG17P.bundle with EXC_BAD_ACCESS (observed on iPhone 16 /
iOS 26.4 warm relaunches).

Co-authored-by: Cursor <cursoragent@cursor.com>
Pulls in the Android dynamic-backend selection landed on
tetherto/qvac-ext-lib-whisper.cpp@master via PR #29 (merge 60dc1504,
content commit 907f3151): registry-only `init_gpu_backend()`
(Adreno 700+ -> OpenCL, every other GPU -> Vulkan / Metal / CUDA),
new EngineOptions::backends_dir / opencl_cache_dir fields wired
through to `tts_cpp::detail::set_backends_directory` /
`tts_cpp::detail::set_opencl_cache_dir`, and the GGML_BACKEND_DL=ON
Android CMake defaults so `ggml_backend_load_all_from_path()`
discovers per-arch CPU + Vulkan + OpenCL .so files installed
alongside the bare module.

Also tightens the ggml-speech dependency to `version>=: 2026-04-09#4`
so consumers without an explicit constraint of their own pull
ggml-speech port-version 4 (PR-10 iOS Metal NULL-safety) instead of
the registry baseline #1. tts-cpp's new `init_gpu_backend()` walks
the registry blindly and a NULL-from-Metal-init is now handled
cleanly thanks to PR-10, so #4 is the lowest version this port is
safe against.

Co-authored-by: Cursor <cursoragent@cursor.com>
@GustavoA1604 GustavoA1604 changed the title Tts cpp dynamic android backend feat: ggml-speech#4 (iOS Metal NULL-safety) + tts-cpp 2026-05-20 (Android dynamic backends) May 20, 2026
@GustavoA1604 GustavoA1604 merged commit 79b65a4 into main May 20, 2026
2 checks passed
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