0
0

Whenever I try and release a sound on exit, the application gets stuck. I can release sounds just fine any other time. any clues?

  • You must to post comments
0
0

The issue had to do with glut atexit. Now its okay.

  • You must to post comments
0
0

Hi,
It sounds to me like the thing causing your problem is inbetween your game loop and the shut down process. Obviously releasing a sound is successful inside the game, and for everyone else, in a normal load/play/release situation. My theory would be that you’re releasing the sound twice somehow, or released a resource before shutting down fmod that causes the problem. (ie are you using callbacks to handle file/memory in fmod?).
You’re using iterators and lists to store fmod sound handles, is that list valid and you’re not passing bogus pointers to Sound::release?

Btw the reason you get the same result in System::close is because it loops through and tries to clean up the sounds, doing the same thing as you are doing by calling Sound::release manually.

I would be moving the sound release call that hangs your code back up the logic path until you find the spot where it suddenly works correctly, and then see what the code was after that successful call that caused the hang to happen. Let me know what you find here.

  • You must to post comments
0
0

this is straight up after using fmodex_vc.dll and using the symbol file (fmodex.pdb) from crysis 2 beta (which is the only place I could get it from :roll: )

[code:33o8jtdr]fmodex!FMOD_ChannelGroup_Set3DOcclusion+19
0042354c 3d02010000 cmp eax,102h

SYMBOL_STACK_INDEX: 3

SYMBOL_NAME: fmodex!FMOD_ChannelGroup_Set3DOcclusion+19

FOLLOWUP_NAME: MachineOwner

IMAGE_NAME: fmodex.dll

BUCKET_ID: WRONG_SYMBOLS

FAILURE_BUCKET_ID: WRONG_SYMBOLS_SHUTDOWN_80000004_fmodex.dll!FMOD_ChannelGroup_Set3DOcclusion

WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/XXXXXXXXX/0_0_0_0/4e0de52c/ntdll_dll/6_1_7600_16695/4cc7ab44/80000004/00046344.htm?Retriage=1

Followup: MachineOwner

0:000> lmvm fmodex
start end module name
00420000 00528000 fmodex M (private pdb symbols) c:\perforce\tchasid_imac_pc\XXXXXXXXXXX\trunk\build\fmodex.pdb
Loaded symbol image file: fmodex.dll
Mapped memory image file: C:\Perforce\tchasid_iMac_PC\XXXXXXXXXXXXXX\Trunk\Build\fmodex.dll
Image path: c:\Perforce\tchasid_iMac_PC\XXXXXXXXXXX\Trunk\Build\fmodex.dll
Image name: fmodex.dll
Timestamp: Wed Jun 01 11:42:58 2011 (4DE65E02)
CheckSum: 00000000
ImageSize: 00108000
File version: 0.4.34.5
Product version: 0.4.34.5
File flags: 0 (Mask 3F)
File OS: 40004 NT Win32
File type: 2.0 Dll
File date: 00000000.00000000
Translations: 0c09.04b0
CompanyName: Firelight Technologies
ProductName: FMOD Ex
InternalName: FMOD Ex
OriginalFilename: fmodex.dll
ProductVersion: 4.34.5
FileVersion: 4.34.5
PrivateBuild: 4.34.5
SpecialBuild: 4.34.5
FileDescription: FMOD Ex SoundSystem
LegalCopyright: Copyright © Firelight Technologies 2004-2011
LegalTrademarks: Copyright © Firelight Technologies 2004-2011
Comments: Copyright © Firelight Technologies 2004-2011
[/code:33o8jtdr]

  • You must to post comments
0
0

If this helps at all here is the output from windbg…

[code:1aeww31k]Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
Copyright (c) Microsoft Corporation. All rights reserved.

Loading Dump File [C:\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXX.dmp]
User Mini Dump File: Only registers, stack and portions of memory are available

Symbol search path is: C:\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX\
Executable search path is: C:\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX
Windows 7 Version 7600 MP (4 procs) Free x86 compatible
Product: WinNt, suite: SingleUserTS
Machine Name:
Debug session time: Thu Jun 30 18:04:41.000 2011 (UTC – 4:00)
System Uptime: not available
Process Uptime: 0 days 0:01:35.000
..............................................................
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(234c.1990): Single step exception – code 80000004 (first/second chance not available)
eax=00000000 ebx=00000000 ecx=007d3458 edx=0a921d97 esi=000001f8 edi=00000000
eip=77976344 esp=0012e8d0 ebp=0012e93c iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll –
ntdll!KiFastSystemCallRet:
77976344 c3 ret
0:000> !analyze -v


  • *
  • Exception Analysis *
  • *

*** WARNING: Unable to verify checksum for fmodexL.dll
*** ERROR: Symbol file could not be found. Defaulted to export symbols for fmodexL.dll –
***** OS symbols are WRONG. Please fix symbols to do analysis.

