0
0

I’ve been using fmod in my game for awhile and recently switched to vista a few months ago.

Never had any problems until it seemed i switched to vista. My game would sometimes hang seconds after I ran the exe.

when i would run my exe, it switches to full screen, goes black, then stops responding, then vista tells me i need to close it etc.

I finally started troubleshooting my code, commenting out everything except window setup. Then next function then next etc.

failure rate is about 1 in 10, so i would have to run it about 30 times to make sure i got the right area of code responsible.

Well it seems to be in my InitiAudio function. So here it is, let me know if you see any problems with it, because it randomly hangs at about 10% when called.

never had any problems in xp (~ 6 months)

[edit]
My motherboard is a
ASUS P5N-E SLI ACPI BIOS Revision 0608, 6/11/2007

and sound drivers installed as :
High Definition Audio Device
dmk.sys 6.06001.18000 microsoft
HDAudio.sys 6.0.5840.16387 microsoft
portcls.sys 6.0.6001.1800 microsoft
SysFxUI.dll 6.0.6000.16386 microsft
WMALFXGFXDSP.dll 11.0.6001.7000 microsoft

I’m using Fmodex.dll and library 4.12.7

[edit]
Updated my InitiAudio function from the sticky thread:
[url:1ceycexh]http://www.fmod.org/forum/viewtopic.php?t=9305[/url:1ceycexh]
testing it out now…

still doing it…

going to see if my audio drivers can be updated

Switched my drivers over to realtek instead of microsoft drivers
and the problem seems fixed as far as I can tel.

[code:1ceycexh]

define FMOD_3D_LINEARROLLOFF 0x00200000

FMOD::Channel *channel;
//FMOD::Sound *sound, *music;
FMOD_RESULT fmodresult;
FMOD::System *audiosystem;

void InitAudio()
{

fmodresult = FMOD::System_Create(&audiosystem); // Create the main system object.
if (fmodresult != FMOD_OK)
{
MessageBox(NULL,"FMOD error!","Black Sky Failure",MB_OK|MB_ICONWARNING);
exit(-1);
}

fmodresult = audiosystem->init(32, FMOD_INIT_NORMAL, 0); // Initialize FMOD.
if (fmodresult != FMOD_OK)
{
MessageBox(NULL,"FMOD error!","Black Sky Failure",MB_OK|MB_ICONWARNING);
exit(-1);
}

}

unsigned int LoadAudio(string Newaudio)
{
transform(Newaudio.begin(), Newaudio.end(), Newaudio.begin(), (int(*)(int)) tolower);

for(unsigned int x=0; x < Audio.size();x++)
    if (Newaudio == Audio[x].filename)
        return x;

if (Newaudio.find(".wav")!=string::npos)
    newaudio.sound=LoadSound((char *)Newaudio.c_str());

if (Newaudio.find(".mp3")!=string::npos)
    newaudio.sound=LoadSong((char *)Newaudio.c_str());


newaudio.filename=Newaudio;
Audio.push_back(newaudio);
return Audio.size()-1;

}

FMOD::Sound* LoadSound(char* tempc)
{
FMOD::Sound *sound;
fmodresult = audiosystem->createSound(tempc, FMOD_HARDWARE | FMOD_3D, 0, &sound);
sound->set3DMinMaxDistance(9999.0f, 10000.0f);
return sound;
}

FMOD::Sound* LoadSong(char* tempc)
{
FMOD::Sound *sound;
fmodresult = audiosystem->createStream(tempc, FMOD_HARDWARE | FMOD_LOOP_NORMAL | FMOD_2D, 0, &sound);
return sound;
}

void PlayAudio(FMOD::Sound *sound, float x, float y)
{
float tempd=0, volume=0;
tempd=GetDis(x,y, camera.x, camera.y);
volume=(screeny-tempd)/screeny;
if (tempd < screeny)
{
audiosystem->playSound(FMOD_CHANNEL_FREE, sound, true, &channel);
channel->set3DAttributes(&MakeVec(x, y, 0), &MakeVec(0, 0, 0));
channel->setVolume(volume);
channel->setPaused(false);
}
}

void CloseAudio()
{
audiosystem->release();
}
[/code:1ceycexh]

  • You must to post comments
0
0

Hey, FYI, the problem came back, where I get a application hang. I tried to debug it with symbols but it gets stuck in nt.dll in some weird system call, so couldn’t figure it out.

but I moved my initaudio function before my window creation process, and that seems to have solved the problem.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.