I’m trying to port Hurrican ( http://www.hurrican-game.de/ ) to MacOS. The original code was written for an older version of fmod, so I upgraded it to fmod ex at the same time. This is my first application using fmod.
Everything works fine on my ancient PowerPC Mac Mini, but on my slightly less ancient Intel MacBook I get massive stalls while the .IT files are loaded. They’re loaded as streams and not samples, so it shouldn’t be decompressing them. The problem is sometimes only a pause, sometimes it hangs completely. And it seems to be worse if I launch the game from outside xcode.
If I break into the program it seems to be waiting for a semaphore inside the kernel while creating the sound, though I guess that could just mean that the application is not active when I stop it.
Another problem are slight stalls when sound effects are triggered on the MacBook that don’t appear on the Mac Mini either.
The game is a relatively classic single-threaded design without asynchronous loading, so I can’t imagine something else stealing all the CPU.
BTW: It is a universal build, so it is not going through the translation layer, and top shows a cpu load ~13%.
- JensChR asked 6 years ago
This is after a few tries where I only got short stalls, this time it hangs and all music stops. If I break into the debugger I get:
0 0x926e01ae in semaphore_wait_signal_trap
1 0x926e7c85 in pthread_mutex_lock
2 0x002a39de in dyld_stub_write
3 0x0032105d in FMOD::SystemI::getMemoryUsedImpl
4 0x0030f47d in FMOD::GeometryI::getMemoryInfo
5 0x002c25ac in FMOD::ChannelI::validate
6 0x002c2bc8 in FMOD::ChannelI::validate
7 0x002c2e38 in FMOD::ChannelI::validate
8 0x002e74e7 in FMOD::ChannelI::validate
9 0x0031c8db in FMOD::SoundI::getUserDataInternal
10 0x0031db5c in FMOD::SoundI::getUserDataInternal
11 0x00318e09 in FMOD::GeometryI::getMemoryInfo
12 0x00319068 in FMOD::GeometryI::getMemoryInfo
13 0x00328f77 in FMOD::SystemI::createSoundInternal
14 0x0032a6ee in FMOD::SystemI::createSoundInternal
15 0x0031ed5d in FMOD::System::createSound
16 0x0002c372 in CSoundManager::LoadSong at DX8Sound.cpp:634
17 0x00072118 in GameInit2 at Main.cpp:1058
18 0x00072c80 in Heartbeat at Main.cpp:1255
19 0x000734b9 in SDL_main at Main.cpp:587
20 0x00002ed6 in -[SDLMain applicationDidFinishLaunching:] at SDLMain.mm:293
Still on an Intel MacBook, MacOS 10.5.
Did anyone else see this? Are there any known incompatibilities between SDL and FMod?
It already plays an IT file while further IT files are opened. Since then I tried a few different audio libraries, and all of them seem to stumble a bit during loading (though none of them actually deadlocked). I think the core problem is that the game is single-threaded and not running the update loop while loading a file.
Please login first to submit.