Git Product home page Git Product logo

Comments (7)

flibitijibibo avatar flibitijibibo commented on July 19, 2024

What's the XNA4 behavior when no audio device exists? Does it just roll without audio, or does it throw a NoAudioHardwareException?

https://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/Audio/NoAudioHardwareException.cs

If the latter, we need to throw this Exception when we hit this error. (Also, I'm going to take a wild guess and say this is a test best done in VirtualBox?)

from fna-mghistory.

SeanColombo avatar SeanColombo commented on July 19, 2024

I'm not sure how to find what the XNA4 behavior is, short of getting my project to compile with XNA4 (quick googling didn't come up with any explanation of what XNA4 does with no audio). Is that the right way to find out?

The instance of this crash that I had was just on Ubuntu 14 dual-booted on a Dell, not VirtualBox (if that's what you were asking).

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

My recommendation would be to get a really bad VM with Windows on it (ensuring that no audio hardware is enabled), throw a bare-bones XNA4 project on it, and run it. That should throw out this Exception, assuming that a NoSuitableGraphicsDeviceFoundException doesn't come first.

from fna-mghistory.

SeanColombo avatar SeanColombo commented on July 19, 2024

The audio on that computer works fine in Windows... so I disabled all audio hardware devices (which I hope gives a comparable state), then ran a basic XNA4 project. There were no exceptions thrown, and the little app ran fine.

So does that mean that disabling the audio hardware is not the same situation? It seems unlikely that XNA4 would just quietly ignore the issue w/o even an exception?

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

The way I understand it, both XAudio2 and OpenAL enumerate whatever hardware's available, doesn't matter if it's muted/disabled or not. My guess is, the FNA app works there too.

The question is, should we just throw the NoAudioHardwareException for this situation so we know what to do here, or do we go through every single line in the audio subsystem to account for no sound device, if it turns out that XNA is willing to play both SoundEffect and XACT data even when no audio hardware is recognized by Windows?

For me it's hard to muster up the time for this, as I generally expect that people will have a sound card when running a game. (To be honest I'm surprised ALSA doesn't see anything on that PC, what audio hardware is this...?)

from fna-mghistory.

darthdurden avatar darthdurden commented on July 19, 2024

Ok! I looked into it and if you don't have any usable hardware on in a straight XNA game, you get a NoAudioHardwareException when you call Content.Load<SoundEffect>(). I've reworked the OpenAL stuff a bit to remove the vanilla Exception's from the OpenALDevice constructor and in SoundEffect.INTERNAL_bufferData I added a check after AL.GenBuffer() to see if we are getting a non-zero buffer back. If we aren't, I throw the NoAudioHardwareException. It now seems to mimic the XNA behavior as far as I can tell. Kosher? I'll check this in as yet another changeset if you think it will fly.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

Think we got this one!

f812df5

from fna-mghistory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.