Skip to content

fix(sherpa-onnx.rn): add missing dpdfnet field to OfflineSpeechDenoiserModelConfig (Android SIGABRT)#412

Open
brainlybai wants to merge 1 commit into
deeeed:mainfrom
brainlybai:fix/offline-speech-denoiser-dpdfnet-field
Open

fix(sherpa-onnx.rn): add missing dpdfnet field to OfflineSpeechDenoiserModelConfig (Android SIGABRT)#412
brainlybai wants to merge 1 commit into
deeeed:mainfrom
brainlybai:fix/offline-speech-denoiser-dpdfnet-field

Conversation

@brainlybai
Copy link
Copy Markdown
Contributor

Summary

Fixes #411. On Android, OfflineSpeechDenoiser.newFromFile aborts the process with SIGABRT under CheckJNI because the native JNI calls GetFieldID("dpdfnet", "Lcom/k2fsa/sherpa/onnx/OfflineSpeechDenoiserDpdfNetModelConfig;") on OfflineSpeechDenoiserModelConfig, but the Kotlin data class doesn't declare that field.

This PR adds the missing OfflineSpeechDenoiserDpdfNetModelConfig data class and the dpdfnet field on OfflineSpeechDenoiserModelConfig, matching upstream sherpa-onnx Java bindings.

Crash (before)

F DEBUG: #08 CheckJNI::GetField
F DEBUG: #11 libsherpa-onnx-jni.so Java_..._OfflineSpeechDenoiser_newFromFile+56
F DEBUG: #17 com.k2fsa.sherpa.onnx.OfflineSpeechDenoiser.<init>

Test plan

  • Verified upstream sherpa-onnx/jni/speech-denoiser.cc queries the dpdfnet field unconditionally
  • Verified the prebuilt libsherpa-onnx-jni.so shipped in 1.3.1-beta.1 references dpdfnet (binary grep)
  • Applied the equivalent patch locally via pnpm patch — denoiser init no longer aborts
  • Maintainer to verify on iOS (Swift handlers should be unaffected)

Notes

  • Only Android is affected; iOS uses Swift handlers under ios/handlers/ and doesn't reflect on Kotlin classes.
  • Default value of the new field is an empty OfflineSpeechDenoiserDpdfNetModelConfig(), so existing GTCRN-only callers are not affected at runtime.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

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.

[BUG] sherpa-onnx.rn Android: OfflineSpeechDenoiser SIGABRT/CheckJNI — Kotlin OfflineSpeechDenoiserModelConfig missing dpdfnet field

1 participant