Page 2 of 2

Re: Android Audio

Posted: Fri Oct 20, 2017 9:48 pm
by LunaRebirth
CuteAlien wrote:Did you try printing defaultDeviceName to see which value it has?
"Android Default"

Re: Android Audio

Posted: Sat Oct 21, 2017 12:47 am
by CuteAlien
Looks also correct. And if alcGetString returns correct string it's hard to see how library could not be linked correct. Except if it maybe implements that part in header or so.

I looked over your Android.mk and it seems still to be somewhat different to mine. Not sure if it matters. For example you don't seem to have openal in LOCAL_SHARED_LIBRARIES.

And I also got those lines:

Code: Select all

 
include $(CLEAR_VARS)
LOCAL_MODULE := openal
LOCAL_SRC_FILES := ../libs/openal/android/lib/$(TARGET_ARCH_ABI)/libopenal.so 
include $(PREBUILT_SHARED_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE := freealut
LOCAL_SRC_FILES := ../libs/freealut/android/lib/$(TARGET_ARCH_ABI)/libfreealut.so 
include $(PREBUILT_SHARED_LIBRARY)
 
So maybe compare to my Android.mk and look for all stuff that mentions "openal" and "freealut" once more.

Re: Android Audio

Posted: Sat Oct 21, 2017 2:59 am
by LunaRebirth
I copied your Android.mk and removed everything except what I need for Irrlicht and OpenAL. No change in result.

Code: Select all

LOCAL_PATH := $(call my-dir)/..
IRRLICHT_PROJECT_PATH := $(LOCAL_PATH)
 
include $(CLEAR_VARS)
LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := $(IRRLICHT_PROJECT_PATH)/../../lib/Android/libIrrlicht.a
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
LOCAL_MODULE := openal
LOCAL_SRC_FILES := libs/openal-soft-master/obj/local/$(TARGET_ARCH_ABI)/libopenal.so
include $(PREBUILT_SHARED_LIBRARY)
 
include $(CLEAR_VARS)
 
LOCAL_MODULE := HelloWorldMobile
 
LOCAL_CFLAGS := -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -Wno-deprecated-declarations
 
ifndef NDEBUG
LOCAL_CFLAGS += -g -D_DEBUG
else
LOCAL_CFLAGS += -fexpensive-optimizations -O3
endif
 
ifeq ($(TARGET_ARCH_ABI),x86)
LOCAL_CFLAGS += -fno-stack-protector
endif
 
LOCAL_C_INCLUDES := ../../include libs/freealut/freealut-1.1.0/include libs/openal-soft-master/jni/OpenAL/include
 
LOCAL_SRC_FILES := main.cpp android_tools.cpp
 
LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid
 
LOCAL_STATIC_LIBRARIES := Irrlicht android_native_app_glue
LOCAL_SHARED_LIBRARIES := openal
 
include $(BUILD_SHARED_LIBRARY)
 
$(call import-module,android/native_app_glue)
 
# copy Irrlicht data to assets
 
$(shell mkdir.exe -p assets)
$(shell mkdir.exe -p assets/media)
$(shell mkdir.exe -p assets/media/Shaders)
$(shell mkdir.exe -p src)
$(shell cp ../../media/Shaders/*.* assets/media/Shaders/)
$(shell cp ../../media/irrlichtlogo3.png assets/media/)
$(shell cp ../../media/dwarf.x assets/media/)
$(shell cp ../../media/dwarf.jpg assets/media/)
$(shell cp ../../media/axe.jpg assets/media/)
$(shell cp ../../media/fonthaettenschweiler.bmp assets/media/)
$(shell cp ../../media/bigfont.png assets/media/)
Seriously at a loss :/

Re: Android Audio

Posted: Sat Oct 21, 2017 7:21 am
by LunaRebirth
Perhaps you wouldn't mind helping me out by building my test.

The location should be the same as the rest of the Irrlicht examples.

Download: http://download19.mediafire.com/wo5lx92 ... OpenAL.zip

Re: Android Audio

Posted: Sat Oct 21, 2017 7:52 pm
by CuteAlien
Sorry, I'm too afraid of the time that can take (I think last time I spend 1-2 weeks fulltime until I got Android sound working). And for Windows I haven't set-up an environment for compiling Android so far (will do that one day, but currently my weekends are already too short *sigh*).

The trouble with that kind of bugs is that it might mean you'll have to modify OpenAL library directly and add debug-output in there to find out what's going on. Or spend some time with gdb (which as so many stuff on NDK doesn't work too well with Android). Maybe you can get some help from OpenAL-soft authors.

Re: Android Audio

Posted: Sat Oct 21, 2017 10:22 pm
by LunaRebirth
Alright thanks anyways. Maybe I'll try out cAudio or SDL or something instead. Looks like very few have a decent license + free + cross-platform. SDL would work great if it had multi-audio support