The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Making SDL_Sound for Android
moocow1452


Joined: 20 Oct 2014
Posts: 5
So you know how I'm making MKXP for Android, right? So far, it's going well, with the exception of SDL_sound which is being a pain in the ass to compile, specially with a patch that was intended to configure SDL_sound to SDL2.

https://github.com/Ancurio/mkxp/blob/master/patches/SDL_sound/pkgconfig.patch

Any idea how I can get a lib working that could go with an Android project?
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Wouldn't it be better to work with SDL_Mixer ?
moocow1452


Joined: 20 Oct 2014
Posts: 5
Yes, but it would be yet another version to the code, and since Ancurio currently has it set up to build with SDL_sound, that's kinda what I'm going with for now. You think it would be an easier fix to just port to mixer?

Code:
12:22:54: Running steps for project mkxp...
12:22:54: Configuration unchanged, skipping qmake step.
12:22:54: Starting: "/usr/bin/make"
/home/user/tools/android/android-ndk-r10c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/user/tools/android/android-ndk-r10c/platforms/android-9/arch-arm/ -Wl,-soname,libmkxp.so -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libmkxp.so main.o audio.o bitmap.o eventthread.o filesystem.o font.o input.o plane.o scene.o sprite.o table.o tilequad.o viewport.o window.o texpool.o shader.o glstate.o tilemap.o autotiles.o graphics.o debuglogger.o etc.o config.o settingsmenu.o keybindings.o tileatlas.o sharedstate.o gl-fun.o gl-meta.o vertex.o soundemitter.o sdlsoundsource.o alstream.o audiostream.o rgssad.o bundledfont.o vorbissource.o windowvx.o tilemapvx.o tileatlasvx.o autotilesvx.o midisource.o fluid-fun.o binding-null.o   -L/home/user/tools/android/android-ndk-r10c/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/home/user/tools/android/android-ndk-r10c/platforms/android-9/arch-arm//usr/lib -L/home/user/workspace/mkxp4android/../mkxp-android/Boost-for-Android/build/lib/ -lboost_program_options -L/home/user/workspace/mkxp4android/../mkxp-android/openal-soft/libs/armeabi/ -lopenal -L/home/user/workspace/mkxp4android/../mkxp-android/SDL/build/org.libsdl/libs/armeabi-v7a/ -lSDL2_image -lSDL2_ttf -lSDL2 -L/home/user/workspace/mkxp4android/../mkxp-android/libphysfs-android/libs/armeabi/ -lphysfs -L/home/user/workspace/mkxp4android/../mkxp-android/libvorbis-libogg-android/libs/armeabi-v7a/ -lvorbis -L/home/user/workspace/mkxp4android/../mkxp-android/libsigcpp-multiplatform/_android/obj/local/armeabi/ -lsigc++ -L/home/user/workspace/mkxp4android/../mkxp-android/android-cairo/examples/pure-ndk/obj/local/armeabi-v7a/ -lpixman -L/home/user/workspace/mkxp4android/../mkxp-android/commandergenius/project/jni/sdl_sound/libs/armeabi/ -lsdl_sound -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
../mkxp4android/src/main.cpp:229: error: undefined reference to 'Sound_Init'
../mkxp4android/src/main.cpp:231: error: undefined reference to 'Sound_GetError'
../mkxp4android/src/main.cpp:326: error: undefined reference to 'Sound_Quit'
../mkxp4android/src/filesystem.cpp:321: error: undefined reference to 'Sound_AvailableDecoders'
../mkxp4android/src/soundemitter.cpp:205: error: undefined reference to 'Sound_NewSample'
../mkxp4android/src/soundemitter.cpp:211: error: undefined reference to 'Sound_GetError'
../mkxp4android/src/soundemitter.cpp:214: error: undefined reference to 'Sound_DecodeAll'
../mkxp4android/src/soundemitter.cpp:227: error: undefined reference to 'Sound_FreeSample'
../mkxp4android/src/sdlsoundsource.cpp:44: error: undefined reference to 'Sound_NewSample'
../mkxp4android/src/sdlsoundsource.cpp:49: error: undefined reference to 'Sound_GetError'
../mkxp4android/src/sdlsoundsource.cpp:61: error: undefined reference to 'Sound_FreeSample'
../mkxp4android/src/sdlsoundsource.cpp:66: error: undefined reference to 'Sound_Decode'
../mkxp4android/src/sdlsoundsource.cpp:71: error: undefined reference to 'Sound_Decode'
../mkxp4android/src/sdlsoundsource.cpp:87: error: undefined reference to 'Sound_Rewind'
../mkxp4android/src/sdlsoundsource.cpp:107: error: undefined reference to 'Sound_Rewind'
../mkxp4android/src/sdlsoundsource.cpp:109: error: undefined reference to 'Sound_Seek'
/home/user/workspace/mkxp4android/../mkxp-android/Boost-for-Android/build/lib//libboost_program_options.a(cmdline.o):cmdline.cpp:function non-virtual thunk to boost::exception_detail::error_info_injector<boost::bad_function_call>::~error_info_injector(): warning: relocation refers to discarded section
/home/user/workspace/mkxp4android/../mkxp-android/Boost-for-Android/build/lib//libboost_program_options.a(value_semantic.o):value_semantic.cpp:function non-virtual thunk to boost::program_options::typed_value<bool, char>::~typed_value(): warning: relocation refers to discarded section
/home/user/workspace/mkxp4android/../mkxp-android/Boost-for-Android/build/lib//libboost_program_options.a(value_semantic.o):value_semantic.cpp:function non-virtual thunk to boost::exception_detail::error_info_injector<boost::program_options::validation_error>::~error_info_injector(): warning: relocation refers to discarded section
collect2: error: ld returned 1 exit status
make: *** [libmkxp.so] Error 1
12:22:56: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project mkxp (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.3.2))
When executing step "Make"
12:22:56: Elapsed time: 00:02.
moocow1452


Joined: 20 Oct 2014
Posts: 5
Ancurio's reasoning in his own words.

https://github.com/Ancurio/mkxp/issues/36

Quote:
...there's no reasons why I'm not using SDL2_mixer besides technical ones. The library is too high level for my needs... and its resampling support is atrocious. It's a good library if you just want very simple audio and "play this song" stuff (like SDL_Render), but for anything more sophisticated it is unsuited.