- Home /
Problems with audio (audio popping / crackling) and Wi-Fi
I have a problem with Galaxy s8 and my app, the music in the game has some popping sounds/crackling, I tried everything- re-importing the files to *.OGG, changing the bitrate, compression settings, audio settings, nothing worked.
In the end, I found a post that solved the issue- when you disable the Wi-Fi on Galaxy S8, the music suddenly becomes fine. And it worked, but it's obviously not a solution.
But it's definitely Unity issue, because other games f(or example candy crush) on my phone don't have any problems with the music, just my unity apps.
My unity version is 2019.2.18f1
Found the fix to audio crackling on Android 9 Pie Galaxy S8 devices within Unity 3D!!!!! forum.unity.com/threads/dsp-buffer-size-differences-why-isnt-it-a-setting-per-platform.447925/
Add this to your starting script, or right before you call audio.Play();
void Start() {
AudioConfiguration config = AudioSettings.GetConfiguration(); config.dspBufferSize = 64; AudioSettings.Reset(config); }
I found you can set this in C#. DSP on Audio Project Settings doesn't go down to 32 or 64. At 128 it starts crackling all the way up to 80192.
The popping and crackling has gone away.
However found that this fixed on Galaxy s8 with Pie, other devices require 1024 DSP. So I ended up building a settings form so users could select 64, 128, 512 1024, 2048, and so on.
It sucks to have to do this when it works on iPhone and other Android devices, just some Android devices has popping and changing to 64 DPS sounds great, thou may cause other devices to not work.
Hope this helps. Hopefully Unity 2020 fixes this, or newer versions of Android on Samsung fixes this issue.
Answer by BBIT-SOLUTIONS · Mar 08, 2020 at 09:05 PM
That's strange, especially that it works with disabled Wi-Fi. Sounds like there are any waves interfering or similar?!
Think the following information would be useful to analyze in more detail:
Did you try to play the ogg file in a simple audio-player on your device, too?
Also do you have any effects (EQ, high-pass-filter, etc) on the sound?
And could you maybe share a record or the sound-file itself (of course just if it's not under NDA). Or show an screenshot of the waves when opened the sound in Audacity or similar?
That was an interesting idea, but there's no problem with the files when I play in an audio player, only with my app from Unity, and it's not just one music file but all of my files, and I tried- .ogg .wav *.mp3 I don't have any effects...
Some famous apps for example- SoundCloud, Spotify, Plex, and more , had the exact same problem with their apps, making many users complain about the static sounds on Galaxy s8 devices. In the end, after a few months, those apps released a fix. How did they fix it? Who knows?
How can we fix the problem on Unity for our apps? That's the question
The thread of the exact same problem for SoundCloud- https://community.soundcloud.com/android-230073/android-8-0-galaxy-s8-cracking-popping-audio-7408303/index3.html
The thread of the problem for Plex- https://forums.plex.tv/t/static-and-popping-while-playing-music-after-upgrading-to-android-pie/398244
They fixed it in the end, how can we fix it on Unity?
Oh ok, was not aware, that other apps had the same problem. Really strange, but now I'm also interested how they fixed it ;-)
Unfortunatelly both of your links don't work for me ("page not found"). Do you need to log in to both of them to be able to read?
One other idea: $$anonymous$$aybe you could try using latest Unity version 2019.3. $$anonymous$$aybe they fixed it internally already?
try again now. Wi-fi off doesn't fix the problem completely but reduces 90% of the popping sounds
Answer by dezzell · Apr 17, 2020 at 03:50 AM
Any fix for this? I have 2 apps built in the latest Unity 2019.3.10 and came from 2018 versions which all seemed to work fine on Android prior to 2019.
After going to 2019, all audios and recording have a crackling sound throughout the audio.
These audios are for meditation and to have crackling throughout is not great.
I'm on Samsung Galaxy S8 using Android 9 Pie.
If I turn wifi off, the crackling goes away. Turn wifi on, and it's back.
Even with Recording through Unity within the app and playback is also crackling.
Does this with wav, mp3, egg and recordings attached to audio clip.
I changed Audio settings quality under project settings and messed with the different settings, however nothing works.
Plays great in editor and on Apple IOS, just Android with the latest version of Unity 2019.3.10 is still not fixed.
Anyone have a fix for these? All unity apps on Android 9 with wifi enable causes crackling popping throughout audio. Turn wifi off and it sounds great.
Anyway to fix this?
I still did not experience this problem by myself, but read in lots of forums in the meantime, that people describe the same problem.
The problem seems to occur mainly on Samsung phones. So in the meantime i guess, that it is really a hardware-problem, that maybe the antennas are too close to the speaker or the audio-chip or similar. So i guess the only real perfect solution is to hope for a firmware upgrade.
But another idea, which i have, and which you could try from software-side: $$anonymous$$aybe you can avoid the problem, when you could find out, which frequencies of your sound-file cause the problem. $$anonymous$$aybe there are really some specific ones, which interfere with the wifi-waves and create the crackling sounds.
You could maybe try to find them out by using e.g. this sound
If you find specific ranges, then you could maybe try to cut whole frequency bands out of your sound (or just turn them down a bit).
If your file could then be played without crackling, you could maybe try to pitch the whole file completely either a bit higher or lower very slighty, or put an equalizer on the sound, which reduces it, so that you don't change the whole song itself, but you could avoid the problematic frequencies.
This is of course just an idea, because i could not experience the problem by myself yet. But based on what i've read so far this could maybe help.
I use different frequencies within the music for relaxation, like 6hz, 528hz, 432hz, 110hz.. The popping happens on $$anonymous$$icrophone Recordings as well and regular audio no frequencies. So within the Unity 3D app, I record from the microphone and it too crackles and pops...
It did not do this with previous 2018 Unity versions, only when I upgraded to 2019.2 and 2019.3 for several different Unity Apps I created.
So it is only an issue with Unity 3D on Samsung with Android Pie.
I tried adjusting sound quality, limiting number of voices and so on.. Nothing seems to work. Disabling WiFi works great. I just need to put a note at the top, disable WiFi if you hear popping...
It has to be some issue with networking in Unity. I was thinking of doing a function to disable wifi on playback, and enable after, but may cause issues, plus have to request wifi change.
Did shlighter resolve it? How did others resolve. Hopefully Android 10 will be available for Galaxy devices soon.
oh ok, so it worked with older Unity versions on the same phone?
$$anonymous$$aybe you are right and then it really depends on the Networking extension of this Unity version. You could try switching back to the older Networking extension package and use it with your current Unity version. The different ones are all available here
Your approach of disabling wifi could maybe also work, but i don't think it's good for usability. Because, like you told, you need then permission to wifi-exchange and you should somehow explain that to your users then. And when not even we developers understand the reason correctly, it would be hard to understand for users, why they should give you access to it^^
Answer by Haze-Games · May 26, 2020 at 10:36 PM
We have the same issue. Any news or fix for this ? Thank you!
AudioConfiguration config = AudioSettings.GetConfiguration(); config.dspBufferSize = 64; AudioSettings.Reset(config);
This fixed the crackling sounds on Galaxy for me.
However, video audio stopped working.
So I had to change back to 1024 for videos.
I created an audio settings form, and give user the ability to change from 1024 dspBuffer to 64.
So default is 1024, and if device has crackling audio, they can change to 64. I save settings to a file and read the file on startup to set dspBuffer.
It sucks, but I've not found any other fix.
It has something to do with WiFi and CPU with Unity, and still not working in latest version of Unity on Android Pie 9, Galaxy devices.
Hope this helps you.
You can't just set to dspBuffer 64 for all devices, because there is no sound on iPhone and other Droid devices, requires 1024.
Wish there was an easier way, for now adding a settings form and allowing users to set audio quality manually is the best approach for now, until Unity and Android fix it.
Thanks for replying, @dezzell! I will definitely give this a try!
Thank you! this worked perfectly for me (Nokia 6.1)
Answer by forerun · Jun 07, 2020 at 11:28 AM
can someone help me answer this please?! https://answers.unity.com/questions/1739255/why-is-touchphasebegan-firing-every-frame.html
Your answer
Follow this Question
Related Questions
Play local Android/IOS audio files in unity game. 0 Answers
Audio Gets Distorted in Android Build 0 Answers
Read audio/music currently playing on speakers? 0 Answers
Android play mp3 file 0 Answers
Audio Crackling 1 Answer