Cabbage Logo
Back to Cabbage Site

Need tips for debugging

Hello all,

I noticed that my synth eats more and more CPU with time (even under linux).
The DSP load shown by CATIA is getting more and more at each note played on the keyboard.
After that, even if I do not play any note, the DSP load remains ( as well as the CPU) very high and never come back to initial state.
So I suspect that there are things not cleared or not stopped within Cabbage /csound… somehow like loops never ending.
How can I identify what is causing this trouble ?
All I did to check if there were still running instrument showed that none of them was active. I also clear all audio varlables and zero all kVar at the end of the main instrument.
So how can it be if there is no instrument running that the DSP load is high ?

Maybe someone like @iainmccurdy could guide me ? ( I spent days trying to get this right without success).

If that was the case everyone would have the same issue. Anyhow, first thing to do is to take out all the instruments apart from a very simple one. Does the CPU still increase over time? If so send me on the code so I can check it. If not then it’s more likely an issue with your Csound code.

I did many times remove everything and then bring them back.
Now I only use poscil, oscil because I did not trust tabmorphak opcode and the code is only based onIf .. then.. else...
Whenever the code looks long, it should be very fast and efficient as when a condition is not met, then the block should be skipped.
Also, I discovered today that it takes ages to load a waveshape within a sound filer using the filebutton. I dunno where it comes from ( as this is a piece we wrote together).
The code is attached.

thank you for your precious help.

Morpheur_beta_9.csd (68.5 KB)
Morpheur_beta_8.snaps (86.8 KB)

Did you not find that with almost everything gone it was working fine? When did the problems reappear?

Well, well… I think I found what causes all theses problems : the size of the buffer ! When I increase it to 2024… the DSP load remains acceptable ( under 50%) and comes back after playing.
On the contrary, with a buffer set at 1024, the DSP load increases and increases even when not playing.

I wish I could understand what is behind this behaviour.

Is this the host buffer size? 2048 seems very big? What happens if you set it to 64 or 128?

it is Jack buffer size that I did set to 2048. Below, it kills my synth.