Android (arm64-v8a) build of the Phonon-2 CPU engine?

#5
by Mr-Bizzy - opened

Hi, thanks for Phonon-2. The accuracy and speed are impressive.

We make an Android dictation app (on Google Play) that already runs Parakeet TDT 0.6B v3 on-device. Phonon-2 would cut the download from about 640 MB to 164 MB and looks much faster on CPU, so we would like to offer it as an on-device engine.

The linux-aarch64 libraries (libphonon2_enc, libphonon2_tdt) look close: they only import libc/libm/pthread symbols, which Android's bionic also provides. But they are linked against glibc (libc.so.6, GLIBC_2.17/2.27 symbol versions), so Android's linker won't load them.

Would you consider either:

  1. publishing arm64-v8a builds made with the Android NDK (API 26+), or
  2. publishing the C source of the CPU engine, so we can build it ourselves?

A short note on the C call sequence (container -> phonon2_enc_create / forward -> phonon2_tdt_decode) would also help, so we don't have to reverse it from the Python.

We'd credit Phonon-2 in the app as CC-BY-4.0 requires, and share any Android benchmarks with you. If you'd like to try the app, we're happy to add you as a tester.

Hello. Good afternoon. Yes. I agree. I would love to try this on my phone using the dictation app that I use, 4Dictate. I currently use the Parakeet v2, and it has always won out against all the other offline models.

But I'm always looking for the latest and greatest, and there is something magical about shaving milliseconds off of the return. Not to mention if this is less taxing on the processor. That's something I haven't heard about.

For Parakeet, I do a 30-second dictation. It spiked my processor quite heavily for about 2 to 3 seconds, 4 seconds maybe, and I'm on the S25 Ultra.

Anyways, would love to see it come to Android.

Thanks,

The Android build is up: https://github.com/fermionresearch/phonon/releases/tag/android-arm64-v8a-0.2.11

It holds the two libraries built with the NDK for arm64-v8a (API 26 and up): bionic imports only (libc, libm, libdl), no versioned symbol needs, 16 KB-aligned segments, in the same two ISA tiers as the Linux build (dotprod, with the i8mm kernel selected at run time, and a plain-NEON base tier), plus phonon2.h and a note on the call sequence: container records -> packed matrices -> phonon2_enc_create / set_subsampling / set_layer -> phonon2_enc_forward -> projector -> phonon2_tdt_decode_timed -> text, with the input layouts, frame counting, thread counts and return codes, and a table of every exported entry point. The libraries and header are Apache-2.0; the model weights stay under this repository's CC-BY-4.0.

The mel front end, container index, projector and detokeniser are app-side today (they're small and the note specifies them); a library that does all of that behind an audio-in / text-out call is in progress.

Happy to take you up on the tester invite, and Android numbers from your devices are very welcome here. @Hugh288 the same package will cover 4Dictate once its picked up

Thank you, that was fast. The Android build worked first time.

Measured on 73 LibriSpeech clips (481 s), through 4Dictate's own code (front end, projector and detokeniser app-side, as in your note), against Parakeet TDT 0.6B v3 int8 on sherpa-onnx 1.13.8:

Galaxy S25 Ultra (SM8750, i8mm) Galaxy Tab A9+ (SM6375, dotprod)
Phonon-2 WER 4.00 % 4.00 %
Phonon-2 median per clip 0.12 s 0.83 s
Phonon-2 model build 0.60 s 1.70 s
Parakeet median per clip 0.34 s 0.94 s
Parakeet model load 2.5 s 3.4 s

On both devices 2 threads beat 4. Resident memory was about 820 MB.

Notes on the Android doc:

  1. The shipped config.json carries the vocabulary as labels, not vocabulary or joint.vocabulary.
  2. An out-of-memory inside the library ends the process, and a Java app can't catch that. A return code would be kinder on phones with little free RAM.
  3. A recommended rule for cutting long audio (the minimum silence length) would help us match your segmenter exactly.

Phonon-2 is now an on-device option in 4Dictate (Android dictation, works in Samsung DeX), credited to Fermion Research under Apache-2.0 and CC-BY-4.0. It's going to our testers now. @Hugh288 it will reach you through the 4Dictate beta.

I can confirm that this new offline speech model on Android is awesome. I've been using Parakeet v2 for at least six months, maybe even a year. I was using it as soon as it came out, and I've tried everything against it, and it always wins until now.

This is very fast, very good, and thank you, John, aka Mr-Bizzy, for implementing it and taking care of it for your wonderful app 4Dictate. It's a welcome addition.

Incredible. Amazing. The technology is getting. Who would have thought we would get so much better than Parakeet v2 so quickly? It's not a little better. It's a lot better, especially in power consumption when it's processing for the same amount of dictation.

Parakeet seemed to, and we will test this soon, but it seemed to use double the power and double the time. Pretty impressive.

Thank you. Thank you. Thank you.

Have a great day.

Sign up or log in to comment