Comments (10)
The reason to use dlopen() and dlsym() for linking AAudio is so that your app can be be loaded on new or old Android versions. If AAudio is not supported then dlopen() will return an error. Then your app can decide to use OpenSL ES or fail gracefully.
If you did not use dlopen() then your app would not even load on old versions of Android.
from android-audio-high-performance.
I am getting the same error in Android Studio 3.0:
Process: com.google.sample.com.google.sample.aaudio.play, PID: 27578
java.lang.UnsatisfiedLinkError: dlopen failed: library "libaaudio.so" not found
from android-audio-high-performance.
The problem is in /hello-aaudio/hello-aaudio.gradle:
'-DANDROID_PLATFORM=android-26'
this means the app cannot run on anything lower than Android O. If you try to recompile with android-21, it won't compile.
from android-audio-high-performance.
Yeah, it must run on Android-O: AAudio is only enabled on Android - O; and this version of the audio sample must be run on Android-O-Beta1 (documentation call it Developer Preview version 2 ): because the callback mechanism only enabled in Android O Image in the second developer preview ( released on 05/17/2017 ) or later formal release
from android-audio-high-performance.
@ggfan According to this talk at IO - https://www.youtube.com/watch?v=C0BPXZIvG-Q -
It should be possible to use aaudio_wrapper
with dlsym
to run on earlier platforms. Is that true?
from android-audio-high-performance.
No, not the AAudio API, but the wrapper layer API ( it sits on top of openSL ES and AAudio ), I do not know what will be the final name for it ( I only knew the internal name, it will not help: its final name I did not know ). that lib will be open source project, and be added into this repo when it is ready; it will NOT be inside android framework. Phil's talk today does not have time to get more details on it; but his talk for Android Developer Preview 1 addressed that more.
I tried to have this Android-O requirement in the readme file for THIS sample:
https://github.com/googlesamples/android-audio-high-performance/blob/master/aaudio/README.md
Will add code to check on target android device's API level, if less than 26, will gracefully fail.
from android-audio-high-performance.
@philburk Wouldn't it be prudent to invoke dlsym in this sample, and target lower SDKs?
from android-audio-high-performance.
The purpose of the sample code is only to demonstrate how AAudio works. AAudio does not run on lower SDKs so the sample wouldn't run.
Auto-switching between AAudio and OpenSL ES is a good thing but beyond the scope of this sample. I worry that if samples do too much then it obscures the essential information.
from android-audio-high-performance.
I am adding code to check for API level and fail gracefully.
The sample right NOW is not using dlopen/dlsym(), the init code for that is inside third_party directory, that is more of personal -- developers to choose that way or traditional way ( it is more of convenience to my development ). officially we kind of like to make the sample to be somewhat depends on new NDK ( with dlopen / dlsym in the sample, NDK-15 is not necessary, that could be a benefit )
from android-audio-high-performance.
#49 is merged: it should not load APK if target is NOT android-O.
from android-audio-high-performance.
Related Issues (20)
- Fresh clone fails with CMake HOT 4
- [aaudio/hello-aaudio] leaks a thread in error callback HOT 1
- SimpleSynth doesn't compile because of errno HOT 2
- SimpleSynth should have a 10min timer to make it easy to comply with the CDD HOT 1
- SimpleSynth should be published on the Play store to make it easy to comply with the CDD HOT 1
- Keeping lib-oboe in synch HOT 3
- Recommended Android API/Library to use for simple Audio effects playback? HOT 1
- AudioManager set MODE_IN_COMMUNICATION mode cause AAUDIO_ERROR_DISCONNECTED HOT 1
- add oboe echo to retire all other echo samples HOT 2
- new logo / icon HOT 1
- SetPitch or SetRate HOT 1
- Cannot build SimpleSynth in AndroidStudio HOT 3
- Running echo on a Mate 20 Pro HOT 4
- AAudio samples should close their audio stream on pause (and open on resume) HOT 1
- Not working out-of-the-box as Android Studio AAudio sample project HOT 1
- i want to add delay in real time playback ... i have try this . i want to add delay like 2 second , 3 second and so on HOT 1
- [hello-oboe] fatal error: 'SLES/OpenSLES.h' file not found HOT 1
- [hello-oboe] Warning "Using custom NDK path (ANDROID_NDK is set):" HOT 1
- No c++ compiler optimizations? HOT 5
- Enable building Oboe from the command line HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-audio-high-performance.