Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8759077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:42:39+00:00 2026-06-13T14:42:39+00:00

I’m going crazy here. Basically, I’m trying to access some functions in a shared

  • 0

I’m going crazy here.

Basically, I’m trying to access some functions in a shared library located in system/lib/ on the android platform, using the NDK.

The library I’m trying to make use of is libsonivox.so. My main goal is to use it from a NativeActivity. I understand this can complicate things because I would need to load this library (statically) before I load my own library which depends on it. Therefore I am trying to get it to work through a regular Activity and JNI.

In the Activity I load the libraries like so:

static {
  System.loadLibrary("sonivox");
  System.loadLibrary("native-audio-jni");
}

The “native-audio-jni” library is from the NDK samples, but I am modifying it in a rudimentary attempt to access the sonivox functions.

Without any calls to libsonivox from libnative-audio-jni, everything compiles fine.
This line from the LogCat output gives me hope:

  04-26 15:01:14.973: D/dalvikvm(691): No JNI_OnLoad found in /system/lib/libsonivox.so   
  0x412a1100, skipping init

So the library is loaded.

Then I add this function to native-audio-jni.c:

void Java_jay_enn_eye_JNImidiActivity_createMidi(JNIEnv* env,
        jclass clazz)
{
  pLibConfig = EAS_Config();
}

pLibConfig is declared like this:

static const S_EAS_LIB_CONFIG* pLibConfig = NULL;

When that is declared, without the addition of the above function, it compiles fine. So at least the header files are… there.

When I plop that function into the code, this is the output of ndk-build:

  Compile thumb  : native-audio-jni <= native-audio-jni.c
  SharedLibrary  : libnative-audio-jni.so
  ./obj/local/armeabi/objs/native-audio-jni/native-audio-jni.o: In function
  `Java_jay_enn_eye_JNImidiActivity_createMidi':
  /home/anthony/Documents/eclipse/JNImidi/jni/native-audio-jni.c:202: undefined   
  reference
  to `EAS_Config'
  collect2: ld returned 1 exit status
  make: *** [obj/local/armeabi/libnative-audio-jni.so] Error 1

I’m not sure if libnative-audio-jni just can’t access libsonivox, or if I need to dlsym() or sym() link the sonivox functions to use them. I haven’t been able to try either of those since the library is found in system/lib/ and not provided by me, so I don’t have a full path to provide to do that.

Another option I am considering is grabbing libsonivox.so, copying it into a directory in the project, and changing the Android.mk so that it includes the lib as a prebuilt shared library. I was thinking maybe the library needs to be included at compile time.

EDIT: Here’s the Android.mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := native-audio-jni
LOCAL_SRC_FILES := native-audio-jni.c
# for native audio
LOCAL_LDLIBS    += -lOpenSLES
# for logging
LOCAL_LDLIBS    += -llog
# for native asset manager
LOCAL_LDLIBS    += -landroid

include $(BUILD_SHARED_LIBRARY)

This must be where something isn’t right. I’d think the sonivox library would need to be present when compiling everything. However, the library won’t load no matter what changes I make to this file, which have mainly involved trying to include it as a PREBUILT_SHARED_LIBRARY or PREBUILT_STATIC_LIBRARY. Also, the OpenSL stuff works perfectly fine. I wish sonivox would work if I were to just include it as -lsonivox, but no.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:42:40+00:00Added an answer on June 13, 2026 at 2:42 pm

    I got carried away with other things, but I figured out the answer to this recently…
    libsonivox.so can be loaded dynamically. You need to copy the .so from your android device and place it in $NDK-ROOT/platforms/android-14/arch-arm/usr/lib, “android-14” can be whatever version instead.
    That way it can be compiled against, and when the app is running on a device it uses the library on that device.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.