Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes

Hi, I'm evaluating Wwise for use in a new indie game project, but it consistently crashes on initialization. What am I doing wrong?

My Code:

#include <iostream>

#include <AK/SoundEngine/Common/AkMemoryMgr.h>
#include <AK/SoundEngine/Common/AkModule.h>
#include <AK/SoundEngine/Common/AkSoundEngine.h>
#include <AK/SoundEngine/Common/IAkStreamMgr.h>
#include <AK/MusicEngine/Common/AkMusicEngine.h>
#include <AK/Tools/Common/AkPlatformFuncs.h>
#include <AK/IBytes.h>

#ifndef AK_OPTIMIZED
#include <AK/Comm/AkCommunication.h>
#endif

#include <AkFilePackageLowLevelIOBlocking.h>

namespace AK
{
    void * AllocHook(size_t in_size)
    {
        void *ptr = malloc(in_size);
        std::cout << "Allocate " << in_size << " bytes @ " << ptr << "\n";
        return ptr;
    }

    void FreeHook(void * in_ptr)
    {
        std::cout << "Free " << in_ptr << "\n";
        free(in_ptr);
    }
}

static CAkFilePackageLowLevelIOBlocking g_lowlevel_io;

int main()
{
    // Init Memory
    std::cout << "Init Memory\n";
    AkMemSettings mem_settings;
    mem_settings.uMaxNumPools = 20;

    if (AK::MemoryMgr::Init(&mem_settings) != AK_Success) {
        return 1;
    }

    // Init Streaming
    std::cout << "Init Streaming\n";
    AkStreamMgrSettings stream_settings;
    AK::StreamMgr::GetDefaultSettings(stream_settings);

    if (!AK::StreamMgr::Create(stream_settings)) {
        return 1;
    }

    AkDeviceSettings device_settings;
    AK::StreamMgr::GetDefaultDeviceSettings(device_settings);

    if (g_lowlevel_io.Init(device_settings) != AK_Success) {
        return 1;
    }

    // Init Music
    std::cout << "Init Music\n";
    AkMusicSettings music_settings;
    AK::MusicEngine::GetDefaultInitSettings(music_settings);
    if (AK::MusicEngine::Init(&music_settings) != AK_Success) {
        return 1;
    }

    // Init Comms
    #ifndef AK_OPTIMIZED
    std::cout << "Init Comms\n";
    AkCommSettings comm_settings;
    AK::Comm::GetDefaultInitSettings(comm_settings);
    if (AK::Comm::Init(comm_settings) != AK_Success) {
        return 1;
    }
    #endif
}

Compiler Invocation:

clang++ \
        -I/Users/me/Wwise/Wwise_v2015.1.2_build_5457/SDK/include \
        -L/Users/me/Wwise/Wwise_v2015.1.2_build_5457/SDK/Mac/Debug/lib \
            -lAkSoundEngine \
            -lAkMemoryMgr \
            -lAkStreamMgr \
            -lAkMusicEngine \
            -lAkVorbisDecoder \
            -lCommunicationCentral \
            -framework AudioToolbox \
            -framework AudioUnit \
            -framework CoreAudio \
            -framework CoreFoundation \
            -g \
            main.cc \
            -I/Users/me/Wwise/Wwise_v2015.1.2_build_5457/SDK/Samples/SoundEngine/POSIX \
            /Users/me/Wwise/Wwise_v2015.1.2_build_5457/SDK/Samples/SoundEngine/Common/*.cpp \
            /Users/me/Wwise/Wwise_v2015.1.2_build_5457/SDK/Samples/SoundEngine/POSIX/*.cpp

Output:

$ ./a.out
Init Memory
Allocate 4640 bytes @ 0x7f902b807200
Init Streaming
Allocate 65536 bytes @ 0x7f902b808600
Allocate 2097664 bytes @ 0x103677000
Init Music
/Volumes/Data/Jenkins/workspace/MAC_2015.1/Wwise/SDK/source/SoundEngine/AkMusicEngine/Common/AkMusicRenderer.cpp:133 failed assertion `g_DefaultPoolId != AK_INVALID_POOL_ID'
Trace/BPT trap: 5

Stack Trace:

$ lldb a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) process launch
Process 2178 launched: '/Users/me/Projects/WwiseTest/a.out' (x86_64)
Init Memory
Allocate 4640 bytes @ 0x102001000
Init Streaming
Allocate 65536 bytes @ 0x102002400
Allocate 2097664 bytes @ 0x10132e000
Init Music
/Volumes/Data/Jenkins/workspace/MAC_2015.1/Wwise/SDK/source/SoundEngine/AkMusicEngine/Common/AkMusicRenderer.cpp:133 failed assertion `g_DefaultPoolId != AK_INVALID_POOL_ID'
Process 2178 stopped
* thread #1: tid = 0x62379a, 0x00007fff96a9f0ae libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGTRAP
    frame #0: 0x00007fff96a9f0ae libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff96a9f0ae <+10>: jae    0x7fff96a9f0b8            ; <+20>
    0x7fff96a9f0b0 <+12>: movq   %rax, %rdi
    0x7fff96a9f0b3 <+15>: jmp    0x7fff96a9a3ef            ; cerror_nocancel
    0x7fff96a9f0b8 <+20>: retq   
(lldb) bt
* thread #1: tid = 0x62379a, 0x00007fff96a9f0ae libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGTRAP
  * frame #0: 0x00007fff96a9f0ae libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff92147500 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x000000010001fb14 a.out`_AkAssertHook(in_pszExpression=0x0000000100209db4, in_pszFileName=0x0000000100209d43, in_lineNumber=133) + 68 at AkAudioLib.cpp:131
    frame #3: 0x00000001001bd1ed a.out`CAkMusicRenderer::Create(in_pSettings=0x00007fff5fbff8f8) + 125 at AkMusicRenderer.cpp:133
    frame #4: 0x00000001001bd105 a.out`AK::MusicEngine::Init(in_pSettings=0x00007fff5fbff8f8) + 21 at AkMusicRenderer.cpp:58
    frame #5: 0x00000001001ef9ef a.out`main + 271 at main.cc:66
    frame #6: 0x00007fff89f035ad libdyld.dylib`start + 1

Compiler Version:

$ clang++ -v
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
 
in General Discussion by Robin A. (100 points)

Please sign-in or register to answer this question.

...