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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bug Audio Crackling

Discussion in 'Android' started by Velketor, Jul 13, 2019.

  1. Velketor

    Velketor

    Joined:
    Sep 15, 2007
    Posts:
    110
    I have an audio track that sounds great on every platform except Android. Unfortunately on Android it randomly has a 'crackling' or 'popping' sound throughout the entire track.

    I've tried every possible combination of compression/quality and I've tried .wav and .mp3 with no luck and exported the sound with very low db but it continues to happen. I've searched the internet far and wide and this seems to be a common issue with no common solution. Any thoughts are greatly appreciated. I can't launch my app like this!

    **UPDATE**
    Turning WiFi OFF solved the issue. Apparently this has been a problem for a while now on Android ever since they updated to Pie in April 2019. You cannot play a game while using WiFi or you hear the crackling/popping sound.
     
    Last edited: Jul 14, 2019
    hungrybelome likes this.
  2. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    Thank you so much for the update. I was losing my mind trying to figure out why my game starting having audio crackling on my S8!
     
  3. swifter14

    swifter14

    Joined:
    Mar 2, 2017
    Posts:
    165
    So that's it? that's the solution? telling all the users who play the app to turn off their wi-fi? It seems like some other apps for example Plex had the same issue and they fixed it in one of their updates (google it) also some other games I download on my phone, Candy Crash for example, don't have that problem with Wi-Fi on. How did they found a solution??
     
    ttran07 likes this.
  4. zackrump

    zackrump

    Joined:
    Jan 19, 2014
    Posts:
    9
    Thanks for the sanity check. Indeed, turning wifi off solved the crackling on my S8.
     
  5. swifter14

    swifter14

    Joined:
    Mar 2, 2017
    Posts:
    165
    It doesn't fix it 100% ... you can still hear it sometimes. It's not a proper solution but I reported the bug to Unity
     
    jcbhmmn likes this.
  6. swifter14

    swifter14

    Joined:
    Mar 2, 2017
    Posts:
    165
    Unity responded that they don't see the problem when they test it = there's no problem:
    "Without reproducing the issue on our end there isn't much that we can do here.
    Also, it very well may be that these issues that are being discussed in the forums could be caused by different things and are not the same issue.

    As I cannot reproduce this I am closing this ticket for now, if any other useful information comes up reply to this email."
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Oh yeah we’ve been getting that audio bug randomly as well. We just thought “someone at Unity fixed something again” shrugged and moved on with our lives.

    A simple check list before submitting bugs is :

    -Can I explain this bug to my 3 year old niece?
    -Does this bug happen 100% of the time.
    -Am I fine with the fix arriving in 3 months at best.
    -Am I fine donating a lot of my free time to a company that is making a gazillion dollars and that I’ve already given thousands to.
    -Am I fine with losing more hair, because getting Unity to fix something is a stressful process.

    If the answer to any of the above is “no”, please don’t bother with bug reports. Them refusing to fix anything without a user donating their time is their problem and not ours.
     
  8. BennyKokMusic

    BennyKokMusic

    Joined:
    Dec 22, 2016
    Posts:
    32
    Also having similar issues, without wifi, it seems fine on Android P
    p.s. built using 2019.4 LTS

    edit, my Android Device is running Android 10, seems also have this problem
     
    Last edited: Jun 16, 2020
  9. swifter14

    swifter14

    Joined:
    Mar 2, 2017
    Posts:
    165
  10. GameEverything

    GameEverything

    Joined:
    Feb 22, 2016
    Posts:
    10
    Lol, love this explanation. I'm currently working on fixing this problem so I'll keep y'all updated if you haven't found a non-turn-off-wi-fi fix.

    Edit: So I went here Clicky Clicky and downloaded a sample audio file to test. Indeed wi-fi is the culprit. If you start the app with wi-fi off there is zero crackling, clicking, popping, etc. If you start the app with wi-fi on, it's noise galore.

    Per what one of the users here suggested as a fix regarding the code in a Start function, that didn't work for me at all.

    Currently on a Samsung S8 and I've read just today that S9/10 have the same issues. :(
     
    Last edited: Dec 6, 2020
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Our solution was to just disable Unity audio and use FMOD Studio.

    Benefits are:
    -Things just work. Turns out when Unity doesn't put its hands into it, FMOD is pretty good.
    -It's a lot more powerful and easy to use for more complex audio stuff.
    -We get keep a lot of our Audio work and know-how when we eventually ditch Unity.
     
  12. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    14
    Turning WIFI off fixed this crackling for me as well.
     
  13. swifter14

    swifter14

    Joined:
    Mar 2, 2017
    Posts:
    165
    For everyone- here is the solution, don't play with wifi settings. -
    1. private void Start()
    2. {
    3. AudioConfiguration config = AudioSettings.GetConfiguration();
    4. config.dspBufferSize = 64;
    5. AudioSettings.Reset(config);
    6. }
     
    ahules, jqhan and Joy-less like this.
  14. ahules

    ahules

    Joined:
    Jan 1, 2023
    Posts:
    7
    I
    This works!
     
  15. ttran07

    ttran07

    Joined:
    Mar 9, 2019
    Posts:
    9
    The music is now smoother, yes
    But my sound effects are all delayed by about .2 of a second and it is extremely noticeable (clicking a button plays the sound after a slight noticeable delay)

    This isn't a good solution.

    FMOD charges you, the developer, after you make specific amount of revenue
    Unity built-in audio does not... and it works just fine for most part, though I admit FMOD is better for bigger and more complex project
    Again, this isn't a solution for the Unity bug.
     
    Last edited: Oct 23, 2023
  16. ttran07

    ttran07

    Joined:
    Mar 9, 2019
    Posts:
    9
    I CONFIRMED THIS IS A Samsung Galaxy S8 issue!
    I tested on S8 and S10 and only S8 experiences it

    No wonder Unity cannot replicate this issue!
     
  17. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    365
    Noticed the very same problem on a Google Pixel 8. The 64 setting worked for me, but I'm not sure if it is a good solution to set an audio buffer that low. What irritates me: Usually, an audio buffer that is too *low* causes crackles, at least in a DAW. Why it is the other way around for Unity?!
     
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    I think it does enough for you that it's worth the fee, which kicks in after $200k of revenue per year.
    There is no solution for the Unity bug, they won't fix it. They are refusing to touch anything related to audio for many years now.