I was wrong about SAFE MODE fixing it. It slowed how fast it started happening, but I think that was due to safe mode turning off non-essential processes like spotlight indexing and a few other things. Eventually the audio popping starts happening again in SAFE MODE.
BUT, I did find something else. I noticed that whenever the audio popping issue started happening, the memory pressure indicator in activity monitor would turn orange. And the swap used number would increase. By A LOT. Even though memory used number was no where near the my physical memory limit (32 GB). I started looking into how swap is configured on MacOS because the aggressive use of swap when not at the memory limit seemed odd to me.
I determined there was a setting I could configure to disable swap altogether (vm_compressor mode 2). Unfortunately there is no way to tune how soon the swap starts being used, it's either all or nothing. You have to disable SIP (system integrity protection), more info here:
A macOS performance tweaking guide for hardcore Android developers
ayltai.medium.com
and here:
0. Prologue After replacing 128GB SSD with a 500GB one in my 7 year-old MacBook ... Read More Read More
windsketch.cc
I switched the vm_compressor mode to 2 and have been using the machine in my normal workflow for the past 2 days. I have a **** ton of thorium tabs (more on that later, it's a newish chromium binary that works really well so far), VS Code, 8 GB for docker, teams, slack, discord, and a few other things, basically my normal day to day workflow, and no audio popping so far, here's what my memory situation looks like, it's basically stabilized at 27 - 29 GB of mem used because of the memory compressor compressing memory that hasn't been used in a while:
View attachment 2007606
Notice 0 bytes of swap used. That's what you are looking for because I have a theory about what is causing the audio popping: when the memory pressure in vm compressor mode 4 turns orange, it starts aggressively swapping memory to disk. I believe this SSD thrashing and the resulting processing and CPU usage is what causes the audio popping and general performance degradation. I especially believe this is the case after looking at my SSD health. Keep in mind I've had this MBP 16 M1 MAX 32GB since the end of november 2021. Here are my SSD health stats after 6 months of use (May 2022), in order to look at the SSD stats I recommend installing Homebrew and using smartmontools on the command line (more info here:
https://www.macworld.com/article/334283/how-to-m1-intel-mac-ssd-health-terminal-smartmontools.html):
View attachment 2007607
The key values to see here are Percentage Used, Data units Read/Written. As I understand it, Percentage Used is the amount of life your SSD has gone through, as that percentage goes up, the closer your SSD is to failing. So I've used 3% of my SSD lifetime use through 6 MONTHS of using my computer. To me, that seems absurd, but please everyone check your SSD usage and let me know what your numbers look like. Also, on a 1 TB SSD, over 6 months I've read and written almost one hundred terabytes of data on the SSD. Those numbers again, seem absurdly high to me. So I've come to the conclusion that the aggressive swap usage has not only caused performance issues resulting in a audible popping noise when watching videos, but also is deteriorating my SSD at a rate faster than normal. Since I've disabled swapping I've not had any audio popping issues, and I bet if I check my SSD stats again in the future, the rate at which my SSD is being used will have dramatically dropped.
I'll report back here if I have any audio popping or if I have issues with swap disabled. The big caveat to disabling swap is that if you push your memory usage too high you will have system instability and kernel panics. I'll report back here if I run into any issues like that. Given what I know now, I obviously should have bought the 64 gb MBP, but it is also ridiculous that a computer is configured to over aggressively use swap and literally destroy itself early if the user pushes it to the limits. I've had no issues on my windows computers with 32 GB of ram under similar workloads. Windows seems to swap when it's literally out of memory, and performance suffers, and I know to close some things. On MacOS the performance suffers way before the physical memory is used up, so in effect it is like using a computer with less RAM than you actually paid for.
Please everyone on M1 MBPs: try changing the vm_compressor mode to 2 and check your SSD stats, and post them here, so we can see if this issue is more widespread. Hope this helps someone else out there.
About Thorium: I read that google chrome and the keystone updater could cause issues with performance, so I removed chrome but still need a chromium based browser for development, so I found Thorium. The person behind it has a fairly recent apple silicon build with all the things I need (h264 codecs, etc) and nothing I don't (keystone). So far so good, many thanks to the maintainer!
Special builds of Thorium for SSE3 and different processors. - Alex313031/Thorium-Special
github.com