Comments (4)
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.
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.
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.
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:
- https://github.com/lairworks/nas2d-core/actions/runs/5085908388/jobs/9139861943
-
:1:1: error: invalid character in package name (must be lowercase, digits, '-')
on expression: SDL2
-
- https://github.com/lairworks/nas2d-core/actions/runs/5085917795/jobs/9139880463
-
sdl2-mixer has no feature named nativemidi.
-
- https://github.com/lairworks/nas2d-core/actions/runs/5085928257/jobs/9139900389#step:1:36
-
sdl2-mixer has no feature named libvorbis.
-
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)
- Refactor Rectangle::translate to modify the rectangle in-place instead of returning a copy HOT 1
- Cross platform builds with Clang
- Update `Delegate` and `Signal` for lambdas HOT 5
- Arch Linux compile error HOT 2
- Remove `argv_0` from `Filesystem` constructor
- Fix test-graphics `uniform_int_distribution` template parameter HOT 1
- Update MacOS build image HOT 1
- Re-evaluate MacOS support...? HOT 5
- Use config specific intermediate folders with `make` HOT 1
- Refactor MSVC project files HOT 1
- Fix debug builds of unit test project HOT 4
- Fix `vcpkg` caching on CI HOT 1
- Remove Resource names HOT 1
- Remove Doxygen comments on private class fields HOT 1
- Improve `makefile` project semantics HOT 3
- Use Response Files for `make` builds
- Pulled latest, vcpkg fails to build HOT 2
- `EventHandler` key modifier checks should be `static`
- Update Build Images
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nas2d-core.