Search Issue Tracker

Active

Under Consideration for 6000.0.X, 6000.3.X, 6000.4.X

Votes

9

Found in

6000.0.60f1

6000.2.10f1

6000.3.0b7

6000.4.0a5

6000.5.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

!image-2025-10-29-12-22-04-056.png!

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

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.