cortex-command-community / Cortex-Command-Community-Project

Cortex Command - Open Source under GNU AGPL v3
https://cortex-command-community.github.io/
GNU Affero General Public License v3.0
106 stars 14 forks source link

Operation could not be performed because specified sound/DSP connection is not ready #90

Open MyNameIsTrez opened 8 months ago

MyNameIsTrez commented 8 months ago

Describe the bug

This error is being printed from AudioMan::PlaySoundContainer():

ERROR: Could not update sound properties for SoundContainer None: Operation could not be performed because specified sound/DSP connection is not ready.

While the mod doesn't do anything fundamentally wrong.

Pawnis told me the cause is fmod loading being async, but the mod only has a handful of SoundContainers.

To Reproduce

  1. Download CoalMini.rte.zip
  2. Download Benchmark.rte.zip
  3. Use this in your Settings.ini to instantly have the issue printed when the game boots:
    LaunchIntoActivity = 1
    DefaultActivityType = GAScripted
    DefaultActivityName = Combat Benchmark
    DefaultSceneName = Benchmark
pawnishoovy commented 8 months ago

NotABug, just slow methodology

the "i don't want this to ever show up in the console" fix is to force the loading screen to stay on until FMOD is done loading everything, but as mods and sounds pile up in the hundreds of megabytes/thousands of sound files, this can add several minutes to loading times. maybe this could be an option? i recognize that it messes with scripts like yours which take any console output to mean an error that has to be fixed, but this is more of a warning that can't be "fixed".

another option is some form of infrastructural change to prioritize parsing SoundContainers first so we can tell FMOD as quickly as possible to begin loading the sounds within, but considering our parsing is currently just plain top-to-bottom this would be pretty significant.

another option entirely which would also require infrastructural changes but which actually reflects modern game development more is to move to a system where we dynamically load/unload sounds as we need them instead of trying to pack the memory with everything at startup. for instance if you pick a ronin v coalition game, the loading screen there would include loading all base, ronin, and coalition sounds to have them ready for that match, then if you happen to buy a techion gun fmod quickly loads those sounds in 50ms or whatever, and if you quit the match everything is purged and the process repeats.