# Wrong value for isNonRealtime with Cubase 4

**URL:** <https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416>\
**Category:** Audio Plugins\
**Created:** [December 3, 2008, 4:37pm UTC](https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416 "2008-12-03T16:37:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [December 3, 2008, 4:37pm UTC](https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416/1 "2008-12-03T16:37:25Z")

</div>

Hi Jules,

You should really remove the line

#if JUCE\_WIN32  
if (GetThreadPriority (GetCurrentThread()) \<= THREAD\_PRIORITY\_NORMAL)  
filter-\>setNonRealtime (true);  
#endif

in juce\_VstWrapper.cpp

I don’t know for what broken host it was added, but it is definitively breaking the isNonRealtime flag on Cubase 4 (the real-time audio thread gets called with a priority of -12 here)

edit: it is not cubase 4 specific, so maybe it is vista specific…

---

<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:** [December 3, 2008, 5:39pm UTC](https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416/2 "2008-12-03T17:39:46Z")

</div>

Right… I guess that -12 is a special number assigned to a very high priority thread, so maybe this would be a better test:

```auto
            if (GetThreadPriority (GetCurrentThread()) <= THREAD_PRIORITY_NORMAL
                 && GetThreadPriority (GetCurrentThread()) >= THREAD_PRIORITY_LOWEST)
                filter->setNonRealtime (true);
```

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [December 4, 2008, 9:37am UTC](https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416/3 "2008-12-04T09:37:24Z")

</div>

Yes that seems to work fine here

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [March 11, 2009, 12:49pm UTC](https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416/4 "2009-03-11T12:49:37Z")

</div>

Hi Jules,

Just a small bump to recall you that the fix above is not in the SVN trunk !

---

<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:** [March 11, 2009, 4:09pm UTC](https://forum.juce.com/t/wrong-value-for-isnonrealtime-with-cubase-4/3416/5 "2009-03-11T16:09:54Z")

</div>

Drat! Thanks, I don’t know how I managed to lose that one, will sort it out…
