« Using ID3DXSprite | Main | Sometimes It Helps to Go Backwards »

May 29, 2005

BASS Sound Library (Crashing is Bad)

That project I'm working on in the moonlit hours specifies that the BASS sound library be used.

Seems like a pretty adequate tool for playing WAV, MP3, OGG, MOD, MIDI, and probably other formats that I can't even recall at this moment.

One comment I heard about "real hackers" was that they didn't like closed source tools. When a problem turns up in one of the libraries that you've licensed, a real hacker will want to get into the code, find the problem, fix it, and get back to work. Closed source libraries prevent this from happening. (The original author of this comment was blurring the definition of "open source" a bit, talking about libraries distributed in binary form alone, but you get the idea.)

I am reminded of this just now, because I have a BASS DLL and no source code. I've been seeing crashes when running in the debugger that seem to be happening in the DLL, and not in my code.

I'm of the opinion that if you're going to sell your code, it shouldn't crash. If it does crash, consider allowing the licensees to see the code so that they can help you fix it.

My current workaround is to limit the number of channels I have going at once. There may be a hardware maximum, but it seems like I shouldn't have to care about that - any extra sounds that can't be played should trigger an error condition. An error condition that higher level code can catch and respond to. Crashing is bad.

This is almost as bad as the case that an ex-coworker once found himself in - he was working on a console game, and they had a bug where the game could not go on. It wasn't precisely a crash, because the code was still running, but maybe the player control didn't work anymore, so there was nothing for the player to do but reboot the system. The crazy thing is that from within the game they could detect, but not fix, this phenomenon. So they hacked in a faux easter egg screen saying "Congratulations! You have discovered the secret bonus! Reboot your system to go back to the game!"

Posted by tsmaster at May 29, 2005 10:47 PM

Comments

I've heard really good things about FMOD, and plan on using it myself. You say that the project specifies BASS, but if you show them the crash, perhaps they might be more flexible?

Posted by: Jay at June 7, 2005 09:59 AM

I've mentioned the crash to The Powers That Be, and they're willing to shift over to FMOD if necessary - the difference in price between an FMOD license and a BASS license is small in comparison with time spent tracking down the problem.

One thing I've done since is to shift from WAV to OGG files, and preloading them to memory, rather than streaming them from disk. The crash has gone away... for now.

Posted by: Dave at June 10, 2005 09:55 PM

Post a comment




Remember Me?