1
Vote

MonoGame Doesn't Play Sounds on XP

description

Solution: If you have a RealTek audio card (I have an integrated ALC888), you may solve this by turning off hardware acceleration (Control Panel > Sound > Advanced, turn the slider down to disable acceleration)

I documented some of this here in this discussion: http://monogame.codeplex.com/discussions/405222

I have a simple game that uses MonoGame; it uses SoundEffect to play sounds. On my Windows 7 dev laptop, the sounds play fine; on my main machine (XP 32-bit, I know, I know), the sounds don't play -- silence. No exceptions, crashes, etc.

Some facts:
  • Running 32-bit Windows XP SP3
  • Installed MonoGame 3.0 Beta
  • Sound files are WAV (for now)
  • Also tried WMAs -- they worked in raw XNA (XNA 4.0) but not when I switched over to MonoGame
  • I installed OpenAL (twice, at least) from the MonoGame installer kit, as well as separately from the OpenAL site (page on OpenTK, I think)
Someone on IRC suggested I try and debug this myself. I did some digging, and this is what I found -- source revision is 417c8f0:
  • AL.GenSources(...) (OpenAL.SoundController.cs, line 52) returns an array of zeros.
  • SoundEffectInstance.Play() returns true for the first call to isSourceAvailable (line 198), and subsequentially, returns false; it tries to load the sound buffer with SourceId = 0. I actually do have a buffer ID -- AL.Source(soundBuffer.SourceId, ALSourcei.Buffer, bufferId) has the values (0, Buffer, 132983168).
    controller.PlaySound(soundBuffer) doesn't play anything (silence)
  • On subsequent calls, there are no available buffers -- the buffer for the first call never gets recycled.
I don't know anything about OpenAL, but I will help in any way that I can. Please help me to resolve this issue.

Also, if you have an XP machine, please verify if you can play audio via MonoGame 3.0. Attached is a converted version of the XNA Platform Starter Kit, which I converted first to XNA 4.0, then to MonoGame, then linked to the MonoGame source libraries.

Sorry about the paths. I also deleted music.wma and several backgrounds to make it fit under 4MB.

file attachments

comments

ashes999 wrote Dec 11, 2012 at 1:48 PM

As a work-around, I moved my audio to NAudio for the time being. It works pretty well, and I have a lightweight, psudo-SoundEffect class that plays MP3, OGG, and WAV files.

ashes999 wrote Apr 14, 2013 at 6:54 PM

I also solved this by turning off hardware acceleration on my sound drivers (RealTek cards seem to have this problem). That made OpenAL work.