Skip to content

spike: Sherpa-ONNX TTS QNN EP (Kokoro/Piper) on Snapdragon HTP #1059

@lokhor

Description

@lokhor

Summary

Investigate QNN EP on Sherpa-ONNX TTS (Kokoro INT8, Piper INT8) targeting Hexagon HTP on Snapdragon 8 Gen 2+.

Why not NNAPI

Issue #852 investigated NNAPI first. The prebuilt sherpa-onnx-1.13.x AAR uses compile-time __ANDROID_API__=21 which blocks NNAPI, and upstream crash reports (#958, #3611) indicate TTS+NNAPI has stability issues even with a custom build. Closed as not planned.

QNN is the remaining HW acceleration path for Sherpa TTS.

Requirements

  1. Custom Sherpa-ONNX AAR built with SHERPA_ONNX_ENABLE_QNN=ON and target SDK 27+
  2. QNN binary model conversion — Kokoro INT8 .onnx must be converted to SoC-specific QNN binary format (SM8550/S23 Ultra) using QNN SDK tools
  3. QNN SDK native libslibQnnHtp.so, libQnnHtpPrepare.so, libQnnHtpV81Skel.so, libQnnSystem.so (~85MB) extracted from Qualcomm AI Engine Direct SDK and bundled in jniLibs/arm64-v8a/
  4. QNN runtime AARcom.qualcomm.qti:qnn-runtime:2.42.0 (Qualcomm AI Hub Model License — needs legal review)
  5. Application integration — Sherpa-ONNX has a first-class QnnConfig Kotlin class for Android integration; use provider = "qnn" + QnnConfig to pass the context binary path

Supported chipsets

Chipset HTP version Status
SM8550 (S23 Ultra) V81 Target
SM8650, SM8750 V81+ Should work
SM8850 TBD Should work

Risks

  • License: QNN SDK libs are Qualcomm AI Hub Model License — not MIT. Legal review required before shipping
  • APK size: ~85MB additional native libs
  • Model conversion effort: No pre-built TTS QNN binaries exist (only ASR). Must convert Kokoro ONNX → QNN binary using QNN SDK toolchain
  • Sherpa build complexity: Cross-compiling Sherpa with QNN for Android is non-trivial; requires QNN SDK installed in the build environment
  • Per-SoC binaries: QNN context binaries are SoC-specific — SM8550 binary won't work on SM8650

Deferred

Parked until post-launch. Not a blocker for v1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    launch:postFine to defer until after Play Store launchpriority:lowNice to have, no urgencyresearchsize:LLarge — significant complexity, 3-5 daysspiketype:spikeResearch/investigation — produces a plan, not codevoice

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions