AU takes 100% of CPU, VST takes around 1%


#1

Hi all:

I have been testing my plugin in Live on OS 10.5, as this is my main VST host, and it can also host Audio Units. I tend to test VST, as it doesn’t require a restart of the host (for some reason, I always have to restart Live/GarageBand/Logic in order to make it accept my changes).

Anyway, I just noticed that my plugin takes around 100% of the CPU when running as an Audio Unit in Live or GarageBand (on my late 2006 MacBook Pro). The same code runs at about 1% as a VST. Not good.

A truly weird thing I noticed: The CPU only goes up to astronomical levels in GarageBand when I am actively viewing the GUI. As the GUI does not come up for Audio Units by default in GarageBand, the plugin first instantiates with a nice low CPU.

Any idea what is going on here? I am working with the almost-tip (I updated about a week ago). Have other people encountered this with their plugins?

Thanks,

Sean Costello


#2

Just a bit more clarification: If I close the GUI window in GarageBand, the CPU goes back down. Huh?

Sean


#3

OK, I think I am tracking down the issue. I have a custom tooltip method, that calls repaint() in the paint() function of my main GUI component. If I comment out the repaint() call, the CPU goes down to the expected level. Apparently Audio Units call this WAY more often than VST plugins, at least in Live.

Does anyone know how often the paint() method is called by the Juce Audio Plugin wrappers?

Thanks,

Sean Costello


#4

It’s called only when a repaint has been requested. I’d guess that your tooltip stuff is constantly asking for repaints that aren’t actually needed.


#5

It’s called only when a repaint has been requested. I’d guess that your tooltip stuff is constantly asking for repaints that aren’t actually needed.[/quote]

Yep, that was the problem. I just put a conditional in there such that the repaint only happens when a new control is moused over, and the CPU went down to a nice low level.

Sean