Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[OpenAL] Wrong exception type when binaries are missing #6515
Even if none of the
This is an issue when using third party sound engines and not shipping the OpenAL binaries.
Please also note that this is broken: https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework/SDL/SDLGamePlatform.cs#L72
I think we should move forward with making the
What version of MonoGame does the bug occur on:
What operating system are you using:
What MonoGame platform are you using:
I've setup #6516 to repair OpenAL entry points, and I'm looking into making the audio namespace optional right now.
The main thing is to avoid calling
What would be the best strategy? Adding a property to
cc @tomspilman for the design decision.
I don't know if it's a good use case. For example, we have a lot of players who were running into issues with OpenAL initialization, and having a non-slient stack trace sent to us with a crash log proved to be useful in helping those players overcoming their incompatibilities issues.
I expect a silent exception to make players wonder why they have no sound at all with developers being unable to figure out why.
My personal view on this issue is that it should be up to the developer to decide what to do upon a
Anyway, there are 2 different questions/issues here:
For now the problem is that the audio system is initialized during the
I'm trying to figure out a route, but I guess that we would have to add initialization checks to every audio calls?
Well... it would be needed in constructors for audio system types and any static audio functions.
It wouldn't be needed in non-static instance methods... as the constructor has to be called first.
So maybe less than we think.
I sort of agree with that.
I think if the developer opts in to this behavior... yes audio initialization failures can be non-fatal and silent.
But i think our default behavior should be to work like XNA and have audio initialization failures throw and exception that must be handled. This way the developer isn't surprised when his game has no audio for some players.... he instead gets crash reports he can diagnose.
But i suggest we fix our templates to maybe include this better initialization to alert new users of the feature.
I was thinking maybe instead we have a new optional initialization method. Like
If you don't call it the system will get initialized on first use which could be at any time and you get a fatal failure. Even then we could disable the sound system and let you continue without sound.
What would we do if then the game tries to call sound sound APIs? Should we crash or fail silently?