Sporadic cpu peaks cause audio crackling

whenwirdsmalwiederreallysummer's icon

I have a patcher that for the most part seems to be running farely smoothly. However, sporadically you can hear some audio-crackling (Couple of times every quarter of an hour or so).

Some investigation leads me to believe this is due to some CPU peaks reaching 100 Percent. It is hard to say whether this comes from Max itself, or some other software (maybe anti-virus software).

Does anybody have any experience on how to tackle these kinds of issues?

Jean-Francois Charles's icon

Hi, if the CPU peak reaches 100% as displayed by Max itself (Options -> Audio status), then you have to change something in Max: try using a larger Signal Vector Size, for instance. Also, there might be space for optimization in your patch.
If the 100% is displayed by your OS (Activity Monitor on a Mac), that's a little different because you can go above 100% as displayed by the Activity monitor without clicks, depending what you're doing. You could try different things, running your patch with no internet connection, etc.
Another thing: trying another sound card (including built-in audio) might help you see if your audio interface driver is involved.

whenwirdsmalwiederreallysummer's icon

Thanks for the quick reply! :)

Thats interesting, I would have thought that the CPU useage displayed by Max itself is the same as the displayed by the OS (Using the Task-Manager in Windows).

I tried playing around with the signal-vector size, deleting parts of the patcher to get a feel for what uses how much workload. I was hoping for some systematic approach, where I can be sure that I will never get crackling with a specific setup. Because currently, cpu useage looks fine (on average around 50%), but sporadically I do seem to get these peaks...

I noticed that the Cpu lvl in the Audio status, jumps around quite a bit (E.g. between 15 and 30 %). Shouldn't it be much more constant? Since in theory, the same thing happens every frame...

Jean-Francois Charles's icon

Indeed, the audio status in Max is very different from the OS one. The one in Max shows you only the CPU taken by Audio processing. Anything you do in Max (processing lists, MIDI, etc.) is not included, nor any Jitter processing, whereas it should be included on the OS meters.
Within Max, the audio usage display usually varies a little. It might be due to the actual CPU usage, or to the way Max measures/reports it. I hope a Windows user will give you more platform-specific insight.