*** ERROR: Symbol file could not be found. Defaulted to export symbols for ole32.dll –
GetPageUrlData failed, server returned HTTP status 404
URL requested: http://watson.microsoft.com/StageOne/XXXXXXXXXX/0_0_0_0/4e0cf29a/ntdll_dll/6_1_7600_16695/4cc7ab44/80000004/00046344.htm?Retriage=1

FAULTING_IP:
ntdll!KiFastSystemCallRet+0
77976344 c3 ret

EXCEPTION_RECORD: ffffffff — (.exr 0xffffffffffffffff)
ExceptionAddress: 77976344 (ntdll!KiFastSystemCallRet)
ExceptionCode: 80000004 (Single step exception)
ExceptionFlags: 00000000
NumberParameters: 0

DEFAULT_BUCKET_ID: WRONG_SYMBOLS

PROCESS_NAME: XXXXXXXXXXX.exe

ADDITIONAL_DEBUG_TEXT:
Use ‘!findthebuild’ command to search for the target build information.
If the build information is available, run ‘!findthebuild -s ; .reload’ to set symbol path and load symbols.

MODULE_NAME: fmodexL

FAULTING_MODULE: 77930000 ntdll

DEBUG_FLR_IMAGE_TIMESTAMP: 4c2b7d44

ERROR_CODE: (NTSTATUS) 0x80000004 – {EXCEPTION} Single Step A single step or trace operation has just been completed.

EXCEPTION_CODE: (HRESULT) 0x80000004 (2147483652) – No such interface supported

MOD_LIST: <ANALYSIS/>

FAULTING_THREAD: 00001990

PRIMARY_PROBLEM_CLASS: WRONG_SYMBOLS

BUGCHECK_STR: APPLICATION_FAULT_WRONG_SYMBOLS

LAST_CONTROL_TRANSFER: from 761ef003 to 77976344

STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
0012e93c 761ef003 000001f8 ffffffff 00000000 ntdll!KiFastSystemCallRet
0012e954 761eefb2 000001f8 ffffffff 00000000 kernel32!WaitForSingleObjectEx+0x43
0012e968 004239bb 000001f8 ffffffff 007d8f20 kernel32!WaitForSingleObject+0x12
0012e96c 00000000 ffffffff 007d8f20 004232bc fmodexL+0x39bb

STACK_COMMAND: ~0s; .ecxr ; kb

FOLLOWUP_IP:
fmodexL+39bb
004239bb ?? ???

SYMBOL_STACK_INDEX: 3

SYMBOL_NAME: fmodexL+39bb

FOLLOWUP_NAME: MachineOwner

IMAGE_NAME: fmodexL.dll

BUCKET_ID: WRONG_SYMBOLS

FAILURE_BUCKET_ID: WRONG_SYMBOLS_80000004_fmodexL.dll!Unknown

WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/XXXXXXXXXX/0_0_0_0/4e0cf29a/ntdll_dll/6_1_7600_16695/4cc7ab44/80000004/00046344.htm?Retriage=1

Followup: MachineOwner

0:000> lmvm fmodexL
start end module name
00420000 00604000 fmodexL (deferred)
Mapped memory image file: C:\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\Build\fmodexL.dll
Image path: c:\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\XXXXXXXXXXX\Build\fmodexL.dll
Image name: fmodexL.dll
Timestamp: Wed Jun 30 13:22:12 2010 (4C2B7D44)
CheckSum: 00000000
ImageSize: 001E4000
File version: 0.4.30.5
Product version: 0.4.30.5
File flags: 0 (Mask 3F)
File OS: 40004 NT Win32
File type: 2.0 Dll
File date: 00000000.00000000
Translations: 0000.04b0 0000.04e4 0409.04b0 0409.04e4
[/code:1aeww31k]

  • You must to post comments
0
0

constructor:
[code:2iqa1h98]
result = FMOD::System_Create(&mSystem);
ErrCheck(result);

result = mSystem-&gt;getVersion(&amp;version);
ErrCheck(result);

ASSERT_MSG(version &gt;= FMOD_VERSION, &quot;FMOD Error! You are using an old version of FMOD %08x.  This program requires %08x\n&quot;);

result = mSystem-&gt;getNumDrivers(&amp;numDrivers);
ErrCheck(result);

if (numDrivers == 0)
{
    result = mSystem-&gt;setOutput(FMOD_OUTPUTTYPE_NOSOUND);
    ErrCheck(result);
}

    result = mSystem-&gt;getDriverCaps(kFmodSystemDriverId, &amp;deviceCaps, kMinFrequency, kMaxFrequency, &amp;speakerMode);
ErrCheck(result);

