Local Piper TTS engine fails to initialize on macOS M-series architecture
Summary
When enabling local Piper Text-to-Speech (TTS), the application encounters a 10-second initialization timeout and fails to generate voice output. The underlying failure is caused by an architecture mismatch, as the application downloads Intel (x86_64) binaries instead of native Apple Silicon (arm64) versions.
Problem
What Happened vs. Expected: After installing Piper, choosing a voice, and selecting the test option, the TTS test failed. Expected the test to pass successfully.
Impact: Local voice synthesis is entirely non-functional on all M-series (M1/M2/M3/M4) Macs out of the box.
Version / Platform:
- OS: macOS (Apple Silicon / arm64 architecture)
- App Version: Version 0.61.8 (0.61.8)
Steps to Reproduce:
- Install and launch OpenHuman on an Apple Silicon Mac.
- Navigate to settings and enable the local Piper TTS engine.
- Choose a voice and select the "Test" button.
- Observe that the test fails to execute.
Solution
Suspected Cause:
The application's asset downloader fetches a deployment bundle containing legacy Intel (x86_64) binaries rather than native Apple Silicon (arm64) binaries, compounded by incorrect file permissions. This conclusion was drawn through the following diagnostic steps:
- Log Analysis: Reviewed the application logs, which revealed a 10-second initialization hang followed by
dylddynamic library loading errors. - Sandbox Inspection: Located and inspected the local binary sandbox directory automatically generated by the application at
~/.openhuman/bin/piper/. - Architecture Verification: Checked the compilation architecture of the extracted binaries (
piper,piper_phonemize, andespeak-ng), confirming they were built forx86_64instead of nativearm64. - Permissions Check: Audited the file permissions within the sandbox directory and found that the
espeak-ngbinary lacked standard executable (+x) permissions.
Proposed Fix:
- Recompile or re-package the
piper_macos_aarch64asset bundle on the distribution server to include genuine nativearm64binaries forpiper,piper_phonemize, andespeak-ng. - Ensure the decompression workflow explicitly sets or preserves the executable permissions (
chmod +x) for the internal binaries.
Acceptance criteria
-
[ ] Repro gone — Bug no longer reproduces on the stated environment (or root cause documented if intentional).
-
[ ] Regression safety — Unit, integration, or E2E coverage added or updated if this should not come back.
-
[ ] Diff coverage ≥ 80% — the fix PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by
.github/workflows/ci-lite.yml). -
[ ] … — Other verify-before-close items.
Related
- None / N/A
Implementation Plan
Triage Assessment
This issue is relevant and not a duplicate. The user reports Piper TTS failing on M-series Macs with a 10-second timeout, finding x86_64 binaries in the sandbox directory and missing executable permissions on espeak-ng. Local TTS is entirely non-functional on all M-series Macs out of the box. The architecture detection code at src/openhuman/inference/local/install_piper.rs:76-84 correctly resolves piper_macos_aarch64.tar.gz on arm64 hosts -- the exact location of the bug depends on whether the upstream archive contains wrong-architecture binaries, or the extraction/permissions path is faulty.
Proposed Scope
In-scope:
- Verify what
piper_macos_aarch64.tar.gzfrom the upstream Piper release actually contains (architecture of the bundled binaries). - Fix the extraction step to set executable permissions (+x) on all extracted binaries.
- Log the detected architecture and the downloaded archive name for diagnostics.
Explicit non-goals:
- Rebuilding Piper for arm64 (upstream already ships arm64 builds).
- Supporting additional voice models beyond the bundled
en_US-lessac-medium. - Changing the voice download path or HuggingFace voice model resolution.
Implementation Steps
-
Verify upstream asset content
- Download
piper_macos_aarch64.tar.gzfromhttps://github.com/rhasspy/piper/releases/latest/download/piper_macos_aarch64.tar.gzon an M-series Mac. - Extract and run
file piper piper_phonemize espeak-ngto confirm architecture. - If the archive contains x86_64 binaries (the
fileoutput shows "Mach-O 64-bit executable x86_64"), the bug is upstream. File an issue with the Piper project or switch to a known-good release tag. - If the archive contains arm64 binaries (file shows "Mach-O 64-bit executable arm64"), the bug is in extraction/permissions.
- Download
-
Fix file permissions on extracted binaries
- File:
src/openhuman/inference/local/install_piper.rs. After the archive is extracted (in the install flow, probably aroundextract_tar_gzorextract_zipcall sites), addstd::fs::set_permissionscalls to setstd::os::unix::fs::PermissionsExt::set_mode(0o755)onpiper,piper_phonemize, andespeak-ng. - File:
src/openhuman/inference/local/voice_install_common.rs-- if the extraction logic is shared across whisper and piper installers, add the permissions fix there as a post-extraction step for all extracted binaries. This prevents the same issue from affecting Whisper. - The
espeak-ngbinary is inside the archive as a sibling ofpiper. Confirm the extraction path: find where the archive is unpacked (likely thepiper/subdirectory of the workspacebin/directory configured atsrc/openhuman/inference/paths.rs:271).
- File:
-
Add architecture diagnostics
- File:
src/openhuman/inference/local/install_piper.rsfunctionbinary_download_asset()(lines 66-100). Log the detectedstd::env::consts::ARCHand the chosen suffix, e.g.:log::info!("{LOG_PREFIX} host arch={arch}, selecting asset=piper_{suffix}.tar.gz"); - After extraction, log the file permissions stance of the extracted binary, e.g.:
log::debug!("{LOG_PREFIX} extracted piper binary permissions: {:o}", piper_path.metadata()?.permissions().mode());
- File:
-
Improve error messages
- File:
src/openhuman/inference/local/install_piper.rs. The installer currently validates archive size (MIN_BINARY_ARCHIVE_BYTES) and voice file sizes. Add a post-extraction check: verify at least one extracted binary has executable permission. If not, log a diagnostic "extracted binaries lack execute permission -- applying fix" and apply it.
- File:
Verification
- Unit tests (Rust):
src/openhuman/inference/local/install_piper_tests.rsorsrc/openhuman/inference/local/voice_install_common_tests.rs-- add a test that creates a mock archive, runs the extraction, and verifies+xis set on the extracted binary.- The existing
tests/raw_coverage/inference_local_ops_piper_raw_coverage_e2e.rstests already exercise the install flow using a mock server. ExtendPiperMockStateto serve an archive that would trigger the permissions issue, and verify the fix applies+x.
- Manual verification (ARM Mac required):
- Run
install_piperon an M-series Mac and confirm:- The log shows the correct
aarch64architecture. - The downloaded filename contains
macos_aarch64. - After extraction,
file ~/.openhuman/bin/piper/piper/pipershowsarm64. ls -la ~/.openhuman/bin/piper/piper/espeak-ngshows-rwxr-xr-x(executable).- The "Test" button in Settings -> Voice -> Piper TTS produces audible speech.
- The log shows the correct
- Run
Risks and Open Questions
- Upstream Piper providing wrong-architecture binaries. If the upstream
piper_macos_aarch64.tar.gzactually contains x86_64 binaries, the fix is out of our hands (file an upstream issue). In that case, the code-level fix is to add a post-extractionlipo/filecheck that warns the user and falls back to running under Rosetta, or pins to a known-good release tag. - Rosetta fallback. If the upstream archive contains x86_64, the binary would still run under Rosetta (slower startup, hence the 10-second timeout). Adding a
--rosettadetection and warning would help users self-diagnose. - CI cannot test native ARM Mac. The existing mock-based tests cover the install flow but not the actual binary execution. Manual testing on M-series hardware is required for final verification.
Acceptance Criteria
- Piper TTS installation on an M-series Mac downloads the correct arm64 archive.
- Extracted binaries (piper, piper_phonemize, espeak-ng) have executable permissions.
- The "Test" button in Voice settings produces audible speech on M-series Macs.
- Post-extraction logging includes architecture and permissions diagnostics.
- Existing mock-based installer tests pass unchanged.
this bug is present on your first release and also present not resolved.... is functional only whith pay... BUUUUUUUU delete your app.
Solved? Where Is the release that patch the problem. Last release have same problem
Gianluca Fiuzzi
Il lun 27 lug 2026, 18:11 Mega Mind @.***> ha scritto:
Closed #5045 https://github.com/tinyhumansai/openhuman/issues/5045 as completed via #5216 https://github.com/tinyhumansai/openhuman/pull/5216.
— Reply to this email directly, view it on GitHub https://github.com/tinyhumansai/openhuman/issues/5045?email_source=notifications&email_token=B7CASJBEFSFGGOHP5JTKNO35G55KDA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBVGQ4TENJRGE3TPJTSMVQXG33OU5RW63LNMVXHJJLFOZSW45FMMZXW65DFOJPWG3DJMNVQ#event-28549251177, or unsubscribe https://github.com/notifications/unsubscribe-auth/B7CASJBTMYQUVRMSKVYNJJ35G55KDAVCNFSNUABGKJSXA33TNF2G64TZHMYTCNRRGE3DGMJYGI5US43TOVSTWNBZGI2DOMJTGM4TFILWAI . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/B7CASJDJL5JO2WPCCO6FNZL5G55KDA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBVGQ4TENJRGE3TPJTSMVQXG33OU5RW63LNMVXHJJLFOZSW45FKMZXW65DFOJPWS33T and Android https://github.com/notifications/mobile/android/B7CASJGJDS4MEZ3FMYK2U535G55KDA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBVGQ4TENJRGE3TPJTSMVQXG33OU5RW63LNMVXHJJLFOZSW45FOMZXW65DFOJPWC3TEOJXWSZA. Download it today! You are receiving this because you commented.Message ID: @.***>