Fix OpenAL Soft for Android

* Upgrade to latest OpenAL Soft (1.16)
 * Don't specify TARGET_PLATFORM on command line as that causes weird issues
 * Specify target platform via APP_PLATFORM in Application.mk and TARGET_PLATFORM in Android.mk
experimental
shadowislord 10 years ago
parent 4050b7cbbf
commit 393009ec2d
  1. 23
      jme3-android-native/openalsoft.gradle
  2. 92
      jme3-android-native/src/native/jme_openalsoft/Android.mk
  3. 2
      jme3-android-native/src/native/jme_openalsoft/Application.mk
  4. 206
      jme3-android-native/src/native/jme_openalsoft/config.h

@ -1,9 +1,5 @@
// OpenAL Soft r1.15.1 // OpenAL Soft r1.16
//String openALSoftUrl = 'http://repo.or.cz/w/openal-soft.git/snapshot/9b6a226da55a987cb883f425eeb568776ea12c8d.zip' String openALSoftUrl = 'http://repo.or.cz/w/openal-soft.git/snapshot/e5016f814a265ed592a88acea95cf912c4bfdf12.zip'
// OpenAL Soft r1.15.1 + Android OpenSL Support
String openALSoftUrl = 'http://repo.or.cz/w/openal-soft.git/snapshot/be25e6802dacad78876c6fa1d6a5c63797b8a9ed.zip'
// OpenAL Soft r1.15.1 latest build (at the time)
//String openALSoftUrl = 'http://repo.or.cz/w/openal-soft.git/snapshot/3f5914e0949ee12b504ee7254990e007ff8057ef.zip'
String openALSoftZipFile = 'OpenALSoft.zip' String openALSoftZipFile = 'OpenALSoft.zip'
// OpenAL Soft directory the download is extracted into // OpenAL Soft directory the download is extracted into
@ -81,22 +77,23 @@ task generateOpenAlSoftHeaders(dependsOn: copyJmeOpenALSoft) << {
String classes = "" String classes = ""
.concat("com.jme3.audio.android.AndroidOpenALSoftAudioRenderer, ") .concat("com.jme3.audio.android.AndroidOpenALSoftAudioRenderer, ")
// println "openalsoft classes = " + classes // println "openalsoft classes = " + classes
// println "openalsoft destDir = " + destDir // println "openalsoft destDir = " + destDirPath
// println "openalsoft classpath = " + project.projectClassPath // println "openalsoft classpath = " + project.projectClassPath
ant.javah( exec {
classpath: project.projectClassPath, executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah')
destdir: destDirPath, args '-d', destDirPath
class: classes args '-classpath', project.projectClassPath
) args "com.jme3.audio.android.AndroidOpenALSoftAudioRenderer"
}
} }
task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders) { task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders) {
// println "openalsoft build dir: " + openalsoftBuildDir // println "openalsoft build dir: " + openalsoftBuildDir
// println "ndkCommandPath: " + project.ndkCommandPath // println "ndkCommandPath: " + project.ndkCommandPath
args 'TARGET_PLATFORM=android-9'
workingDir openalsoftBuildDir workingDir openalsoftBuildDir
executable rootProject.ndkCommandPath executable rootProject.ndkCommandPath
args '-j8'
} }
task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) { task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) {

@ -1,58 +1,68 @@
TARGET_PLATFORM := android-9 TARGET_PLATFORM=android-9
ROOT_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
########################################################################################################
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := openalsoftjme LOCAL_MODULE := openalsoftjme
LOCAL_ARM_MODE := arm
LOCAL_PATH := $(ROOT_PATH)
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include $(LOCAL_PATH)/OpenAL32/Include
LOCAL_CFLAGS := -ffast-math -DAL_BUILD_LIBRARY -DAL_ALEXT_PROTOTYPES LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/include \
LOCAL_LDLIBS := -llog -Wl,-s $(LOCAL_PATH)/OpenAL32/Include $(LOCAL_PATH)/Alc
LOCAL_LDLIBS += -lOpenSLES
# LOCAL_CFLAGS += -DPOST_FROYO #-I$(ANDROID_NDK_ROOT)/platforms/android-9/arch-arm/usr/include/ LOCAL_CFLAGS := -std=c99 -ffast-math -DAL_BUILD_LIBRARY -DAL_ALEXT_PROTOTYPES
# LOCAL_LDLIBS += -ldl -L$(ANDROID_NDK_ROOT)/platforms/android-9/arch-arm/usr/lib/ LOCAL_LDLIBS := -lOpenSLES -llog -Wl,-s
LOCAL_SRC_FILES := OpenAL32/alAuxEffectSlot.c \ LOCAL_SRC_FILES := Alc/backends/opensl.c \
Alc/backends/loopback.c \
Alc/backends/wave.c \
Alc/backends/base.c \
Alc/backends/null.c \
Alc/ALc.c \
Alc/helpers.c \
Alc/bs2b.c \
Alc/alcRing.c \
Alc/effects/chorus.c \
Alc/effects/flanger.c \
Alc/effects/dedicated.c \
Alc/effects/reverb.c \
Alc/effects/distortion.c \
Alc/effects/autowah.c \
Alc/effects/equalizer.c \
Alc/effects/modulator.c \
Alc/effects/echo.c \
Alc/effects/compressor.c \
Alc/effects/null.c \
Alc/alcConfig.c \
Alc/ALu.c \
Alc/mixer_c.c \
Alc/panning.c \
Alc/hrtf.c \
Alc/mixer.c \
Alc/midi/soft.c \
Alc/midi/sf2load.c \
Alc/midi/dummy.c \
Alc/midi/fluidsynth.c \
Alc/midi/base.c \
common/uintmap.c \
common/atomic.c \
common/threads.c \
common/rwlock.c \
OpenAL32/alBuffer.c \ OpenAL32/alBuffer.c \
OpenAL32/alPreset.c \
OpenAL32/alListener.c \
OpenAL32/alEffect.c \ OpenAL32/alEffect.c \
OpenAL32/alError.c \
OpenAL32/alExtension.c \ OpenAL32/alExtension.c \
OpenAL32/alThunk.c \
OpenAL32/alMidi.c \
OpenAL32/alSoundfont.c \
OpenAL32/alFontsound.c \
OpenAL32/alAuxEffectSlot.c \
OpenAL32/alError.c \
OpenAL32/alFilter.c \ OpenAL32/alFilter.c \
OpenAL32/alListener.c \
OpenAL32/alSource.c \ OpenAL32/alSource.c \
OpenAL32/alState.c \ OpenAL32/alState.c \
OpenAL32/alThunk.c \ OpenAL32/sample_cvt.c \
Alc/ALc.c \
Alc/ALu.c \
Alc/alcConfig.c \
Alc/alcDedicated.c \
Alc/alcEcho.c \
Alc/alcModulator.c \
Alc/alcReverb.c \
Alc/alcRing.c \
Alc/alcThread.c \
Alc/bs2b.c \
Alc/helpers.c \
Alc/panning.c \
Alc/hrtf.c \
Alc/mixer.c \
Alc/mixer_c.c \
Alc/backends/loopback.c \
Alc/backends/null.c \
Alc/backends/opensl.c \
com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.cpp com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.cpp
# Alc/backends/alsa.c \
# Alc/backends/android.c \
# Alc/alcChorus.c \
# Alc/alcFlanger.c \
# Alc/mixer_c.c \
# Alc/backends/loopback.c \
# Alc/backends/null.c \
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

@ -1,3 +1,3 @@
APP_PLATFORM := android-9
APP_OPTIM := release APP_OPTIM := release
APP_ABI := all APP_ABI := all
#APP_ABI := armeabi-v7a

@ -1,147 +1,203 @@
#ifndef CONFIG_H /* API declaration export attribute */
#define CONFIG_H #define AL_API __attribute__((visibility("protected")))
#define ALC_API __attribute__((visibility("protected")))
/* Define to the library version */ /* Define to the library version */
#define ALSOFT_VERSION "1.15.1" #define ALSOFT_VERSION "1.16.0"
#define ALIGN(x) __attribute__ ((aligned(x))) #ifdef IN_IDE_PARSER
/* KDevelop's parser doesn't recognize the C99-standard restrict keyword, but
* recent versions (at least 4.5.1) do recognize GCC's __restrict. */
#define restrict __restrict
#endif
/* Define any available alignment declaration */
#define ALIGN(x) __attribute__((aligned(x)))
/* Define if we have the C11 aligned_alloc function */
/* #undef HAVE_ALIGNED_ALLOC */
/* Define if we have the posix_memalign function */
/* #undef HAVE_POSIX_MEMALIGN */
/* Define if we have the _aligned_malloc function */
/* #undef HAVE__ALIGNED_MALLOC */
/* Define if we have SSE CPU extensions */
/* #undef HAVE_SSE */
/* #undef HAVE_SSE2 */
/* #undef HAVE_SSE4_1 */
/* Define if we have ARM Neon CPU extensions */
/* #undef HAVE_NEON */
/* Define if we have the Android backend */ /* Define if we have FluidSynth support */
/* #define HAVE_ANDROID 1 */ /* #undef HAVE_FLUIDSYNTH */
/* Define if we have the ALSA backend */ /* Define if we have the ALSA backend */
/* #define HAVE_ALSA */ /* #undef HAVE_ALSA */
/* Define if we have the OSS backend */ /* Define if we have the OSS backend */
/* #cmakedefine HAVE_OSS */ /* #undef HAVE_OSS */
/* Define if we have the Solaris backend */ /* Define if we have the Solaris backend */
/* #cmakedefine HAVE_SOLARIS */ /* #undef HAVE_SOLARIS */
/* Define if we have the SndIO backend */ /* Define if we have the SndIO backend */
/* #cmakedefine HAVE_SNDIO */ /* #undef HAVE_SNDIO */
/* Define if we have the QSA backend */
/* #undef HAVE_QSA */
/* Define if we have the MMDevApi backend */ /* Define if we have the MMDevApi backend */
/* #cmakedefine HAVE_MMDEVAPI */ /* #undef HAVE_MMDEVAPI */
/* Define if we have the DSound backend */ /* Define if we have the DSound backend */
/* #cmakedefine HAVE_DSOUND */ /* #undef HAVE_DSOUND */
/* Define if we have the Windows Multimedia backend */ /* Define if we have the Windows Multimedia backend */
/* #cmakedefine HAVE_WINMM */ /* #undef HAVE_WINMM */
/* Define if we have the PortAudio backend */ /* Define if we have the PortAudio backend */
/* #cmakedefine HAVE_PORTAUDIO */ /* #undef HAVE_PORTAUDIO */
/* Define if we have the PulseAudio backend */ /* Define if we have the PulseAudio backend */
/* #cmakedefine HAVE_PULSEAUDIO */ /* #undef HAVE_PULSEAUDIO */
/* Define if we have the CoreAudio backend */ /* Define if we have the CoreAudio backend */
/* #cmakedefine HAVE_COREAUDIO */ /* #undef HAVE_COREAUDIO */
/* Define if we have the OpenSL backend */ /* Define if we have the OpenSL backend */
#define HAVE_OPENSL /* THIS BACKEND WORKS ON >=2.3 Android!! */ #define HAVE_OPENSL
/* Define if we have the Wave Writer backend */ /* Define if we have the Wave Writer backend */
/* #cmakedefine HAVE_WAVE */ #define HAVE_WAVE
/* Define if we have dlfcn.h */
#define HAVE_DLFCN_H
/* Define if we have the stat function */ /* Define if we have the stat function */
#define HAVE_STAT #define HAVE_STAT
/* Define if we have the powf function */ /* Define if we have the lrintf function */
/* #define HAVE_POWF 1 */ #define HAVE_LRINTF
/* Define if we have the sqrtf function */ /* Define if we have the strtof function */
/* #define HAVE_SQRTF 1 */ /* #undef HAVE_STRTOF */
/* Define if we have the cosf function */ /* Define if we have the __int64 type */
/* #define HAVE_COSF 1 */ /* #undef HAVE___INT64 */
/* Define if we have the sinf function */ /* Define to the size of a long int type */
/* #define HAVE_SINF 1 */ #define SIZEOF_LONG 4
/* Define if we have the acosf function */ /* Define to the size of a long long int type */
/* #define HAVE_ACOSF 1 */ #define SIZEOF_LONG_LONG 8
/* Define if we have the asinf function */ /* Define if we have C99 variable-length array support */
/* #define HAVE_ASINF 1 */ #define HAVE_C99_VLA
/* Define if we have the atanf function */ /* Define if we have C99 _Bool support */
/* #define HAVE_ATANF 1 */ #define HAVE_C99_BOOL
/* Define if we have the atan2f function */ /* Define if we have C11 _Static_assert support */
/* #define HAVE_ATAN2F 1 */ #define HAVE_C11_STATIC_ASSERT
/* Define if we have the fabsf function */ /* Define if we have C11 _Alignas support */
/* #define HAVE_FABSF 1 */ /* #undef HAVE_C11_ALIGNAS */
/* Define if we have the log10f function */ /* Define if we have C11 _Atomic support */
/* #define HAVE_LOG10F 1 */ /* #undef HAVE_C11_ATOMIC */
/* Define if we have the floorf function */ /* Define if we have GCC's destructor attribute */
/* #define HAVE_FLOORF 1 */ #define HAVE_GCC_DESTRUCTOR
/* Define if we have the strtof function */ /* Define if we have GCC's format attribute */
#define HAVE_STRTOF #define HAVE_GCC_FORMAT
/* Define if we have stdint.h */ /* Define if we have stdint.h */
#define HAVE_STDINT_H #define HAVE_STDINT_H
/* Define if we have the __int64 type */ /* Define if we have stdbool.h */
/* #cmakedefine HAVE___INT64 */ #define HAVE_STDBOOL_H
/* Define to the size of a long int type */ /* Define if we have stdalign.h */
#define SIZEOF_LONG 4 /* #undef HAVE_STDALIGN_H */
/* Define to the size of a long long int type */ /* Define if we have windows.h */
#define SIZEOF_LONG_LONG 8 /* #undef HAVE_WINDOWS_H */
/* Define if we have GCC's destructor attribute */
#define HAVE_GCC_DESTRUCTOR
/* Define if we have GCC's format attribute */ /* Define if we have dlfcn.h */
#define HAVE_GCC_FORMAT #define HAVE_DLFCN_H
/* Define if we have pthread_np.h */ /* Define if we have pthread_np.h */
/* #cmakedefine HAVE_PTHREAD_NP_H */ /* #undef HAVE_PTHREAD_NP_H */
/* Define if we have arm_neon.h */ /* Define if we have alloca.h */
/* #cmakedefine HAVE_ARM_NEON_H */ /* #undef HAVE_ALLOCA_H */
/* Define if we have guiddef.h */ /* Define if we have malloc.h */
/* #cmakedefine HAVE_GUIDDEF_H */ #define HAVE_MALLOC_H
/* Define if we have ftw.h */
/* #undef HAVE_FTW_H */
/* Define if we have io.h */
/* #undef HAVE_IO_H */
/* Define if we have strings.h */
#define HAVE_STRINGS_H
/* Define if we have cpuid.h */
/* #undef HAVE_CPUID_H */
/* Define if we have intrin.h */
/* #undef HAVE_INTRIN_H */
/* Define if we have sys/sysconf.h */
#define HAVE_SYS_SYSCONF_H
/* Define if we have guiddef.h */ /* Define if we have guiddef.h */
/* #cmakedefine HAVE_INITGUID_H */ /* #undef HAVE_GUIDDEF_H */
/* Define if we have initguid.h */
/* #undef HAVE_INITGUID_H */
/* Define if we have ieeefp.h */ /* Define if we have ieeefp.h */
/* #cmakedefine HAVE_IEEEFP_H */ /* #undef HAVE_IEEEFP_H */
/* Define if we have float.h */ /* Define if we have float.h */
/* #cmakedefine HAVE_FLOAT_H */ #define HAVE_FLOAT_H
/* Define if we have fpu_control.h */
/* #cmakedefine HAVE_FPU_CONTROL_H */
/* Define if we have fenv.h */ /* Define if we have fenv.h */
#define HAVE_FENV_H #define HAVE_FENV_H
/* Define if we have fesetround() */ /* Define if we have GCC's __get_cpuid() */
/* #cmakedefine HAVE_FESETROUND */ /* #undef HAVE_GCC_GET_CPUID */
/* Define if we have the __cpuid() intrinsic */
/* #undef HAVE_CPUID_INTRINSIC */
/* Define if we have _controlfp() */ /* Define if we have _controlfp() */
/* #cmakedefine HAVE__CONTROLFP */ /* #undef HAVE__CONTROLFP */
/* Define if we have __control87_2() */
/* #undef HAVE___CONTROL87_2 */
/* Define if we have ftw() */
/* #undef HAVE_FTW */
/* Define if we have _wfindfirst() */
/* #undef HAVE__WFINDFIRST */
/* Define if we have pthread_setschedparam() */ /* Define if we have pthread_setschedparam() */
#define HAVE_PTHREAD_SETSCHEDPARAM #define HAVE_PTHREAD_SETSCHEDPARAM
/* Define if we have the restrict keyword */ /* Define if we have pthread_setname_np() */
/* #cmakedefine HAVE_RESTRICT 1 */ #define HAVE_PTHREAD_SETNAME_NP
/* Define if we have the __restrict keyword */ /* Define if we have pthread_set_name_np() */
#define RESTRICT __restrict /* #undef HAVE_PTHREAD_SET_NAME_NP */
#endif /* Define if we have pthread_mutexattr_setkind_np() */
/* #undef HAVE_PTHREAD_MUTEXATTR_SETKIND_NP */
/* Define if we have pthread_mutex_timedlock() */
/* #undef HAVE_PTHREAD_MUTEX_TIMEDLOCK */
Loading…
Cancel
Save