# disableNonMainBuses(); jassert

**URL:** <https://forum.juce.com/t/disablenonmainbuses-jassert/25740>\
**Category:** Audio Plugins\
**Created:** [December 26, 2017, 6:21pm UTC](https://forum.juce.com/t/disablenonmainbuses-jassert/25740 "2017-12-26T18:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@vincent](https://forum.juce.com/u/vincent)\
**Post date:** [December 26, 2017, 6:21pm UTC](https://forum.juce.com/t/disablenonmainbuses-jassert/25740/1 "2017-12-26T18:21:51Z")

</div>

Every Juce plug-in project I’ve tried keeps hitting this `jassert` on run, it’s in `juce_AudioProcessor.cpp`. They were all working fine a few days ago.  
Within this function:  
`void AudioProcessor::setPlayConfigDetails (const int newNumIns, const int newNumOuts, const double newSampleRate, const int newBlockSize)`

The jassert hit is here:  
`// if the user is using this method then they do not want any side-buses or aux outputs`  
`success &= disableNonMainBuses();`  
`jassert (success);`

I’m on Windows 7 64bit using Visual Studio 2017 and Juce v5.1.2.

Seems it could be because the plugin is set to have way too many input/output channels. Weird that it would happen on the three projects I tried and on a brand new plug-in project though.  
Any thoughts?

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [December 29, 2017, 10:40am UTC](https://forum.juce.com/t/disablenonmainbuses-jassert/25740/2 "2017-12-29T10:40:32Z")

</div>

I can’t reproduce this. Can you try the latest tip of develop and see if it still occurs?

---

<div class="post-metadata">

**Author:** ![vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@vincent](https://forum.juce.com/u/vincent)\
**Post date:** [December 29, 2017, 10:59am UTC](https://forum.juce.com/t/disablenonmainbuses-jassert/25740/3 "2017-12-29T10:59:39Z")

</div>

I’ve updated to the latest version (v5.2.0). What do you mean by latest tip of develop? I create a new plugin project (or use an existing one) and that jassert gets hit. In the code, the success bool is set to false by the time it gets to the end.  
`bool success = true;`

```
if (getTotalNumInputChannels() != newNumIns)
    success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns));

if (getTotalNumOutputChannels() != newNumOuts)
    success &= setChannelLayoutOfBus (false, 0, AudioChannelSet::canonicalChannelSet (newNumOuts));

// if the user is using this method then they do not want any side-buses or aux outputs
success &= disableNonMainBuses();
jassert (success);

```

In the first if statement, numChannels is set to 0

`AudioChannelSet`  
`AudioChannelSet::canonicalChannelSet (int numChannels)`  
`{`  
`if (numChannels == 1) return` `AudioChannelSet::mono();`  
`if (numChannels == 2) return` `AudioChannelSet::stereo();`  
`if (numChannels == 3) return` `AudioChannelSet::createLCR();`  
`if (numChannels == 4) returm AudioChannelSet::quadraphonic();`  
`if (numChannels == 5) return AudioChannelSet::create5point0();`  
`if (numChannels == 6) return` `AudioChannelSet::create5point1();`  
`if (numChannels == 7) return` `AudioChannelSet::create7point0();`  
`if (numChannels == 8) return` `AudioChannelSet::create7point1();`

```
    return discreteChannels (numChannels);
}
```

---

<div class="post-metadata">

**Author:** ![vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@vincent](https://forum.juce.com/u/vincent)\
**Post date:** [January 3, 2018, 5:19pm UTC](https://forum.juce.com/t/disablenonmainbuses-jassert/25740/4 "2018-01-03T17:19:20Z")

</div>

This stopped happening and I have no idea why… sorry I can’t help you if you’ve stumbled on this with the same problem
