Giter Site home page Giter Site logo

Comments (4)

ldicker83 avatar ldicker83 commented on June 13, 2024

Running in a VM often causes this as an invalid or null audio device is provided to SDL and NAS2D assumes with MixerSDL that it will always get a valid audio device. There used to be (may still exist) a Null Mixer that could be used in its place if an invalid audio mixer is provided but there is no automatic fallback at this point, the end user needs to do that and OPHD doesn't check for problems with the mixer.

from nas2d-core.

DanRStevens avatar DanRStevens commented on June 13, 2024

I'm pretty sure that's not the problem. All the VMs I've ever used have always had default audio hardware. And I vaguely remember you saying basically the same thing last time we had a problem with the audio, and it turned out to be the vcpkg feature flags to enable that format needed to be passed when building SDL2-mixer.

Couple that with a fairly recent change that removed the SDL2-mixer flags, I think that's the problem. There never really was much of an explanation for why the feature flags were removed. Supposedly because of problems, and removing the flags made the errors go away, though the audio format error was a runtime issue, so could easily have been missed during that change. At any rate, I never saw the original error that removing the flags supposedly addressed, nor any documentation suggesting there had been a change.

The vcpkg port file still defines optional features, and none of them are default:
https://github.com/microsoft/vcpkg/blob/2718aa52a31977b792af7e9c2f83eaf4ddcd932d/ports/sdl2-mixer/vcpkg.json#L4

Pretty sure we simply removed the feature flag needed for the OGG audio format.


Also, we already do have fallback code to use MixerNull:

		try
		{
			Utility<Mixer>::init<MixerSDL>();
		}
		catch (...)
		{
			Utility<Mixer>::init<MixerNull>();
		}

from nas2d-core.

ldicker83 avatar ldicker83 commented on June 13, 2024

Huh. Well then.

It's weird that it's a problem, I thought I'd tried a full build on a clean Windows install afterward. Will have to look further into it.

from nas2d-core.

DanRStevens avatar DanRStevens commented on June 13, 2024

So you may have been right about the VM lacking audio support. I double checked the VM, and it indeed lacked audio support. Adding audio hardware to the VM allowed the game to play sound.


There were a few interesting findings while looking into this. First off is that the PostBuildEvent used in OPHD to copy OGG related DLL files is no longer needed (PR OutpostUniverse/OPHD#1392). It seems vcpkg will copy these files on it's own now.


Perhaps related to that, is the removal of the vcpkg flag for libvorbis when installing sdl2-mixer. It seems the core install of sdl2-mixer with vcpkg now includes support for OGG files.


The two flags that vcpkg removed for sdl2-mixer were:

  • libvorbis
  • nativemidi

Additionally, the sdl2-mixer package has a feature flag which was possibly added since then:

  • fluidsynth

That means the following flags are potentially now usable:
"features": ["opusfile", "mpg123", "libmodplug", "libflac", "fluidsynth"]


To investigate, I branched off the point before the flags were removed, so I could run a CI build and see any errors concerning the flags. The flags were removed in commit 7405f6e, so need to branch off of commit 0c6a9a5.

Errors were:

  • Package names converted to lowercase (SDL -> sdl)
  • Two errors about unsupported flags

Build Logs:


Not sure if we want to add back any extra feature flags. We probably don't need them, and only experimented with them to get OGG support. Though it may be useful to have that extra support if people want to mod the game.

from nas2d-core.

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.