Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question 2022 Performance - FMOD Audibility Computation

Discussion in 'Audio & Video' started by leea1, Jun 8, 2023.

  1. leea1

    leea1

    Joined:
    May 13, 2020
    Posts:
    10
    Hi all,

    Since the 2022 LTS was released, I've been doing a test upgrade of our project. Our project used to run with a framerate in the hundreds (2021 LTS) but is now in the teens (any 2022 version). Running the profiler, shows that the majority of this is in the Audio.FMODSystemUpdate > Audibility computation.

    2022-audio-profiler.png

    Our project has a rather large number of AudioSources (2K+) added at startup/runtime from about 400 AudioClips, but very few, if any, are playing at any given time. In fact, I had zero playing and performance was still abysmal. In any case, 2021 was fine...

    Does anyone know what changed in the 2022 versions that could cause this? General thoughts/comments welcome as well...

    Thanks!
     
    Unifikation likes this.
  2. Evgeno

    Evgeno

    Joined:
    Sep 8, 2014
    Posts:
    48
    Also interested in this issue
     
  3. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    +1 What's going on here?
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Make a bug report with both 2021 and 2022 versions attatched so it can be fixed
     
  5. leea1

    leea1

    Joined:
    May 13, 2020
    Posts:
    10
    I wasn't sure if this was actually a bug or something we simply missed, so I wanted to gather more info first.

    Found a workaround... disabling all AudioSources then re-enabling them all seems to address our issues, at least initially at startup (I'd expect actually playing a large number of sounds would eventually reduce performance).

    It does seem like a bug since simply disabling/enabling AudioSource corrects, will work on another bug report *sigh*...

    Aside from not playing, does anyone know what disabling does?
     
    DevDunk likes this.
  6. rafaelmfernandez

    rafaelmfernandez

    Joined:
    Aug 11, 2013
    Posts:
    62
    Same issue here. Its only about 2ms for me but still significant issue.
     
  7. leea1

    leea1

    Joined:
    May 13, 2020
    Posts:
    10
    For those curious, this was categorized as a regression, but "by design"...
    https://issuetracker.unity3d.com/issues/performance-drops-when-using-a-lot-of-audio-sources

    Though I'm not sure my report got transcribed correctly between bug report and issue ticket. i.e. you don't have to be playing any of the sounds to lose performance and various cases that have AudioSources in the same state result in some working and some not...
    • AudioSources attached/enabled to scene before playing = ok
    • AudioSources attached/enabled in "Start" = bad
    • AudioSources attached/enabled in "Start" then toggle disabled/enabled = ok
    • Regardless of how attached, playing an AudioSource (that completes and doesn't loop) = incrementally bad (leaks performance)
     
    Last edited: Aug 10, 2023
  8. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    Did they say why unused AudioSources were designed to be a slowdown?

    I'm doing much the same as you, huge pools of AudioSources.