Crash when no speakers plugged in!


15-12-2009 10:28:28

My app crashes when initialising OgreOggSound if i dont have any speakers plugged in. Is there a way to stop it crashing!??

Ogre Log

10:40:23: *****************************************
10:40:23: *** --- Initialising OgreOggSound --- ***
10:40:23: *** --- OgreOggSound v1.13 --- ***
10:40:23: *****************************************
10:40:23: *** --- OpenAL version 1.1
10:40:23: *** --- AVAILABLE DEVICES --- ***

ps I am running Vista


15-12-2009 13:10:31

I've just tested on one of my devlopment machines and the latest lib works fine here, I don't have access to a vista machine, could you possibly try debugging it yourself?


15-12-2009 13:27:15

I have just tried it on another vista machine and it has no problems. I think my machine must be having a stroke or something! When i have time i will restart it and see if that fixes it (it has been on for 2 weeks, which is impressive for windows!!)


15-12-2009 13:29:20

Hmmm, strange, keep me posted!


15-12-2009 14:06:14

Ok found out what it is; (I think this is only related to Vista/7 not XP)

Vista assigns an audio device when an output device is connected (This might not be true old sound cards which dont register when you plug something in). So, at least on my machine, when you have nothing connected it only assigns an audio device to the Digital Output, but for some reason i had disabled that device which meant that, as far as vista was concerned, I had no audio device.

This situation should never really happen, especially as every computer these days has some form of sound device, however i think OgreOggSound should be able to handle when no sound device is found.

When i get debug working again (Have problems with Ogre asserts!) i will try and see exactly where it falls over, if you want to see the problem yourself try and disable all your playback devices.

PS Thank for this library and your quick replies! :)


15-12-2009 14:13:12

Yeah, Ideally it should handle no devices gracefully, I'll look into it, thanks!


15-12-2009 21:34:50

Changed code to return false on errors instead of throw() in OgreOggSoundManager::init() function, should be able to handle invalid/non-existent devices now when initialising OgreOggSound, there are other cases where more appropriate exception handling should be used which will be addressed asap.

Update applied to SVN.