Search Issue Tracker

Won't Fix

Votes

9

Found in

2020.3.0f2

2021.3.0f1

2022.1.0f1

2022.2.0a1

Issue ID

UUM-404

Regression

No

Large delay on SoundHandle.Instance.Destructor when disabling AudioSource

--

-

How to reproduce:
1. Open the attached project's Scene labeled "SampleScene"
2. Open the Profiler (Window->Analysis->Profiler)
3. Enter the Play Mode
4. In the Profiler Window, observe the performance

Expected result: There's no high impact on performance when disabling a single AudioSource
Actual result: There's a large delay on SoundHandle.Instance.Destructor

Reproducible with: 2018.4.31f1, 2019.4.21f1, 2020.2.3f1, 2021.1.0b4, 2021.1.0a4

Note: In Unity 2018.4.31f1, delay is on PostLateUpdate.UpdateAudio instead

  1. Resolution Note:

    Thank you for bringing this issue to our attention. Unfortunately, after careful consideration we will not be addressing your issue at this time, as we are currently committed to resolving other higher-priority issues. Our priority levels are determined by factors such as the severity and frequency of an issue and the number of users affected by it.
    Our current areas of focus include processing user feedback related to the recently-delivered Audio Random Container, as well as evolving other workflows. We know each case is different, so do please continue to log any issues you find, as well as provide general feedback on our roadmap page to help us prioritize.
    Roadmap: https://unity.com/roadmap/unity-platform/audio-video

Comments (6)

  1. Starburst999

    Mar 21, 2024 14:54

    For me, it was because I was alternating between two different music that had the "streaming" option enabled, using "Compressed In Memory" instead, the issue got away.

    Shame again on Unity to swept a performance issue under the rug instead of addressing it... There's absolutely no good reason for this method to takes soooooo much CPU time, something's wrong.

    Hoping for the "new" Unity to instead focus on fixing their product instead of pumping new features that aren't production ready for years and when it does, it perform worse than the alternative.

  2. lsdrambo

    Jun 08, 2023 00:18

    I found why it happened on our scene: a game side behaviour would call AudioSource.Stop() and then Play(), in the same function, every frame. After a few seconds (or minutes?) I could notice a framerate drop caused by SOUNDHANDLE.INSTANCE.DESTRUCTOR.

    After I fixed the issue so there were no scripts who would call Stop() and Play() in the same function every frame, there were no framerate drop anymore.

  3. vinnygombici

    Jun 06, 2023 12:01

    Same bug here!

  4. lsdrambo

    Jun 02, 2023 12:22

    I have the same issue in Unity 2021.3.24f1. I play my game normally, many sounds playing and stopping, and then at one point, get a framerate drop. If I look at the profiler window, I can see that the function SOUNDHANDLE.INSTANCE.DESTRUCTOR is taking 15% to 33% of the CPU time for about 10 seconds.

    If I disable all sound playing, I don't get any framerate drop at that specific point.

  5. Mikkel_Munch-Christiansen

    Apr 21, 2023 12:17

    Hi. Can you elaborate on the use case, where you see this issue? We want to understand it better:-)

  6. MylesLambert

    Nov 26, 2021 01:04

    Any response from Unity as to what can be done to avoid this? I have a case where it's taking almost 8ms (half of my frametime) to run SoundHandle.Instance.Destructor.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.