JNI accessing shared object library (3GPP AMR codec) in linux

Hi,
We built a shared object (.so) library including the 3GPP AMR codec implementation. (NB: AMR codec is a speech encoder/decoder).
When trying to access this library from a JNI app this gives incorrect results but when trying to use the same library with a simple C program it gives the expected results !
We believe that the JNI environment makes some unexplained modification to the runtime environment that makes this library to not work correctly. Do you know what could explain this strange behaviour ?
Used JSDK: 1.4.2_10
platform: Fedora Core 4 2.6.11-1.1369_FC4
Regards,
Pascal

Hi,
Thank your for your answer!
Well I don't know if I can enter in details here but here is what's happening:
0) we built a shared object library (.so) including the 3GPP AMR codec and some functions calling the codec operations (decode, encode, etc.)
1) in the C++ JNI wrapper we call the function Speech_Decode_Frame() of the 3GPP AMR codec with in input an array of Word16 (= type "short"),
2) when we link the library created in 0) with a small .cpp program, the function Speech_Decode_Frame() returns the speech decoded correctly in a an array of Word16 as well,
3) when we used the same library with a JNI application, the call to Speech_Decode_Frame() returns only a table of zeros --> incorrect result
We're currently tracking down in the source code of the 3GPP AMR where the result array gets these 0.
We'd like to understand what in the JNI runtime environment could make the library to behave differently.
Regards,
Pascal

