Simulator causing Mac audio distortion

I am experiencing an issue where my Mac's speakers will crackle and pop when running an app on the Simulator or even when previewing SwiftUI with Live Preview.

I am using a 16" MacBook Pro (i9) and I'm running Xcode 12.2 on Big Sur (11.0.1).

Killing coreaudiod temporarily fixes the problem however this is not much of a solution.

Is anyone else having this problem?


Post not yet marked as solved Up vote post of joltguy Down vote post of joltguy
10k views
  • This is still happening on a Mac M1. macOS Ventura. XCode 14.3.1 iOS Simulators (all versions).

    And I also believe this is what caused the speakers on my previous MacBook to fry, since it happened there too and was the reason I got the new M1 Macbook.

Add a Comment

Replies

Having the same issue. Preview and simulator with Swift UI is making music coming from Spotify distort and crackle. Heard something about turning off mic on simulator, haven't found how to.
I have the same issue here... It's very annoying
Having this too! I've read somewhere that if you switch sound output (IO in context menu -> output device) to a second one (if you are using headphones, then set output to speakers) will solve the issue, and it is true, but this not works if I using only built-in speakers... I hope that Apple will fix it
install Blackhole 2ch from:
https://github.com/ExistentialAudio/BlackHole

With your Simulator open go to I/O > Audio output > Blackhole 2 ch.

This worked for me - I hope it helps! (but yeah... it needs to be fixed!)
  • Thanks so much. Finally sorted.

  • Thanks bro, you just fixed my headache

Add a Comment

The changing audio output solution works for simulator. What about SwiftUI Previews? Fixing the issue requires closing Xcode. It is hard to develop apps with closed Xcode...

  • For SwiftUI Previews, open your monitor, force quit the "coreaudiod" process.

Add a Comment

Had the same issue when running Preview Canvas with Xcode 12.5.1.

Fixed it with going to System Preferences -> Sound -> Input -> Change it to Macbook Pro Microphone (Basically internal mic of your device).

Hope this helps you.

  • The Mac Mini doesn't have an internal mic. Is this seriously not fixed yet?

  • Im also on a M1 Mac mini and this is very frustrating. I don't want audio in my previews or app development, is there a way to kill audio in Xcode completely?

  • This here worked for me, Thanks!

Add a Comment

I have the same issue and know a fix for this and possibly the reason.

The fix is to go into the system preferences -> Sound, then go to input and change the input source to something other than your headphones. (shortcut: option + any volume key)

I don't know how to fix this at an Xcode level, or if you only have one input device though.

Just for anyone who cares, the reason for the stuffy audio is that Xcode starts a phone call, and I suppose my headphones don't like to output clean sound with the mic taking inputs. I know that Xcode is starting a call because my headphones have bluetooth multipoint, as well as giving me verbal feedback about whats going on with them. When bluetooth multipoint is active my audio will switch cleanly between my iMac and Ipad pro, unless one of them is taking a phone call then the phone call will get priority. When I get this muffled audio, my headphones won't switch to my Ipad to play audio, which suggests that a phone call is in progress. What really says that a call is in progress, is that when I change the input source in system preferences away from my headphones, the audio clears up but my headphones also say "call ended". All this means that Xcode must be starting a phone call for some reason, and my headphones don't like that.

Why my iMac speakers are happy to play music while "taking a phone call" but my headphones aren't may mean that it isn't a macOS issue but a limitation with the headphones, but this is just guess work.

  • This! You figured out what is wrong and what is causing it, but Apple do not seem to be fixing anything. I cannot listen to music or watch anything while working with Xcode and previews. So I just wasted 500+€ for airpod max headphones? They should add a setting in xcode, to disable audio and let us use audio for other things...

Add a Comment

As Ij000 mentioned, it's a Bluetooth limitation (turning on the mic channel leaves less bandwidth for music), but its worth noting it happens with AirPods too just to preempt any 'it must be your headphones' excuse.

Until then, you can get around it with any of the fake audio devices like Soundflower or Blackhole. Just remember to change it back before answering any calls on it!

Really does need fixing though. Like lots of others I listen to music & watch stuff while developing, so you can imagine how unbelievably frustrating it is to suddenly have to work in silence.

Don't want to come across negative but surely somebody at Apple has launched a simulator while wearing AirPods and noticed this, right? It's been doing this for (at least) two years?

I have been experiencing this issue since 2019... why this is not fixed yet? I have switched two laptops already and it still present through devices and OSs..

  • apple never ever fix thier own issue their testers are just to harass developers with stupid rejections

Add a Comment

I am having this issue almost all the time. Use case: Running XCode with a simulator and listening to Spotify. Always when you rerun the project or enable the "Debug view hierarchy" you hear annoying crackle and distortions in the music being played. I guess the reason can be also in my in-app muted videos, but it is still a bug from XCode. Now playing the music from the iPad :(

I have the same issue - the same MacBook Pro (2019) Intel i9 processor as the original post. I didn't notice it was caused by the simulator but it makes sense as I use the simulator for work all the time.

I am not interested in a workaround. I am not sure I understand why that's not fixed already

It's been more than 3 years (Intel + M1 machines) since I am experiencing this issue and it's very annoying that we don't have a proper solution for it. Every time the simulator gets launched audio crackling starts.

Current Setup: MacBook Pro Chip: Apple M1 Max RAM: 64 GB macOs: 13.2.1 Xcode 14.2

The XCode simulator generates sounds (anything from Picker wheel clicking to audio/haptic generated by the App) and every time it generates a sound it pauses any Bluetooth device I have connected for a second or two. When it starts again, the audio is distorted and audio level is changed. This is really annoying. From reading the replies above, I directed the system audio to the Mac Studio speakers and that solved the problem, but now I'm not getting the alerts as I'm on headphones. The solution is for Apple to overlay the two audio channels seamlessly without stopping/starting any audio.

This works like a charm, I was struggling for years with this glitch. And yes it has to be fixed :D

install Blackhole 2ch from: https://github.com/ExistentialAudio/BlackHole

With your Simulator open go to I/O > Audio output > Blackhole 2 ch.

This is not my answer, just reposted it for you to notice.