Skip to content

Update mlx-swift to 0.30.6 — fixes static audio on iPhone 16 Pro - #29

Open
whothisbeme wants to merge 1 commit into
mlalma:mainfrom
whothisbeme:fix/mlx-swift-0.30.6-nax-fix
Open

Update mlx-swift to 0.30.6 — fixes static audio on iPhone 16 Pro#29
whothisbeme wants to merge 1 commit into
mlalma:mainfrom
whothisbeme:fix/mlx-swift-0.30.6-nax-fix

Conversation

@whothisbeme

Copy link
Copy Markdown

Summary

  • Updates mlx-swift dependency from exact: "0.30.2" to from: "0.30.6"
  • mlx-swift 0.30.2 produces static/corrupted audio on iPhone 16 Pro due to two NAX bugs fixed in 0.30.6
  • Changes pin style from exact to from to allow downstream consumers to resolve compatible versions

Problem

On iPhone 16 Pro (A18 chip), Kokoro TTS generates white noise / static instead of speech when using mlx-swift 0.30.0–0.30.3. Audio sample values range -11 to +11 instead of the expected -0.33 to +0.54.

Root Cause

Two bugs in mlx-swift's upstream mlx library:

  1. Incorrect NAX hardware detection (ml-explore/mlx#3083) — The A18 chip (generation 17) was incorrectly detected as having Neural Accelerator (NAX) support, which is only available on generation 18+ (iPhone 17 Pro). When NAX was wrongly enabled, computations produced silently wrong numerical results.

  2. NAX overflow in ConvTransposed1d (ml-explore/mlx#3092) — On iOS, transposed convolutions produced incorrect output for large tensors (time dimension > ~8000), directly affecting Kokoro's vocoder.

Both fixes are included in mlx-swift 0.30.6.

Testing

Verified with kokoro-ios 1.0.10 + mlx-swift 0.30.6 on iPhone 16 Pro — clear audio output with correct sample values.

Related Issues

mlx-swift 0.30.2 produces static/corrupted audio on iPhone 16 Pro
due to two NAX (Neural Accelerator) bugs:

1. Incorrect NAX hardware detection on A18 chip (ml-explore/mlx#3083)
   - A18 (gen 17) was wrongly detected as having NAX support (gen 18+)
   - Caused silently wrong numerical output instead of a crash

2. NAX overflow in ConvTransposed1d (ml-explore/mlx#3092)
   - Incorrect output for large tensors (time dim > ~8000)
   - Directly affects Kokoro's vocoder transposed convolutions

Both fixes are included in mlx-swift 0.30.6. Using `from:` instead
of `exact:` allows downstream consumers to resolve compatible versions.

Relates to: mlalma/KokoroTestApp#7, ml-explore/mlx-swift#344
dakshaymehta added a commit to dakshaymehta/kokoro-ios that referenced this pull request Apr 10, 2026
mlx-swift 0.30.2 has two NAX bugs that cause static/corrupted audio:
- Incorrect NAX hardware detection (ml-explore/mlx#3083)
- NAX overflow in ConvTransposed1d (ml-explore/mlx#3092)

Both fixed in mlx-swift 0.30.6. Also changes pin style from exact
to from to allow downstream consumers to resolve compatible versions.

Ref: mlalma#29
mikaelhatanpaa added a commit to mikaelhatanpaa/kokoro-ios that referenced this pull request May 20, 2026
mlx#3083 (NAX hardware detection wrong on A18) and mlx#3092 /
mlx-swift#344 (ConvTransposed1d produces partially-wrong output when
T > ~8000 on iOS Metal) combine to produce alternating clean speech /
sustained tinnitus-like buzz mid-content when Kokoro's vocoder runs
on iPhone. PCM samples appear clean (peak ~0.5) but ~50% of frames in
the bad region are garbage at T > 15840.

Fixed in 0.30.6+; confirmed clean by mlalma/kokoro-ios PR mlalma#29.
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.

1 participant