-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pnpm tauri android build --> mismatches between *const i8 and *const u8 #72
Comments
Reading through the codebase, I think there's a lot of potentially unnecessary extra complexity here. Instead of trying to manage what the native integer type is, why not use |
Thanks @vlovich I created #78 Do you know if I can simplify the way I pass and free strings from Rust to C as well? - sherpa-rs/crates/sherpa-rs/src/utils.rs Lines 12 to 49 in 548e2f3
Here I store them in variable so they won't free until the end of the scope sherpa-rs/crates/sherpa-rs/src/tts/kokoro.rs Lines 26 to 30 in 548e2f3
|
I released new version, if the issue persists feel free to reopen the issue |
@thewh1teagle if I'm not mistaken, the RawCString class isn't really doing anything extra on top of CString and call .as_ptr to retrieve the pointer. So I think you could just get rid of RawCString use CString directly rather than leaking/restoring ownership. On an unrelated note, I wanted to point out that the recognizer API takes in an owned Vec but that implies you need far more ownership than you need since the Sherpa API only uses the contents for the duration of the transcribe API and not any longer. When ownership of something is contained within a function call, it's a better practice to accept a reference to the most generic type that meets your needs. In this case it would be &[f32] since you only need a slice of audio samples regardless of how externally they're stored (similar to how you'd accept a &str instead of String/&String if the string's lifetime is only needed for the duration of the function) |
pnpm tauri android dev and build now works ! yay ! ..however my app crashes - and after some adb logcat squinting I find ... "AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libsherpa-onnx-c-api.so" not found: needed by /data/app/~~tBCrXNhgm4UdkNwlHficCw==/com.odd.dev-zmNYNjfdO8zF-zKo3_ujGA==/base.apk!/lib/arm64-v8a/libtauri_mobile_neo_lib.so in namespace clns-7 " Not sure if I did something wrong in my setup - but it seems it can't find libsherpa-onnx-c-api.so I can see there's a link... ..that leads to... So it looks like all should be fine ? Yet logcat says it can't find the file when running the app ( dev and build ) Any ideas ? Opened the issue here --> #79 |
I created it to centeralize the logic of how actually get the pointer for the cstring and drop it, with potential to improve it in one place.
Can you show me which recognizer you reffered to? |
sherpa-rs/crates/sherpa-rs-sys/dist.json Lines 25 to 28 in 93e1cfa
You need to make sure that these shared libraries available in runtime in the Android. usually you need to place them in the Android JniLibs/ (Google/LLM it) |
YES ! App no longer crashes ! There's only a symlink for for libtauri_mobile_neo_lib.so ( not the other two ) in so I copied from to ..and now it works. That said - my VAD no longer initialise... ..so perhaps some VAD bundling problem ( on my side ) - looking at that now. |
I get that. I'm just highlighting that CString already does that. It's possible you're planning additional capabilities for the class, just saying right now it's identical to CString with no extra functionality unless I'm misreading the code. Re the recognizer, I was working with the whisper recognizer. |
Yes currently that's all it does |
CString is literally that - when the reference drops the memory is freed. Are you perhaps confusing it with CStr which is like str? |
What happened?
pnpm tauri android dev works fine.
..however - pnpm tauri android build --> mismatches between pointer types *const i8 and *const u8
" expected raw pointer
*const i8
found raw pointer*const u8
"Steps to reproduce
What OS are you seeing the problem on?
MacOs / MacBookPro M1 Max
Relevant log output
The text was updated successfully, but these errors were encountered: