TL;DR: if you encounter hiccups in the MacOS UI or general sluggishness while playing music, first of all upgrade to Sonoma 14.5 if you can, because this bug seems to be solved REDUCED in that version. The bug will still occur after a while though. To avoid it, close the Music app window, OR open any program that uses 3D acceleration of any kind, OR disable automatic graphics switching in System Settings. it will make the hiccups magically vanish.
My MacBook Pro “upgraded” itself to Mac OS Sonoma during a routine reboot, without my consent. This wouldn't be that bad if this new release of the OS would not be riddled with bugs. One apparent bug was that when the Music app starts playing the next track, and the display is sleeping, there would only be an empty notification temporarily waking the screen, with nothing else in it than the Music icon and the word “Music”. In previous releases this would show full song information as expected. Eventually I figured out that this is a ‘feature’: one needs to give the Music app explicit permission to show information on a “locked” screen, even though the screen is not actually locked in my case. Why it is then still allowed to show a pointless empty notification, beats me. Apple is starting to adopt Microsoft style logic.
Anyhow, on to the true bug that is the main topic of this post, and it is a bad one. It is quite simple:
- Playing local M4A or MP3 files will cause the whole system UI to freeze during about 1 second, approximately every 7 seconds. EXCEPT the Music app itself, which somehow remains immune against theze hiccups. Otherwise you will notice this by things momentarily hanging while scrolling, typing, or doing anything else that requires smooth updating of the screen (even video playback will stutter).
- Playing an internet radio stream will cause same UI freezes, but only when the metadata in the stream causes the status display in the Music app to change. For instance, if the stream contains artist and title information, you can expect everything to choke at the start of every new song. Somehow I have a knack for finding these weird correlations, I don't know why, but it only took about 4 occurrences to figure this out, then I confirmed it by doing some explicit tests.
- These nuisances only occur if the Music app window is open. Close it and the hiccups no longer occur. Of course I mean closing only the window, not quitting the whole app (which would obviously fix any problems caused by the app running).
I don't even know what could cause this. The days when playing an MP3 file required almost all CPU resources of a machine, are way behind us (I still remember one of my friends boasting about this with his 4/86). This seems like some kind of real-time priorities problem, or some UI rendering bug. The 14.3 update mentioned something about a performance problem with UI rendering, but alas, it definitely did not fix this bug because I still encounter it in Sonoma 14.3.1.
I bet it has something to do with all the unwanted security and privacy junk that is being poured into the OS, I wish there was just a big master toggle switch in the control panel “I am not an idiot, don't lock down my computer” to disable all this stuff.
How this kind of bug can have slipped through QA, is beyond me. I guess they don't really test playing local files anymore, assuming everyone will be happy to move to stupid streaming services that produce a steady revenue and that can be manipulated at leisure. However, I find reports in many places of Sonoma being sluggish and unresponsive, and I suspect that the Music app is not the only one causing this. It must be some deeper-level problem of which this is only one manifestation.
Update 2024/03/23: this is definitely some kind of rendering problem.
After some more experimenting, I found out that leaving certain other apps open, will also avoid the problem, even if the Music app window is visible while it is playing music. The magic apps that avoid the problem, are the ones that use OpenGL or some other kind of 3D acceleration. For instance Blender or OpenSCAD will do the trick, and even SheepShaver because it also relies on OpenGL as far as I can remember from when I was remotely involved in its development. Now I can only hope someone at Apple reads this and it gives them a clue about how to fix it…
Update 2024/05/15: it's the Intel Graphics.
With the help of the above, I figured out that the problem only occurs when the Intel Graphics GPU is being used while the Music app is playing music. Yes, it makes no sense from any rational point-of-view that playing music will slow down the GPU, but I have the experimental evidence to prove it. This means there is a simpler workaround than to keep some app running that causes the graphics to switch to the discrete Radeon or NVidia GPU. Go to System Settings and in the Battery section, click the Options button and disable “Automatic graphics switching.” This will cause the discrete GPU to be always used, and the sluggishness will be gone. This will of course affect battery life, so you may want to re-enable that option when battery life matters.
Update 2024/05/23: it's finally fixed… NOT!
After upgrading Audio Hijack to the newest version, it behaved really poorly, with audio regularly cutting out while coreaudiod crash reports appeared. After contacting Rogue Amoeba, they told me that the freshly released Sonoma 14.5 should contain improvements to audio handling. Needless to say, I upgraded right away—things could hardly get any worse. And everything seemed fine at first: not only is Audio Hijack now running smoothly, the main problem explained in this blog post also seemed to be gone! No more hiccups when playing music without doing all kinds of weird workaround dances. Sonoma finally feels usable again.
However, after a few days the problem has returned. This bug will never get fixed, because it's one of those semi-random bugs from hell that only manifest themselves after a certain time in very specific environments. I guess MacOS has become such a massive piece of bloat that it starts producing this type of bugs which are a total ordeal to reliably reproduce, let alone fix. I suspect the actual problem may be some kind of memory leak that eventually causes data to be constantly hauled between the main system and GPU. Luckily the workarounds described above remain effective.