# Juce Plugins capped at 30 fps, with clipping bugs?

**URL:** https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871
**Category:** Audio Plugins
**Created:** [June 11, 2017, 8:13am UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871 "2017-06-11T08:13:07Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![svantana](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/svantana/32/575_2.png) [@svantana](https://forum.juce.com/u/svantana)
#### Post date: [June 11, 2017, 8:13am UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/1 "2017-06-11T08:13:07Z")

</div>

So I’ve noticed issues with fast moving components in plugin Juce GUIs (on macOS 10.12.5). To investigate the issue, I made the following simple component, inspired by the AnimationDemo in JuceDemo:

```
struct FastBall : public Component {
    FastBall() {
        setSize(20,20);
    }
    void paint(Graphics& g) override {
        g.setColour(Colours::red);
        g.fillEllipse(0, 0, getWidth(), getHeight());
    }
    void step() {
        Component *parent = getParentComponent();
        setTopLeftPosition((getX()+10)%parent->getWidth(), (getY()+4)%parent->getHeight());
    }
};

```

Then I call step() in my timerCallback() at 60 Hz. [Here’s a 60 fps video of the result.](https://www.dropbox.com/s/0zfrll7ab224i6p/JucePluginRefreshIssue.mov?dl=0)

This is in Ableton, but it’s the same in the Juce Host and others, for both AU and VST. Stepping through this video frame by frame, you can see that the UI is refreshed approximately every other frame, and worse, sometimes the ball is clipped. This seems to be because the clipBounds calculation and draw calls are out of sync.

Putting the same code in a native app (e.g. JuceDemo), the movement is smooth at 60 fps with no clip errors. Also, other (non-Juce) plugins animate smoothly at 60 fps.

---

<div class="post-metadata">

### Author: ![svantana](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/svantana/32/575_2.png) [@svantana](https://forum.juce.com/u/svantana)
#### Post date: [June 13, 2017, 1:17pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/2 "2017-06-13T13:17:55Z")

</div>

Anyone? If this is pervasive it’s pretty serious IMHO…

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)
#### Post date: [June 13, 2017, 1:23pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/3 "2017-06-13T13:23:35Z")

</div>

This could be related to an issue we had some time ago in certain hosts, on certain versions of OSX, where if the plugin’s drawing wasn’t throttled, it starved the host’s GUI of paint callbacks and caused problems. IIRC we added a throttling mechanism that limited drawing to 30fps to avoid this situation, but never found a magic way of allowing both host + plugin to run at full frame rate without interfering with each other.

---

<div class="post-metadata">

### Author: ![svantana](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/svantana/32/575_2.png) [@svantana](https://forum.juce.com/u/svantana)
#### Post date: [June 13, 2017, 1:53pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/4 "2017-06-13T13:53:37Z")

</div>

okay, interesting! I don’t mind the 30 fps, but the rendering bugs are really annoying. That must be something else, or do you think it can be related?

What seems to happen is: sometimes the getClipBounds() for the draw call only includes the old position of the child that moves, not the new position, and therefore it gets clipped (or not drawn at all if it moves longer than its own size)

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)
#### Post date: [June 13, 2017, 2:57pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/5 "2017-06-13T14:57:00Z")

</div>

Yeah, haven’t heard of any clipping bugs before, that’s odd. We’ll have to look into that.

If you search for “shouldThrottleRepaint” you’ll see the code I was talking about. Might be interesting to see if the clipping works OK if you disable the throttling.

---

<div class="post-metadata">

### Author: ![svantana](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/svantana/32/575_2.png) [@svantana](https://forum.juce.com/u/svantana)
#### Post date: [June 13, 2017, 3:21pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/6 "2017-06-13T15:21:10Z")

</div>

Yup, that did it! Forcing shouldThrottleRepaint() to return false gave smooth 60 fps rendering without clipping. So somehow that Timer is messing with the drawing, would be awesome if you guys could look into it! I’ve also seen this clip nastyness when just dragging components…

---

<div class="post-metadata">

### Author: ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)
#### Post date: [April 9, 2018, 10:07am UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/7 "2018-04-09T10:07:58Z")

</div>

I have a similar issue.  
any chance we could get a way to force `shouldThrottleRepaint()` to return false? like an option in projucer perhaps?

---

<div class="post-metadata">

### Author: ![goodhertz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/goodhertz/32/74_2.png) [@goodhertz](https://forum.juce.com/u/goodhertz)
#### Post date: [July 26, 2019, 8:54pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/8 "2019-07-26T20:54:07Z")

</div>

Is it still not possible to turn off the 30 fps capping for the software renderer? We’d also like the option to be able to disable it in the Projucer.

---

<div class="post-metadata">

### Author: ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)
#### Post date: [July 28, 2019, 10:02am UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/9 "2019-07-28T10:02:29Z")

</div>

Did the clipping bug get looked at and fixed in the end?

---

<div class="post-metadata">

### Author: ![goodhertz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/goodhertz/32/74_2.png) [@goodhertz](https://forum.juce.com/u/goodhertz)
#### Post date: [August 12, 2019, 5:09pm UTC](https://forum.juce.com/t/juce-plugins-capped-at-30-fps-with-clipping-bugs/22871/10 "2019-08-12T17:09:02Z")

</div>

Any new info on the 30 fps cap? @ed95
