We are having some trouble with irregular GUI updates of an AU plugin when it’s loaded in Logic 9. I hope someone can give me some advice.
In our project, we have a continously moving playhead cursor which is backed by a Timer with 20ms interval that calls a repaint() for the cursor region. While this results in a smooth movement in all other hosts we tested, in Logic 9 the animation is stuttering after you start playback in the host (it’s fine as long as the host is stopped).
We made a small demo plugin (attached as RepaintTestPlugin.zip) which shows that the effect is not dependant on what the plugin is painting or doing in the audio thread. In that test plugin, the plugin-editor is a Timer which triggers repainting of the whole editor in regular intervals. It then paints bar graphs of the time between each timer callback (blue) and each call of the paint method (red). The most recent intervals are always plotted at the right edge.
As you can see in the screenshots, both timer and repaint intervals are regular enough when logic 9 is stopped (even up to 60fps). But as soon as the host playback is started, it seems that the timer callback is not called in regular intervals any more. This effect can be seen at all resolutions / frame rates, so it doesn’t seem to depend on the time actually spend in the paint method.
Has anyone run into similar timer-related problems with Logic-9? The odd thing is that everything works fine in other hosts including Logic-8, or if the plugin is loaded into the 32-bit-plugin-bridge of a 64bit-Logic-9.
Any opinions/ideas for a solution or workaround to get more accurate timer callbacks? or do you think I’m wrong with my conclusion that this is caused by irregular timer callbacks? Increasíng the priority of the InternalTimerThread did not help at all, and I have no idea which other parts of the Timer infrastructure might be worth to try tweaking.