Similar Messages

  • Add ABAP program: validating package - error accessing shared objects-area

    When adding a new program or browsing the packages in eclipse i get an "error accessing shared objects-area".
    I can edit, save and run existing ABAP reports, however.
    There was a similar problem here, regarding database procedure proxies but the solution doesn't apply to my problem, i guess. The solution was about creating the shared memory area CL_RIS_SHM_AREA. I can't access the memory area and start the constructor, as it doesn't show up on the monitor.
    ADT 2.28
    Eclipse 4.3
    Netweaver 7.31 SP4 -> is this really compatible with ADT 2.28?
    Thanks in advance for helpful hints,
    Julian

    HI Julian,
    if the area doesn't show up in the monitor, please try to start the constructor in transaction SHMM on your own by selecting the icon 'Start Constructor' as shown in the screenshot.
    Choose CL_RIS_SHM_AREA as area, select 'Default Instance' and 'Dialog' as execution mode. Then press 'Create'. Either this works or the system will tell you the issue with the instance creation (e.g. insufficient shared objects memory - see the other solution description).
    Best regards, Sebastian

  • Er_archive with 2GB of shared object library

    I am using SS12U1 on SuSe10 linux and have run into problem of er_archive running out of memory.
    er_archive: Error: Memory capacity exceeded.
    Requested 20971520 bytes.
    One of the shared object linked at run time is 2.7G in size and er_archive runs out of memory when archiving this shared object. There is plenty of memory available in the system. Using top, I observed that er_archive was at about 4G of memory usage when it stopped due to this error.
    % file /SUNWspro-SS12U1/sunstudio12.1/prod/bin/er_archive
    /SUNWspro-SS12U1/sunstudio12.1/prod/bin/er_archive: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
    Is there a 64-bit version of er_archive available to overcome memory limitation?
    -- Saurin

    The whole suite needs a 64 bit version. I stopped using -g and optimizations higher than -xO2, not just because they introduced extra bugs, but also because they caused the compiler to run out of memory. Good luck with your huge library.

  • Can't Access Shared iTunes Library on NAS Since Using AirPort Extreme

    My original setup was a Linksys WRT54G router with a QNAP TS-119 NAS, which features a built-in iTunes server.  This setup worked perfectly on my Mac and Windows computers.
    However, I've since replaced the router with a brand new AirPort Extreme and now added the NAS to my network via an AirPort Express.  Now, when I click on the shared library in iTunes 10.5, it attempts to load the library and I can see it brefly, but it quickly disappears.
    Is there something on the AirPort Extreme that I need to configure to allow for this to work?

    try itunes 10.5.1 as 10.5.0 may have been the culprit for you

  • Using Shared Object Libraries

    How (or what) do we set when using shared object libraries?
    We have Java Native Methods which are implemented using C++ and stored in shared object libraries. We can build our project, but when trying to execute the project, the shared object libraries are not found. We had tried to set the external execution settings to include the library paths, but nothing seems to take affect.
    What do we need to set to run with the shared object libraries?

    RK,
    I appreciate your responce, hopefully we'll get this worked out. I will try to give you as much information as I can so you will hopefully understand the problem.
    We have added a Library Reference to our project - which is a jar file - this jar file contains our Business Objects which are implemented in Java. Within this Library Reference, there is a Java class which has a Native method. The method is implemented in C++ The C++ implementation of this method is within a C++ shared object library (libname.so).
    How do we let Creator know that we need to link in this C++ Shared Object Library at run time?
    The Modifers Properties for the method in the library reference are correctly set - that is they are set to Native. For a method within a java element, selecting or un-selecting this modifier simply changes the method declaration. It does not tell Creator where the actual implementation is (shared object library in this case).
    As originally stated, we tried to include our shared object library in the Execution Property of the properties window for the Java Element. Here is what we have done so far - all unsuccessful....
    Under the External Execution Property - we added the environment variable LD_LIBRARY_PATH set to our shared object library path. We also selected the Append Environment Variable (set to true). We are not able to modify the Library Path of the External Execution Property - it will not allow changes - all buttons are disabled in the pop up window.
    There are no properties for the Internal Execution within the Executor Properties, so there is nothing we can set there.
    We have tried to set the Debugger Execution properties in the same manner as the External Execution properties to run the project in Debug mode - and have the same problem - while executing the project, we get the error message which indicates that our shared object library can not be found.
    There are no property settings available on the J2EE Server Execution Properties to set.
    What do we need to set so that this Shared Object Library will be located during execution of our project under SJSC?
    Thank you for any suggestions you may have.
    --Scott                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Linking mutilple  shared objects in JNI

    Is there a way to link in mulitple shared objects in JNI. My problem stems from the fact that my C code needs to be linked with a library also. Whenever I run my java code I get an error saying that the C code needs another libary. Can this be done? I have tried using the
    -lm option to no avail.

    Yes it can be done.
    How, depends on a variety of things which are better answered in a newgroup/list that is specific to your OS and compiler/linker.

  • Can't access shared library to import.  Why?

    When trying to access sharing, library will not come up in iTunes so that it can be imported.  Can anyone tell me why?

    Rebel,
    iTunes has two kinds of sharing:  regular sharing, which allows listening but not copying, and Home Sharing, which does allow copying. 
    Make sure you are using Home Sharing, and that both computers are authorized to the relevant account.

  • How can I transfer all of my music library from my iTunes library on my PC to my iPhone without Internet connection will filesharing for home sharing allow me to access my iTunes library from my iPhone if I do not have Internet access on my PC

    How can I transfer music from my home PC in my iTunes library to my iPhone for without Internet access will home sharing allow me to access my iTunes library from my iPhone 4 without Internet

    Why don't you just sync it to your phone?

  • I can not access my itunes library on Apple TV. How do I turn on home sharing?

    I Can not access my itunes library on Apple TV. How do I turn on home sharing?

    Happy to help you :) go to seeing and than general or settings than iTunes store it's for sure in settings but you may want to set it up on your computer in which case it's (windows) edit > preferences (Mac) iTunes preferences

  • My shared iTunes library shows up fine on my Apple TV, but when I try to access the same library on my iPad to view the shared TV Shows everything jumbled and all over the place. There does not seem to be any order and many shows are missing.

    When trying to access the shared iTunes library of my Macbook Pro on my iPad(iOS 5.1) the TV Shows are all mixed up. Some shows are not even displayed. The same library display normally via my Apple TV. It appears that iPad using iOS 5 has lost the ability to recoginize that TV Shows have a main show title followed by a number of episodes eg., 'Top Gear', Season 17, Episode 1 to 6, and 'Modern Marvels', Vol lll, Episodes 1 to 16. This has to be a glitch with iOS 5 as it was working fine in previous OS versions.
    Does anyone know if Apple is aware of this anomally or is there a work-around? Thanks

    Perhaps you should ask over in the iPad community, you may get better answers there.
    It's actually my fault that psoon ended up here ... s/he intially posted over at Home Sharing, and I tried a relocate request to Apple TV rather than iPad.
    psoon, here's a link to the iPad community:
    Using iPad

  • [SOLVED] "cannot open shared object file" but library is installed

    I'm trying to run a digital logic simulation tool called "atanua" but I'm getting a missing library error:
    $ atanua
    /opt/atanua101120/atanua: error while loading shared libraries: libSDL_image-1.2.so.0: cannot open shared object file: No such file or directory
    I tried re-installing both atanua (from AUR) and sdl_image (from repos) but the error remains.
    $ ldd /opt/atanua101120/atanua | grep sdl_image
    libSDL_image-1.2.so.0 => not found
    I can find the "missing" library though:
    $ locate libsdl_image
    /usr/lib/libSDL_image-1.2.so.0
    /usr/lib/libSDL_image-1.2.so.0.8.2
    /usr/lib/libSDL_image.a
    /usr/lib/libSDL_image.so
    And so can the loader:
    $ ldconfig -v | grep sdl_image
    libSDL_image-1.2.so.0 -> libSDL_image.so
    My initial thought is that the problem is a name mismatch between the program and the system, but I don't know the proper way to fix this.  Does anyone know what I should try next?
    Here's my system specs:
    $ uname -a
    Linux 3.0-ARCH #1 SMP PREEMPT Wed Oct 19 10:27:51 CEST 2011 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ AuthenticAMD GNU/Linux
    Thanks for your help.
    Last edited by spence (2011-10-30 20:22:07)

    You're right. Some how [multilib] got disabled in my pacman.conf so I didn't spot a 32-bit version of the library.  I uncommented the [multilib] lines, searched again, and found it.  Problem solved.  Thank you.

  • Imlementing synchronized access to shared objects in LabVIEW OOP

    Many objects in object-oriented programming have an
    identity, such as a file, a front-panel object or a hardware device.
    These objects cannot be modelled using present LabVOOP (LabVIEW Object Oriented Programming) objects as
    LabVOOP objects gets copied as wire is branched; multiple different
    wires cannot all represent a single object. This issue has been
    irritating the community of LabVIEW users since the release of LabVOOP
    a few months ago.
    It seems that there is a huge demand for
    objects with unique identity i.e. by-reference objects in LabVIEW. The
    central problem why LabVOOP propably doen't have these objects is the
    difficulty in implementing synchronized access to these objects from
    multiple parallel threads. The problem of synchronized access can be
    divided into two different separate topics. First how the
    sychronization should be implemented in LabVIEW runtime engine. Second
    how this synchronization mechanism should be visible to the developer.
    I'd like to start this thread to discuss these two issues.
    Synhronization under the hood
    Traditionally
    people talk about locking of an object and about get-modify-set pass
    when accessing the object. Locking is traditionally done by acquiring a
    mutex for an object, modifying the object and releasing the mutex so
    that other threads can access the same object instance. This is how
    inter-thread synchronization is traditionally done. However, besides
    the mutex based locking, the computer science community has innovated
    also different kinds of methods on synchronizing the access to objects.
    One way to get object-level synchronization is modify the
    runtime engine so that it only allows a single method of a synchronized
    object to run at any time. This mechanism of syncrhonization is
    implemented in programming languages like O'Haskell, which is a Haskell
    variant with object orirented features.
    Also different
    transactional mechanisms[1,2] have been successful. In transactional
    mechanisms multiple threads are allowed to access a synchronized object
    simultaneously. As each method accessing an object commits their
    changes, they verify that no other object has modified the object
    simultaneously in a manner than would break the transaction. If such a
    modification has occurred, everything is rolled back. Transactional
    mechanism do not suit to every possible situation as not everything can
    be rolled back. For example it's hard to roll back an action that
    somehow modifies the physical world.
    User experience of synchronization
    How
    the synchronization is generally implemented in LabVIEW shouldn't be
    directly visible to the developer end-user. The developer should
    understand the general concepts of synchronization to take full
    advantage of it, but in general the synhronization mechanism should be
    integrated directly to development environment. There should in general
    be no need to acquire a mutex by calling acquire mutex node but instead
    the end-user should be able to specify which data needs synhronized
    access in more sophisticated way.
    In the following I propose a
    mechanism of integrating the synchronized access of by-ref objects to
    the development environemnt of LabVIEW. The proposal is very
    preliminary but I hope it breaks the ice and the community would start
    innovating in how should NI implement the syncrhonization support in
    the user interface of LabVIEW.
    Wire level synchronization
    Only
    methods can access object private data members. In synchronized access
    to the object, it's the methods accessing the private data members that
    need to be synchronized. The private data members are accessed by
    applying unbundle node to the class wire and data is written back to
    the object using bundle node.
    What I propose is the following.
    An unbundle node could either be normal or "synchronized". A
    synchronized unbundle would guarantee the access to the private data
    members in synchronized manner. All data wires originating from
    synchronized unbundle would be of synchronized type, in a little
    similar manner as a dynamic dispatch wire is of special dynamic
    dispatch type. Such a wire must evetually be connected to a bundle
    node. When the wire is bundled back to the originating object, the
    synchronization requirement is released.
    These synchronized
    wires would look somewhat different from normal wires so that the
    developer instantly knows that the wire is synchronized. The developer
    can branch the wire, but only one wire branch can own the synchronized
    type. The developer could easily select which wire would be
    syncrhonized by Ctrl+clicking the wire. Such a wire can be considered
    as a combination of a data and a mutex, even though mutexes don't need
    to be the underlying synchronization method. The wire just guarantees
    that there is a mechanism in the runtime engine that makes sure the
    access to the wire data is synchronized.
    There is a need to wire
    data originating from a non-synchronized wire to a synchronized wire so
    that it can replace the private data member of the class. This is
    accomplished with a new node similar to bundle node, that would allow
    replacing the data in a syncrhonized wire with some data originating
    from a non-synchronized wire.
    The synchronized wire can be
    connected to a front panel controls of special syncrhonized type. This
    way the synchronized wire can originate from a method and allow passing
    the synchronized data to the calling VI and back to another method.
    This is practical for example in a situation when the developer wants
    to run different analyzes to a data class but don't want to rewrite all
    the existing data analysis tools as class members. So the developers
    writes a syncrhonization acquiring getData method that let's the
    calling VI to access the syncrhonized data. Then the developer passes
    this data to an analysis VI and passes the result back to a setData
    method that writes the result back to the class wire.
    There
    will probably be technical problems in allowing the user to connect
    such a synchronized wire to all existing VIs since these VIs. Therefore
    the programming model for all nodes that do not support such
    synchronized wires will be branching the wire and passing the
    non-synchronized wire branch to the node and then bundling the result
    back to the synchronized wire.
    To increase performance and
    decrease unnecessary buffer copies when a syncrhonized wire is
    branched, if the syncrhonized wire continues directly to the new bundle
    synchronized wire node, no buffer copy is made.
    Discussion
    The
    syncrhonized access to a by-ref LabVOOP objects can be implemented in
    multiple ways by National Instruments. The synchronized access should
    be divided to two different and independent parts: 1) the user
    experience of synchronization and 2) the runtime engine synchronization
    mechanisms. As LabVOOP objects have special properties compared to
    other LabVIEW data types, optimal user experience can be gained by
    designing the user experience specifically for LabVOOP objects. From
    user experience point-of-view this syncrhonization mechanism may not
    work for other data types. Separating object syncrhonization from
    synchronization of other data types is advantageous also for other
    reasons. Due to the fact that object data can only be accessed via
    object methods, more advanced synchronization methods may be used with
    objects than can be used with other data types. O'Haskell
    synchronization implementation is an example of this. Integrating the
    synchronization directly to the user interface allows NI to change the
    mehcanisms under the hood, when computer science comes up with more
    advanced methods. Therefore NI could begin with traditional and quite
    easy mutex-based synchronization and later move to more advanced
    perhaps transaction based syncrhonization methods or even combinations
    of multiple different methods.
    I hope this topic generates
    discussion that would help NI to implement an excellent synchronization
    mechanism in LabVOOP. I hope that all talented individuals in the
    community participate this discussion to help NI to reach this goal. I
    also hope that if you just have time, it would be great if you could
    surf the computer science resources to find out what kinds of new
    techniques there exists for synchronizing access to shared resources. A
    Large community may find much more innovative solutions than a few engineers at NI. Let's give NI the power of open source design
    Tomi Maila

    Hello Tomi,
    First, thank you for taking the time to write such a well
    though-out suggestion.  Are you familiar
    with the “LabVIEW Object-Oriented Programming: The Decisions Behind the Design”
    document?  I think the reason we chose to implement a ‘by
    value’ strategy, is that is more in line with the LabVIEW programming paradigm
    of dataflow, and would make sense to most of our LabVIEW users.
    I think your suggestion is interesting, and it does
    highlight the need to think outside of the conventional LabVIEW box and look to
    some of the innovative things other languages do.  However, I think we all agree that
    synchronization takes careful planning and extra work for the programmer.  Even with an ‘ideal’ solution I see no way
    around this.  For LabVIEW users today,
    one great way to get synchronized ‘by reference’ semantics with your objects is
    to use a single-element queue to pass your object.  The queue itself is passed ‘by reference’ and
    is inherently synchronized!  The does
    have the disadvantage of adding one more small layer of complexity to your
    program, but some complexity would have to be introduced in any situation.  The other disadvantage with this is that it
    is not always an intuitive way to implement your program and requires some
    amount of LabVIEW knowledge before one would generally come across this
    technique.
    In any case, I appreciate the time and effort you put in to
    your suggestion.  Please make sure that
    you submit the suggestion formally through the NI Product Suggestion Center so
    that it can be reviewed by some of the decision makers here.
    Thanks again,
    Travis M
    LabVIEW R&D
    National Instruments

  • When I try to access my music library from AppleTV is keeps telling me to turn on ITunes Match. I am not supposed to need iTunes Match for Home Sharing. I tripled checked to ensure Home Sharing is turned on and it is. Can anyone offer a solution?

    When I try to access my music library from AppleTV is keeps telling me to turn on ITunes Match. I am not supposed to need iTunes Match for Home Sharing. I tripled checked to ensure Home Sharing is turned on and it is. Can anyone offer a solution?

    All of your computers content are available in the AppleTV section called "Computer".  This is where you will find your music.
    The Music section of the AppleTV is only for those who subscribed to iTunes Match.

  • Why can't I access my desktop library through home sharing on my laptop?, Why can't I access my desktop library through home sharing on my laptop?

    I just bought a new laptop and it has the latest update of itunes as does my desktop computer. I have turned on home sharing on both devices and am signed in to my account yet I cannot access my itunes library from my desktop on my laptop. Can you help me?
    Ollie

    If the iTunes Library.itl file is also on the external drive, try launching iTunes while holding down the Shift key, and when the dialog window opens that allows you to create a new library or open an existing one, choose to open an existing one, navigate to the folder that contains that library file and select it.
    If that works, note for the future that if you launch iTunes when that external drive isn't mounted, iTunes will default back to the normal location on the internal drive and you'll have to repeat the Shift-launch process.
    Hope this helps.

  • Access MySite Document Library of User Who has shared a document.

    Hi Team,
    I am just confused as we are facing the issue from past two days, We have SharePoint 2013 on premise and are using Mysite Application. Suppose there are two users A and B.
    If A share a document from his personal document folder to B. B recieves email notification that a document is shared and he can edit or view documents depending on the permission.
    But if B visit the A Mysite and try to access his document library he gets access denied. As per OOTB behavior B should see Shared with everyone folder and the document which has been shared with him.
    Please help me to resolve the above issue.

    Hi,
    I have done a test in my SharePoint on premise. B can see shared with everyone folder of A and documents which is been shared with B from my site.
    For  resolving your issue, you need to check whether the feature ‘Limited-access user permission lockdown mode’ is active. if it is activated, you need to deactivate it.
    Open your site with an administrator account->Click Site Settings->Click Site Collection features under Site Collection Administration->Scroll  to Limited-access user permission lockdown mode, check whether it is active. If yes, please deactivate
    it.
    I  hope this helps.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • EDI: partner profile for shipping point or plant

    I want to issue idocs for delivery notes based on shipping point or plant, not shipto party as is usual. How can I go about this? It looks like I need to create a new partner type. Or can I use logical systems? If logical system is used, then how do

  • Field name not known   in old existing report.

    We have a report that we have used for a long time and has always been fine.  Today when we open it  it says data will be lost because "Field name not known".   So you click ok and look at the report in design and the report is missing a bunch of fie

  • How can you use symbols in Windows 7 on a IMac 27

    How can you use symbols @$€%£¥ in Windows 7 on a IMac 27 mid 2011?  I tried what was normally done on Windows and got nothing.  Alt plus numbers and nothing happens, what am I missing?

  • Product Licence key code for CrystalReports11_5_Net_2005.msi

    I have installed Crsyatl Report Server XI [OEM Embedded] in our Production Server. This installation does not have 11.5.3700 assemblies, which is referenced in our Project. So we decided to install CrystalReports11_5_Net_2005.msi in our production se

  • HT4543 What to do if the fan never comes on...even when the IMAC is very hot?

    I've had my IMAC for 2 months.  I was using the computer for an extended period today whikle playionmg a game.  Game play seemed after a while but I concluded it was due to a lot of info being "worked".  Anyway, the computer was very hot after a few