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

Bug AudioClip.GetData() crashes in the Editor

Discussion in 'Audio & Video' started by DreamingImLatios, Oct 4, 2023.

  1. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    This has been a long-running bug for me, of which I have reported multiple times over the last three years. It is a bug that only affects ECS projects, and now with ECS being well into production status, I'm hoping someone will finally take this seriously.

    The issue happens simply by calling AudioClip.GetData() inside a baker or baking system that runs during background subscene import. The crash logs errors about FMOD not being able to find some kind of audio device (seems to be slightly different on different machines) and performs a fatal abort. It doesn't happen all the time, and more frequently occurs on some machines than others and also occurs more frequently after a domain reload. Because of all this, I suspect there's a race condition deep within the engine/editor related to audio.

    Happens on the latest LTS and pretty much every single version prior.
     
  2. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    290
    Can you give me the link of the bug report you submitted? I'll have a look at it.

    Cheers!
     
  3. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    IN-18952 is one of the reports. It should link to the others. However, if you need something simpler and more up-to-date with the latest ECS version, I can try to put something together.
     
  4. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    290
    Looks like I "can't view it or it's been deleted"...

    If you are able to repro this on a recent version and submit a fresh bug report, it would be amazing yes. Let me know when it's done and I'll push it internally. Crashes are generally processed with more urgency than other types of bugs.
     
  5. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    Weird. It shows up for me:
    upload_2023-10-10_10-51-27.png

    I'm not having a good week this week and it may be a few days before I can get you the smaller repro. But this crash happens in a publicly distributed GitHub repo package, so I will ask the community to post their bug reports here in the interim.
     
  6. ShotgunBaby

    ShotgunBaby

    Joined:
    Jan 9, 2017
    Posts:
    1
    My report number for this is
    IN-56643 - Rebaking a subscene with an audio source using GetClip
    It happens inconsistently so may need to make code changes and reimport couple times

    The scene is called TestBed, don't think i mentioned that in report
     
    Last edited: Oct 10, 2023
    DreamingImLatios likes this.
  7. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    I had a little more time today than I thought I would, and managed to put this minimal repro together: IN-57217.

    This popup shows when it crashes:
    upload_2023-10-10_22-58-59.png

    If for whatever reason you can't access the bug, PM me and I will send you whatever info you need (project, crash dumps, ect).
     
    Last edited: Oct 11, 2023
    SeventhString likes this.
  8. gwenaelle_unity

    gwenaelle_unity

    Unity Technologies

    Joined:
    Jul 24, 2018
    Posts:
    16
    We just fixed it in the engine. FMOD wasn't enabled for asset import workers in 2022.3 and below
     
  9. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    Is this fix going to land in a 22 LTS? If so, any estimate which version it will arrive in?
     
  10. gwenaelle_unity

    gwenaelle_unity

    Unity Technologies

    Joined:
    Jul 24, 2018
    Posts:
    16
    Yes, it will be in the version 2022.3.13f1