TL;DR: This post just basically says what I have learned so far, and where I am at in debugging the robotic and distorted audio issues that can occur on MacOS with heavy use. No solutions are below, so if you don't use Mac and don't care about this issue -- skip it. ---- What is the issue? With extended heavy and rapid use of Emacs-Plus (27, 28, 29 or 30) or Emacs-Mac on modern MacOS (12+) with any modern Emacspeak (I use master, but this has been happening for awhile) the Mac audio subsystem will become garbled, robotic and distorted. This does not impact only sounds from Emacspeak but all sounds, including Spotify, other apps, everything. When you exit emacs this completely is remedied and stuff normalizes. Yet, this appears to have a trailing impact in some way as once it happens it will very quickly happen if you reopen Emacs. ---- What have you looked at as the cause? At first, myself and other users expected it might have to do with 3rd party audio modifications on MacOS, and while this does make it more pronounced, it is not the cause, I have confirmed on a few complete install on an M1 Mac Mini. The next idea was that it was a specific version of Emacs, specifically Emacs-Mac. Again, this was a contributing factor to the problem, but not the cause. I produced it with a fresh built Emacs-Plus 28.2. So, then I thought it might be the python mac server, so I wrote a new one in Go to see if this was the case, and while building (and using) my new server, the bug came up again. So it isn't the python mac server. I might complete the server, it is just really getting started at https://github.com/robertmeta/fastmac -- I still want a faster more easily concurrent server for Mac that has less requirements to install. So then I thought it might be thrashing the audio API on mac via the sounds playback in the mac server (which applies to tones as well, patch incoming soon) and while this was an improvement and again might have added to the mean time between failures -- it was again not the core issue. By pure luck, as I was doing this stuff over the last few weeks I started using and loving Ivy and Swiper. This was great timing, as I can consistently bug out my sound with Ivy and Swiper witha couple tries. It appears to be related to sounds played during typing / using backsapce in like swiper for example. With enough overlapping / concurrent noises the sound gets blown out. So with a lot more digging, I confirmed that this is completely unrelated to the python mac server! With audio icons disabled this bug is completely gone, does not occur in any way that I can cause. ---- So where are we now? I am in the process of understanding how the audio icons work and how they get attached to events and where the code that actually interfaces with the MacOS audio system lives. I am new to Emacs and Lisp so I am slower than the average bear at finding the right place, but slowly but surely making progress... any tips and pointers greatly appreciated. ---- Anything you specifically didn't try yet? I did not try with the base Emacs package that can be installed with brew. It feels very far from working with my config and setup so I have not dove in too far to testing it, This is indeed worth testing and I will probably attempt it this weekend. -- Robert "robertmeta" Melton
|Full archive May 1995 - present by Year|Mailing list's archive of current year by month|
If you have questions about this archive or had problems using it, please contact us.