FMOD crashes randomly

Hi,

I’m using cocos2d 2.1.4 in lunux 64 bits and I’m noticing that FMOD sometimes crashes on the init function. Following is the stacktrace from gdb.

#0  __strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:70
70  ../sysdeps/x86_64/strcpy_chk.S: No such file or directory.
(gdb) bt
#0  __strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:70
#1  0x00007f161e9ae250 in ?? () from /usr/lib/x86_64-linux-gnu/libasound.so
#2  0x00007f161e9af29d in snd_device_name_hint () from /usr/lib/x86_64-linux-gnu/libasound.so
#3  0x00007f162843d503 in FMOD::OutputALSA::getALSANameHintDrivers() () from /home/david/dev/cocos2dx/CocosDenshion/third_party/fmod/lib64/api/lib/libfmodex64.so
#4  0x00007f162843d890 in FMOD::OutputALSA::enumerate() () from /home/david/dev/cocos2dx/CocosDenshion/third_party/fmod/lib64/api/lib/libfmodex64.so
#5  0x00007f162843da6b in FMOD::OutputALSA::init(int, unsigned int, int*, int, FMOD_SOUND_FORMAT*, int, int, void*) ()
   from /home/david/dev/cocos2dx/CocosDenshion/third_party/fmod/lib64/api/lib/libfmodex64.so
#6  0x00007f1628437dc2 in FMOD::SystemI::init(int, unsigned int, void*) () from /home/david/dev/cocos2dx/CocosDenshion/third_party/fmod/lib64/api/lib/libfmodex64.so
#7  0x00007f1628429509 in FMOD::System::init(int, unsigned int, void*) () from /home/david/dev/cocos2dx/CocosDenshion/third_party/fmod/lib64/api/lib/libfmodex64.so
#8  0x00007f16289d0eb8 in CocosDenshion::FmodAudioPlayer::init (this=0x7f1628c4dc40 )
    at ../linux/FmodAudioPlayer.cpp:57
#9  0x00007f16289d0dfb in CocosDenshion::FmodAudioPlayer::FmodAudioPlayer (this=0x7f1628c4dc40 )
    at ../linux/FmodAudioPlayer.cpp:40
#10 0x00007f16289d0c9e in CocosDenshion::FmodAudioPlayer::sharedPlayer () at ../linux/FmodAudioPlayer.cpp:19
#11 0x00007f16289cffc3 in CocosDenshion::SimpleAudioEngine::SimpleAudioEngine (this=0x7f1628c4dc08 )
    at ../linux/SimpleAudioEngineFMOD.cpp:11
#12 0x00007f16289d0024 in CocosDenshion::SimpleAudioEngine::sharedEngine () at ../linux/SimpleAudioEngineFMOD.cpp:18
#13 0x00000000004489bd in hb::SoundPlayer::playSound (this=0x2a1b900, name=0x2f2dd08 "hit1", loop=false) at ../Classes/sound/soundplayer.cpp:116
#14 0x0000000000444135 in EventSystem::update (this=0x264a5e0) at ../Classes/events/eventsystem.cpp:74
#15 0x000000000041d93a in GameLoop::update (this=0x2affcb0, dt=0.0323079824) at ../Classes/game/gameloop.cpp:51
#16 0x00007f1628e64a0a in cocos2d::CCTimer::update (this=0x2c36a00, dt=0.0323079824) at ../CCScheduler.cpp:160
#17 0x00007f1628e6c4d6 in cocos2d::CCScheduler::update (this=0x2648860, dt=0.0323079824) at ../CCScheduler.cpp:836
#18 0x00007f1628e61d30 in cocos2d::CCDirector::drawScene (this=0x2648180) at ../CCDirector.cpp:256
#19 0x00007f1628e64274 in cocos2d::CCDisplayLinkDirector::mainLoop (this=0x2648180) at ../CCDirector.cpp:1052
#20 0x00007f1628e0843d in cocos2d::CCApplication::run (this=0x7ffff1f4d3a0) at ../platform/linux/CCApplication.cpp:53
#21 0x000000000040ff35 in main (argc=1, argv=0x7ffff1f4d4b8) at main.cpp:18

Is anyone else having issues with that?
Cheers!

Edit linux/FmodAudioPlayer.cpp
change FMOD_OUTPUTTYPE_ALSA to FMOD_OUTPUTTYPE_AUTODETECT, and re-compile cocos2d-x and your project.