This is very handy, thanks!
I'm running this example as currently included in the most recent image. I get the following results:
CPU value displayed in IDE: 15%
total: 8%
noise: 0.85%
filter: 0.75%
The value the IDE reports is the total CPU usage including Linux, the IDE, the scope and gui server and the users application? The value total reports is all time spent in the void render()
function? What does .count = 100
do? Is the cpu percentage averaged over 100 measurements?
Assuming high performance mode is enabled, how high can the value reported by Bela_cpuMonitoringGet()
before underruns occur / blocks are dropped? 99%?
My application has quite a dynamic CPU load due to various synthesis models, polyphony, audio effect chains. I'm monitoring context->underrunCount
to notify the user if blocks are dropped. I want to undertake actions like muting old or barely audible synth voices when the max CPU crosses a certain threshold (e.g. 95%). Can I set the count
to 1 and then check the value against a threshold?
Does setting count
to a lower value mean more instructions are executed to measure the CPU? Is there a maximum number of BelaCpuData
instances I can add (e.g. to measure what synthesizer or audio effect chain on which track uses the most CPU)?