0
0

3D sounds work great now, but I’ve got a new random crash on FMOD_System_PlaySound() (access violation). It usually works fine, but after a while it will just crash.

Registers:
[code:27ljsb61]
EAX = 00000000 EBX = 00000032
ECX = 00000004 EDX = 0012F1AC
ESI = 017E0D98 EDI = 017E1060
EIP = 100466B7 ESP = 0012F160
EBP = 0012F1C4 EFL = 00200216
[/code:27ljsb61]

Disassembly:
[code:27ljsb61]
100466B7 mov ecx,dword ptr [eax]
100466B9 push edi
100466BA push edx
100466BB push eax
100466BC call dword ptr [ecx]
100466BE test eax,eax
100466C0 je 10046642
100466C2 push 29h
100466C4 pop eax
100466C5 jmp 10046692
[/code:27ljsb61]

Contents of context stack:
[code:27ljsb61]
fmodex:100466b7
fmodex:100127b0
fmodex:1001df05
fmodex:1000a15e
fmodex:1000f807
[/code:27ljsb61]

Here was the call that it crashed on:

result = FMOD_System_PlaySound(_system,FMOD_CHANNEL_FREE,sdata->stream,FALSE,&sdata->channel);

Here is the relevant init code, etc:

[code:27ljsb61]
result = FMOD_System_Create(&_system);
if (_system==NULL) return;
result = FMOD_System_GetVersion(_system,&version);
if (version < FMOD_VERSION) {
Sound_Shutdown();
return;
}

result = FMOD_System_GetNumDrivers(_system,&count);
if (!count) {
Sound_Shutdown();
return;
}
result = FMOD_System_GetDriverCaps(_system,0,&caps,&minfreq,&maxfreq);
hasEAX = (caps & (FMOD_CAPS_REVERB_EAX2 | FMOD_CAPS_REVERB_EAX3 |
FMOD_CAPS_REVERB_EAX4 | FMOD_CAPS_REVERB_I3DL2)) ? TRUE : FALSE;

result = FMOD_System_Init(_system,256,16,(FMOD_INITFLAGS)(FMOD_INIT_NORMAL),NULL);
if (result != FMOD_OK) {
Sound_Shutdown();
return;
}
result = FMOD_System_Set3DSettings(_system, 1.0f, 1.0f, 1.0f);
[/code:27ljsb61]

And the play stream code:
[code:27ljsb61]
dwFlags = FMOD_HARDWARE | (bLoop ? FMOD_LOOP_NORMAL : 0) | (loc ? FMOD_3D : FMOD_2D);
result = FMOD_System_CreateStream(_system,fname,dwFlags,NULL,&sdata->stream);
if (result != FMOD_OK) return NULL;
FMOD_Sound_GetLength(sdata->stream,&sdata->streamlength,FMOD_TIMEUNIT_MS);

result = FMOD_System_PlaySound(_system,FMOD_CHANNEL_FREE,sdata->stream,FALSE,&sdata->channel);
[/code:27ljsb61]

  • You must to post comments
0
0

Just tried it out. So far it is looking like you’ve fixed it 8) . I’ll let you know if I run into anything else.

  • You must to post comments
0
0

Sorry, got another crash, but different place this time, but on the same call. This time it happened when there were 33 active channels (32 HW3D, 1 HW2D) and it tried to add another HW3D (driver reported 32 3D, 32 2D hardware channels so this happened on the first virtual channel, I believe). Looking at the disassembly it looks like it is the same function, but it crashes on the call instead of getting the call address.

Registers:
[code:2bkkcier]
EAX = 054CE950 EBX = 00000040
ECX = FEEEFEEE EDX = 0012ED74
ESI = 017ECB48 EDI = 00000400
EIP = 1004747C ESP = 0012ED64
EBP = 0012ED78 EFL = 00200206
[/code:2bkkcier]

Disassembly:
[code:2bkkcier]
1004747C call dword ptr [ecx+24h]
1004747F test eax,eax
10047481 je 10047488
10047483 push 29h
10047485 pop eax
10047486 jmp 100474C3
10047488 mov cl,byte ptr [ebp-4]
1004748B mov eax,dword ptr [ebp+8]
1004748E and cl,1
10047491 mov byte ptr [eax],cl
10047493 jmp 1004749B
10047495 mov eax,dword ptr [ebp+8]
10047498 and byte ptr [eax],0
1004749B cmp byte ptr [eax],0
1004749E jne 100474C1
100474A0 cmp dword ptr [esi+44h],0
100474A4 je 100474AE
100474A6 or dword ptr [esi+2B0h],edi
100474AC jmp 100474BE
100474AE and dword ptr [esi+2B0h],0FFFFFFAFh
100474B5 jmp 100474C1
100474B7 mov eax,dword ptr [ebp+8]
100474BA test eax,eax
100474BC je 100474C1
100474BE mov byte ptr [eax],1
100474C1 xor eax,eax
100474C3 pop edi
100474C4 pop esi
100474C5 leave
100474C6 ret 4
[/code:2bkkcier]

Contents of context stack:
[code:2bkkcier]
fmodex! 1004747c
fmodex! 100148E4
fmodex! 1000390D
fmodex! 1001E58B
fmodex! 1000A145
fmodex! 1000F801
[/code:2bkkcier]

Same code as last time, but I did change the start paused flag on the PlaySound to TRUE… I noticed I’d forgot it when I posted the other report.

  • You must to post comments
0
0

Any luck? The zip doesn’t appear to have changed.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.