Monogame: MG3.8 - can't initialise audio on Android 6.0 and 7.1

Created on 27 Aug 2020  路  9Comments  路  Source: MonoGame/MonoGame

Creating a SoundEffect object produces an exception on Android 6.0. and 7.1.2 devices, including Amazon Fire HD 8 2018

It seems to produce one of two possible errors:

Microsoft.Xna.Framework.Audio.NoAudioHardwareException: Audio has failed to initialize. Call SoundEffect.Initialize() before sound operation to get more specific errors.
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor (System.Byte[] buffer, System.Int32 offset, System.Int32 count, System.Int32 sampleRate, Microsoft.Xna.Framework.Audio.AudioChannels channels, System.Int32 loopStart, System.Int32 loopLength) [0x00028] in :0
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor (System.Byte[] buffer, System.Int32 sampleRate, Microsoft.Xna.Framework.Audio.AudioChannels channels) [0x00000] in :0

or

System.DllNotFoundException: Couldn't initialize OpenAL because the native binaries couldn't be found.
at Microsoft.Xna.Framework.Audio.OpenALSoundController..ctor () [0x00022] in :0
at Microsoft.Xna.Framework.Audio.OpenALSoundController.EnsureInitialized () [0x00014] in :0
at Microsoft.Xna.Framework.Audio.SoundEffect.PlatformInitialize () [0x00000] in :0
at Microsoft.Xna.Framework.Audio.SoundEffect.Initialize () [0x0001d] in :0
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor (System.Byte[] buffer, System.Int32 offset, System.Int32 count, System.Int32 sampleRate, Microsoft.Xna.Framework.Audio.AudioChannels channels, System.Int32 loopStart, System.Int32 loopLength) [0x00011] in :0
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor (System.Byte[] buffer, System.Int32 sampleRate, Microsoft.Xna.Framework.Audio.AudioChannels channels) [0x00000] in :0

What version of MonoGame does the bug occur on:

  • MonoGame 3.8 release nuget android

What operating system are you using:

  • MacOS

What MonoGame platform are you using:

  • Android
Audio

Most helpful comment

I can鈥檛 confirm as I actually don鈥檛 possess one of the affected devices. This is from live crash reports.

Certainly worked on 3.6.

All 9 comments

Does it work on 3.7?

I can鈥檛 confirm as I actually don鈥檛 possess one of the affected devices. This is from live crash reports.

Certainly worked on 3.6.

3.6 was the last error-free version.
Since 3.7 version I always getting random crushes on random devices. And it is always a "openal audio" problem

Duplicate of #6738 I suppose.

I'm gonna keep this one open and close the other one.

This doesn't crash on startup like the other bug but only when trying to instantiate a SoundEffect object. Maybe that's just because 3.8 defers the loading of the openal lib?

Yes, the audio system has been changed so it does not initialize on startup so users can use other audio solutions (like fmod).

The underlying issue is the same.

Are there any docs yet for swapping the audio backend, say for fmod, available @Jjagg as a possible workaround?

According to #6629 the audio is already optional.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Legendree picture Legendree  路  3Comments

bjornenalfa picture bjornenalfa  路  5Comments

SenpaiSharp picture SenpaiSharp  路  3Comments

Jjagg picture Jjagg  路  5Comments

monsieurmax picture monsieurmax  路  5Comments