if (deviceCaps &amp; FMOD_CAPS_HARDWARE_EMULATED)
{
    result = mSystem-&gt;setDSPBufferSize(kSoundBufferLength, kNumSoundBuffer);
    ErrCheck(result);
}


result = mSystem-&gt;getDriverInfo(kFmodSystemDriverId, deviceName, kMaxDeviceNameChar, kDeviceGuid);
ErrCheck(result);

    result = mSystem-&gt;init(kNumChannels, FMOD_INIT_NORMAL, NULL);

// Check if the speaker mode selected isn't supported by this soundcard.
if (result == FMOD_ERR_OUTPUT_CREATEBUFFER)
{
    // Switch to stereo.
    result = mSystem-&gt;setSpeakerMode(FMOD_SPEAKERMODE_STEREO);
    ErrCheck(result);

    result = mSystem-&gt;init(kNumChannels, FMOD_INIT_NORMAL, NULL);
    ErrCheck(result);
}

[/code:2iqa1h98]
my PlaySound routine:
[code:2iqa1h98]
FMOD_RESULT result;
STRING_HASH nameHash = STRING::ComputeHash(inName);

if (mSoundMap.size() &gt; 0)
{

    tSoundMapType::const_iterator soundMapIter = mSoundMap.find(nameHash);
    if (soundMapIter != mSoundMap.end())
    {
        FMOD::Sound* sound = static_cast&lt;FMOD::Sound*&gt;(soundMapIter-&gt;second);
        FMOD::Channel* channel = NULL;
        result = mSystem-&gt;playSound(FMOD_CHANNEL_FREE, sound, FALSE, &amp;channel);
        ErrCheck(result);
        return;
    }
}

FMOD::Sound*    sound = NULL;
CHAR            filename[MAX_ABSOLUTE_PATH];
CHAR            filePath[MAX_ABSOLUTE_PATH];

STRCPY(filename, sizeof(filename), inName);
STRCAT(filename, sizeof(filename), &quot;.wav&quot;);
BOOL bFoundFile = FileManager::GetSingleton()-&gt;GetFilePath(filename, filePath);

if (bFoundFile)
{
    result = mSystem-&gt;createSound(filePath, FMOD_DEFAULT, FALSE, &amp;sound);
    ErrCheck(result);

    if (mSoundEffectsChannelGroup == NULL)
    {
        result = mSystem-&gt;createChannelGroup(kSoundEffectsGroupName, &amp;mSoundEffectsChannelGroup);
        ErrCheck(result);
    }

    FMOD::Channel* soundEffectsChannel = NULL;

    if (mSoundEffectsChannelGroup != NULL)
    {
        result = mSoundEffectsChannelGroup-&gt;getChannel(0, &amp;soundEffectsChannel);
        ErrCheck(result);
    }

    FMOD_CHANNELINDEX soundChannelIndex = FMOD_CHANNEL_FREE;

    if (soundEffectsChannel != NULL)
    {
        INT soundChannelId = static_cast&lt;INT&gt;(soundChannelIndex);
        result = soundEffectsChannel-&gt;getIndex(&amp;soundChannelId);
        soundChannelIndex = static_cast&lt;FMOD_CHANNELINDEX&gt;(soundChannelId);
        ErrCheck(result);
    }

    result = mSystem-&gt;playSound(soundChannelIndex, sound, FALSE, &amp;soundEffectsChannel);
    ErrCheck(result);

    mSoundMap[nameHash] = sound;
}
}

[/code:2iqa1h98]

destructor:
[code:2iqa1h98]
FMOD_RESULT result;
if (mBackgroundMusic != NULL)
mBackgroundMusic->release();

tSoundMapType::iterator soundMapIter = mSoundMap.begin();
while (soundMapIter != mSoundMap.end())
{
    FMOD::Sound* soundEffect = static_cast&lt;FMOD::Sound*&gt;(soundMapIter-&gt;second);
    soundEffect-&gt;release();
    ++soundMapIter;
}

mSoundMap.clear();
result = mSystem-&gt;release();
ErrCheck(result);

[/code:2iqa1h98]

  • You must to post comments
0
0

If you are not calling FMOD functions from any other threads (including FMOD callbacks) then this is quite unusual. Can you give a brief description of what FMOD functions you call in your application?

  • You must to post comments
0
0

Update: i remove starting that specific sound, and now FMOD::System::Close hangs…

  • You must to post comments
0
0

yes, we are not using multithreading.

  • You must to post comments
0
0

Are you calling release from the main thread?

  • You must to post comments
0
0

Guess it won’t achieve anything, but can you try a "Sleep(1)" api call before closing and/or after startup?

can you try:
[code:362oknpc]Sleep(1);
result = mSystem->close();
ErrCheck(result);
result = mSystem->release();
ErrCheck(result);[/code:362oknpc]

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.