Merge "Improved coverage for DynamicsProcessing test and api" into pi-dev
diff --git a/tests/tests/media/src/android/media/cts/DynamicsProcessingTest.java b/tests/tests/media/src/android/media/cts/DynamicsProcessingTest.java
index a7ad33b..60f2d21 100644
--- a/tests/tests/media/src/android/media/cts/DynamicsProcessingTest.java
+++ b/tests/tests/media/src/android/media/cts/DynamicsProcessingTest.java
@@ -24,8 +24,14 @@
 import android.media.MediaPlayer;
 import android.media.audiofx.AudioEffect;
 import android.media.audiofx.DynamicsProcessing;
+import android.media.audiofx.DynamicsProcessing.BandBase;
+import android.media.audiofx.DynamicsProcessing.BandStage;
 import android.media.audiofx.DynamicsProcessing.Channel;
 import android.media.audiofx.DynamicsProcessing.Eq;
+import android.media.audiofx.DynamicsProcessing.EqBand;
+import android.media.audiofx.DynamicsProcessing.Limiter;
+import android.media.audiofx.DynamicsProcessing.Mbc;
+import android.media.audiofx.DynamicsProcessing.MbcBand;
 import android.test.AndroidTestCase;
 import android.util.Log;
 
@@ -35,7 +41,6 @@
     private DynamicsProcessing mDP;
 
     private static final int MIN_CHANNEL_COUNT = 1;
-    private static final int TEST_CHANNEL = 0;
     private static final float EPSILON = 0.00001f;
     private static final int DEFAULT_VARIANT =
             DynamicsProcessing.VARIANT_FAVOR_FREQUENCY_RESOLUTION;
@@ -49,6 +54,12 @@
     private static final float DEFAULT_FRAME_DURATION = 9.5f;
     private static final float DEFAULT_INPUT_GAIN = -12.5f;
 
+    private static final int TEST_CHANNEL_COUNT = 2;
+    private static final float TEST_GAIN1 = 12.1f;
+    private static final float TEST_GAIN2 = -2.8f;
+    private static final int TEST_CHANNEL_INDEX = 0;
+    private static final int TEST_BAND_INDEX = 0;
+
     //-----------------------------------------------------------------
     // DynamicsProcessing tests:
     //----------------------------------
@@ -129,7 +140,7 @@
             final int channelCount = mDP.getChannelCount();
             assertTrue("unexpected channel count", channelCount >= MIN_CHANNEL_COUNT);
 
-            Channel channel = mDP.getChannelByChannelIndex(TEST_CHANNEL);
+            Channel channel = mDP.getChannelByChannelIndex(TEST_CHANNEL_INDEX);
 
             final float inputGain = channel.getInputGain();
             assertEquals("inputGain is different", DEFAULT_INPUT_GAIN, inputGain, EPSILON);
@@ -145,7 +156,7 @@
         try {
             createDefaultEffect();
 
-            DynamicsProcessing.Eq eq = mDP.getPreEqByChannelIndex(TEST_CHANNEL);
+            DynamicsProcessing.Eq eq = mDP.getPreEqByChannelIndex(TEST_CHANNEL_INDEX);
 
             final boolean inUse = eq.isInUse();
             assertEquals("inUse is different", DEFAULT_PREEQ_IN_USE, inUse);
@@ -165,7 +176,7 @@
         try {
             createDefaultEffect();
 
-            DynamicsProcessing.Mbc mbc = mDP.getMbcByChannelIndex(TEST_CHANNEL);
+            DynamicsProcessing.Mbc mbc = mDP.getMbcByChannelIndex(TEST_CHANNEL_INDEX);
 
             final boolean inUse = mbc.isInUse();
             assertEquals("inUse is different", DEFAULT_MBC_IN_USE, inUse);
@@ -184,7 +195,7 @@
         try {
             createDefaultEffect();
 
-            DynamicsProcessing.Eq eq = mDP.getPostEqByChannelIndex(TEST_CHANNEL);
+            DynamicsProcessing.Eq eq = mDP.getPostEqByChannelIndex(TEST_CHANNEL_INDEX);
 
             boolean inUse = eq.isInUse();
             assertEquals("inUse is different", DEFAULT_POSTEQ_IN_USE, inUse);
@@ -204,7 +215,7 @@
         try {
             createDefaultEffect();
 
-            DynamicsProcessing.Limiter limiter = mDP.getLimiterByChannelIndex(TEST_CHANNEL);
+            DynamicsProcessing.Limiter limiter = mDP.getLimiterByChannelIndex(TEST_CHANNEL_INDEX);
 
             final boolean inUse = limiter.isInUse();
             assertEquals("inUse is different", DEFAULT_LIMITER_IN_USE, inUse);
@@ -214,10 +225,838 @@
     }
 
     //-----------------------------------------------------------------
-    // 2 - run and change parameters
+    // 2 - config builder tests
     //----------------------------------
 
-    //TODO: runtime change of parameters.
+    public void test2_0ConfigBasic() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+        DynamicsProcessing.Config config = getBuilderWithValues().build();
+
+        assertEquals("getVariant is different", DEFAULT_VARIANT,
+                config.getVariant());
+        assertEquals("isPreEqInUse is different", DEFAULT_PREEQ_IN_USE,
+                config.isPreEqInUse());
+        assertEquals("getPreEqBandCount is different", DEFAULT_PREEQ_BAND_COUNT,
+                config.getPreEqBandCount());
+        assertEquals("isMbcInUse is different", DEFAULT_MBC_IN_USE,
+                config.isMbcInUse());
+        assertEquals("getMbcBandCount is different", DEFAULT_MBC_BAND_COUNT,
+                config.getMbcBandCount());
+        assertEquals("isPostEqInUse is different", DEFAULT_POSTEQ_IN_USE,
+                config.isPostEqInUse());
+        assertEquals("getPostEqBandCount is different", DEFAULT_POSTEQ_BAND_COUNT,
+                config.getPostEqBandCount());
+        assertEquals("isLimiterInUse is different", DEFAULT_LIMITER_IN_USE,
+                config.isLimiterInUse());
+        assertEquals("getPreferredFrameDuration is different", DEFAULT_FRAME_DURATION,
+                config.getPreferredFrameDuration());
+    }
+
+    public void test2_1ConfigChannel() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+        DynamicsProcessing.Config config = getBuilderWithValues(TEST_CHANNEL_COUNT).build();
+
+        //per channel
+        Channel channel = config.getChannelByChannelIndex(TEST_CHANNEL_INDEX);
+        //change some parameters
+        channel.setInputGain(TEST_GAIN1);
+
+        //get stages from channel
+        Eq preEq = channel.getPreEq();
+        EqBand preEqBand = preEq.getBand(TEST_BAND_INDEX);
+        preEqBand.setGain(TEST_GAIN1);
+        channel.setPreEqBand(TEST_BAND_INDEX, preEqBand);
+
+        Mbc mbc = channel.getMbc();
+        MbcBand mbcBand = mbc.getBand(TEST_BAND_INDEX);
+        mbcBand.setPreGain(TEST_GAIN1);
+        channel.setMbcBand(TEST_BAND_INDEX, mbcBand);
+
+        Eq postEq = channel.getPostEq();
+        EqBand postEqBand = postEq.getBand(TEST_BAND_INDEX);
+        postEqBand.setGain(TEST_GAIN1);
+        channel.setPostEqBand(TEST_BAND_INDEX, postEqBand);
+
+        Limiter limiter = channel.getLimiter();
+        limiter.setPostGain(TEST_GAIN1);
+        channel.setLimiter(limiter);
+
+        config.setAllChannelsTo(channel);
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            Channel channelTest = new Channel(config.getChannelByChannelIndex(i));
+            assertEquals("inputGain is different in channel " + i, TEST_GAIN1,
+                    channelTest.getInputGain(), EPSILON);
+
+            EqBand preEqBandTest = new EqBand(channelTest.getPreEqBand(TEST_BAND_INDEX));
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, preEqBandTest.getGain(), EPSILON);
+
+            MbcBand mbcBandTest = new MbcBand(channelTest.getMbcBand(TEST_BAND_INDEX));
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, mbcBandTest.getPreGain(), EPSILON);
+
+            EqBand postEqBandTest = new EqBand(channelTest.getPostEqBand(TEST_BAND_INDEX));
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, postEqBandTest.getGain(), EPSILON);
+
+            Limiter limiterTest = new Limiter(channelTest.getLimiter());
+            assertEquals("limiter gain is different in channel " + i,
+                    TEST_GAIN1, limiterTest.getPostGain(), EPSILON);
+
+            ///changes per channelIndex
+            channelTest.setInputGain(TEST_GAIN2);
+            preEqBandTest.setGain(TEST_GAIN2);
+            channelTest.setPreEqBand(TEST_BAND_INDEX, preEqBandTest);
+            mbcBandTest.setPreGain(TEST_GAIN2);
+            channelTest.setMbcBand(TEST_BAND_INDEX, mbcBandTest);
+            postEqBandTest.setGain(TEST_GAIN2);
+            channelTest.setPostEqBand(TEST_BAND_INDEX, postEqBandTest);
+            limiterTest.setPostGain(TEST_GAIN2);
+            channelTest.setLimiter(limiterTest);
+            config.setChannelTo(i, channelTest);
+
+            assertEquals("inputGain is different in channel " + i, TEST_GAIN2,
+                    config.getInputGainByChannelIndex(i), EPSILON);
+
+            //get by module
+            Eq preEqTest = config.getPreEqByChannelIndex(i);
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, preEqTest.getBand(TEST_BAND_INDEX).getGain(), EPSILON);
+
+            Mbc mbcTest = config.getMbcByChannelIndex(i);
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, mbcTest.getBand(TEST_BAND_INDEX).getPreGain(), EPSILON);
+
+            Eq postEqTest = config.getPostEqByChannelIndex(i);
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, postEqTest.getBand(TEST_BAND_INDEX).getGain(), EPSILON);
+
+            limiterTest = config.getLimiterByChannelIndex(i);
+            assertEquals("limiter gain is different in channel " + i,
+                    TEST_GAIN2, limiterTest.getPostGain(), EPSILON);
+        }
+    }
+
+    public void test2_2ConfigChannel_perStage() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        DynamicsProcessing.Config config = getBuilderWithValues(TEST_CHANNEL_COUNT).build();
+
+        //Per Stage
+        config.setInputGainAllChannelsTo(TEST_GAIN1);
+
+        Eq preEq = config.getPreEqByChannelIndex(TEST_CHANNEL_INDEX);
+        EqBand preEqBand = preEq.getBand(TEST_BAND_INDEX);
+        preEqBand.setGain(TEST_GAIN1);
+        preEq.setBand(TEST_BAND_INDEX, preEqBand);
+        config.setPreEqAllChannelsTo(preEq);
+
+        Mbc mbc = config.getMbcByChannelIndex(TEST_CHANNEL_INDEX);
+        MbcBand mbcBand = mbc.getBand(TEST_BAND_INDEX);
+        mbcBand.setPreGain(TEST_GAIN1);
+        mbc.setBand(TEST_BAND_INDEX, mbcBand);
+        config.setMbcAllChannelsTo(mbc);
+
+        Eq postEq = config.getPostEqByChannelIndex(TEST_CHANNEL_INDEX);
+        EqBand postEqBand = postEq.getBand(TEST_BAND_INDEX);
+        postEqBand.setGain(TEST_GAIN1);
+        postEq.setBand(TEST_BAND_INDEX, postEqBand);
+        config.setPostEqAllChannelsTo(postEq);
+
+        Limiter limiter = config.getLimiterByChannelIndex(TEST_CHANNEL_INDEX);
+        limiter.setPostGain(TEST_GAIN1);
+        config.setLimiterAllChannelsTo(limiter);
+
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            Channel channelTest = config.getChannelByChannelIndex(i);
+            assertEquals("inputGain is different in channel " + i, TEST_GAIN1,
+                    channelTest.getInputGain(), EPSILON);
+
+            Eq preEqTest = new Eq(config.getPreEqByChannelIndex(i));
+            EqBand preEqBandTest = preEqTest.getBand(TEST_BAND_INDEX);
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, preEqBandTest.getGain(), EPSILON);
+
+            Mbc mbcTest = new Mbc(config.getMbcByChannelIndex(i));
+            MbcBand mbcBandTest = mbcTest.getBand(TEST_BAND_INDEX);
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, mbcBandTest.getPreGain(), EPSILON);
+
+            Eq postEqTest = new Eq(config.getPostEqByChannelIndex(i));
+            EqBand postEqBandTest = postEqTest.getBand(TEST_BAND_INDEX);
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, postEqBandTest.getGain(), EPSILON);
+
+            Limiter limiterTest = new Limiter(config.getLimiterByChannelIndex(i));
+            assertEquals("limiter gain is different in channel " + i,
+                    TEST_GAIN1, limiterTest.getPostGain(), EPSILON);
+
+            //change by Stage
+            preEqBandTest.setGain(TEST_GAIN2);
+            preEqTest.setBand(TEST_BAND_INDEX, preEqBandTest);
+            config.setPreEqByChannelIndex(i, preEqTest);
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, config.getPreEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            mbcBandTest.setPreGain(TEST_GAIN2);
+            mbcTest.setBand(TEST_BAND_INDEX, mbcBandTest);
+            config.setMbcByChannelIndex(i, mbcTest);
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, config.getMbcBandByChannelIndex(i, TEST_BAND_INDEX).getPreGain(),
+                    EPSILON);
+
+            postEqBandTest.setGain(TEST_GAIN2);
+            postEqTest.setBand(TEST_BAND_INDEX, postEqBandTest);
+            config.setPostEqByChannelIndex(i, postEqTest);
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, config.getPostEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            limiterTest.setPostGain(TEST_GAIN2);
+            config.setLimiterByChannelIndex(i, limiterTest);
+            assertEquals("limiter gain is different in channel " + i,
+                    TEST_GAIN2, config.getLimiterByChannelIndex(i).getPostGain(), EPSILON);
+        }
+    }
+
+    public void test2_3ConfigChannel_perBand() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+        DynamicsProcessing.Config config = getBuilderWithValues(TEST_CHANNEL_COUNT).build();
+
+        //Per Band
+        EqBand preEqBand = config.getPreEqBandByChannelIndex(TEST_CHANNEL_INDEX, TEST_BAND_INDEX);
+        preEqBand.setGain(TEST_GAIN1);
+        config.setPreEqBandAllChannelsTo(TEST_BAND_INDEX, preEqBand);
+
+        MbcBand mbcBand = config.getMbcBandByChannelIndex(TEST_CHANNEL_INDEX, TEST_BAND_INDEX);
+        mbcBand.setPreGain(TEST_GAIN1);
+        config.setMbcBandAllChannelsTo(TEST_BAND_INDEX, mbcBand);
+
+        EqBand postEqBand = config.getPostEqBandByChannelIndex(TEST_CHANNEL_INDEX, TEST_BAND_INDEX);
+        postEqBand.setGain(TEST_GAIN1);
+        config.setPostEqBandAllChannelsTo(TEST_BAND_INDEX, postEqBand);
+
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+
+            EqBand preEqBandTest = new EqBand(config.getPreEqBandByChannelIndex(i,
+                    TEST_BAND_INDEX));
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, preEqBandTest.getGain(), EPSILON);
+
+            MbcBand mbcBandTest = new MbcBand(config.getMbcBandByChannelIndex(i, TEST_BAND_INDEX));
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, mbcBandTest.getPreGain(), EPSILON);
+
+            EqBand postEqBandTest = new EqBand(config.getPostEqBandByChannelIndex(i,
+                    TEST_BAND_INDEX));
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, postEqBandTest.getGain(), EPSILON);
+
+            //change per Band
+            preEqBandTest.setGain(TEST_GAIN2);
+            config.setPreEqBandByChannelIndex(i, TEST_BAND_INDEX, preEqBandTest);
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, config.getPreEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            mbcBandTest.setPreGain(TEST_GAIN2);
+            config.setMbcBandByChannelIndex(i, TEST_BAND_INDEX, mbcBandTest);
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, config.getMbcBandByChannelIndex(i, TEST_BAND_INDEX).getPreGain(),
+                    EPSILON);
+
+            postEqBandTest.setGain(TEST_GAIN2);
+            config.setPostEqBandByChannelIndex(i, TEST_BAND_INDEX, postEqBandTest);
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN2, config.getPostEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+        }
+    }
+
+    public void test2_4Channel_perStage() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+        DynamicsProcessing.Config config = getBuilderWithValues(MIN_CHANNEL_COUNT).build();
+
+        Channel channel = new Channel(config.getChannelByChannelIndex(TEST_CHANNEL_INDEX));
+
+        channel.setInputGain(TEST_GAIN1);
+        assertEquals("channel gain is different", TEST_GAIN1, channel.getInputGain(), EPSILON);
+
+        //set by stage
+        Eq preEq = new Eq(channel.getPreEq());
+        EqBand preEqBand = new EqBand(preEq.getBand(TEST_BAND_INDEX));
+        preEqBand.setGain(TEST_GAIN1);
+        preEq.setBand(TEST_BAND_INDEX, preEqBand);
+        channel.setPreEq(preEq);
+        assertEquals("preEQBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN1, channel.getPreEq().getBand(TEST_BAND_INDEX).getGain(), EPSILON);
+        preEqBand.setGain(TEST_GAIN2);
+        preEq.setBand(TEST_BAND_INDEX, preEqBand);
+        channel.setPreEq(preEq);
+        assertEquals("preEQBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN2, channel.getPreEq().getBand(TEST_BAND_INDEX).getGain(), EPSILON);
+
+        Mbc mbc = new Mbc(channel.getMbc());
+        MbcBand mbcBand = new MbcBand(mbc.getBand(TEST_BAND_INDEX));
+        mbcBand.setPreGain(TEST_GAIN1);
+        mbc.setBand(TEST_BAND_INDEX, mbcBand);
+        channel.setMbc(mbc);
+        assertEquals("mbcBand preGain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN1, channel.getMbc().getBand(TEST_BAND_INDEX).getPreGain(), EPSILON);
+        mbcBand.setPreGain(TEST_GAIN2);
+        mbc.setBand(TEST_BAND_INDEX, mbcBand);
+        channel.setMbc(mbc);
+        assertEquals("mbcBand preGain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN2, channel.getMbc().getBand(TEST_BAND_INDEX).getPreGain(), EPSILON);
+
+        Eq postEq = new Eq(channel.getPostEq());
+        EqBand postEqBand = new EqBand(postEq.getBand(TEST_BAND_INDEX));
+        postEqBand.setGain(TEST_GAIN1);
+        postEq.setBand(TEST_BAND_INDEX, postEqBand);
+        channel.setPostEq(postEq);
+        assertEquals("postEqBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN1, channel.getPostEq().getBand(TEST_BAND_INDEX).getGain(), EPSILON);
+        postEqBand.setGain(TEST_GAIN2);
+        postEq.setBand(TEST_BAND_INDEX, postEqBand);
+        channel.setPostEq(postEq);
+        assertEquals("postEQBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN2, channel.getPostEq().getBand(TEST_BAND_INDEX).getGain(), EPSILON);
+
+        Limiter limiter = new Limiter(channel.getLimiter());
+        limiter.setPostGain(TEST_GAIN1);
+        channel.setLimiter(limiter);
+        assertEquals("limiter gain is different",
+                TEST_GAIN1, channel.getLimiter().getPostGain(), EPSILON);
+        limiter.setPostGain(TEST_GAIN2);
+        channel.setLimiter(limiter);
+        assertEquals("limiter gain is different",
+                TEST_GAIN2, channel.getLimiter().getPostGain(), EPSILON);
+
+    }
+
+    public void test2_5Channel_perBand() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+        DynamicsProcessing.Config config = getBuilderWithValues(MIN_CHANNEL_COUNT).build();
+
+        Channel channel = new Channel(config.getChannelByChannelIndex(TEST_CHANNEL_INDEX));
+
+        channel.setInputGain(TEST_GAIN1);
+        assertEquals("channel gain is different", TEST_GAIN1, channel.getInputGain(), EPSILON);
+
+        //set by band
+        EqBand preEqBand = new EqBand(channel.getPreEqBand(TEST_BAND_INDEX));
+        preEqBand.setGain(TEST_GAIN1);
+        channel.setPreEqBand(TEST_BAND_INDEX, preEqBand);
+        assertEquals("preEQBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN1, channel.getPreEqBand(TEST_BAND_INDEX).getGain(), EPSILON);
+        preEqBand.setGain(TEST_GAIN2);
+        channel.setPreEqBand(TEST_BAND_INDEX, preEqBand);
+        assertEquals("preEQBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN2, channel.getPreEqBand(TEST_BAND_INDEX).getGain(), EPSILON);
+
+        MbcBand mbcBand = new MbcBand(channel.getMbcBand(TEST_BAND_INDEX));
+        mbcBand.setPreGain(TEST_GAIN1);
+        channel.setMbcBand(TEST_BAND_INDEX, mbcBand);
+        assertEquals("mbcBand preGain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN1, channel.getMbcBand(TEST_BAND_INDEX).getPreGain(), EPSILON);
+        mbcBand.setPreGain(TEST_GAIN2);
+        channel.setMbcBand(TEST_BAND_INDEX, mbcBand);
+        assertEquals("mbcBand preGain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN2, channel.getMbcBand(TEST_BAND_INDEX).getPreGain(), EPSILON);
+
+        EqBand postEqBand = new EqBand(channel.getPostEqBand(TEST_BAND_INDEX));
+        postEqBand.setGain(TEST_GAIN1);
+        channel.setPostEqBand(TEST_BAND_INDEX, postEqBand);
+        assertEquals("postEqBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN1, channel.getPostEqBand(TEST_BAND_INDEX).getGain(), EPSILON);
+        postEqBand.setGain(TEST_GAIN2);
+        channel.setPostEqBand(TEST_BAND_INDEX, postEqBand);
+        assertEquals("postEqBand gain is different in band "+ TEST_BAND_INDEX,
+                TEST_GAIN2, channel.getPostEqBand(TEST_BAND_INDEX).getGain(), EPSILON);
+    }
+
+    public void test2_6Eq() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+        final boolean inUse = true;
+        final boolean enabled = true;
+        final int bandCount = 3;
+
+        Eq eq = new Eq(inUse, enabled, bandCount);
+        assertEquals("eq inUse is different", inUse, eq.isInUse());
+        assertEquals("eq enabled is different", enabled, eq.isEnabled());
+        assertEquals("eq bandCount is different", bandCount, eq.getBandCount());
+
+        //changes
+        eq.setEnabled(!enabled);
+        assertEquals("eq enabled is different", !enabled, eq.isEnabled());
+
+        //bands
+        for (int i = 0; i < bandCount; i++) {
+            final float frequency = (i + 1) * 100.3f;
+            final float gain = (i+1) * 10.1f;
+            EqBand eqBand = new EqBand(eq.getBand(i));
+
+            eqBand.setEnabled(enabled);
+            eqBand.setCutoffFrequency(frequency);
+            eqBand.setGain(gain);
+
+            eq.setBand(i, eqBand);
+
+            //compare
+            assertEquals("eq enabled is different in band " + i, enabled,
+                    eq.getBand(i).isEnabled());
+            assertEquals("eq cutoffFrequency is different in band "+ i,
+                    frequency, eq.getBand(i).getCutoffFrequency(), EPSILON);
+            assertEquals("eq eqBand gain is different in band "+ i,
+                    gain, eq.getBand(i).getGain(), EPSILON);
+        }
+    }
+
+    public void test2_7Mbc() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        final boolean inUse = true;
+        final boolean enabled = true;
+        final int bandCount = 3;
+
+        Mbc mbc = new Mbc(inUse, enabled, bandCount);
+        assertEquals("mbc inUse is different", inUse, mbc.isInUse());
+        assertEquals("mbc enabled is different", enabled, mbc.isEnabled());
+        assertEquals("mbc bandCount is different", bandCount, mbc.getBandCount());
+
+        //changes
+        mbc.setEnabled(!enabled);
+        assertEquals("enabled is different", !enabled, mbc.isEnabled());
+
+        //bands
+        for (int i = 0; i < bandCount; i++) {
+            int index = i+1;
+            final float frequency = index * 100.3f;
+            final float attackTime = index * 3.2f;
+            final float releaseTime = 2 * attackTime;
+            final float ratio = index * 1.2f;
+            final float threshold = index * (-12.8f);
+            final float kneeWidth = index * 0.3f;
+            final float noiseGateThreshold = index * (-20.1f);
+            final float expanderRatio = index * 1.1f;
+            final float preGain = index * 10.1f;
+            final float postGain = index * (-0.2f);
+            MbcBand mbcBand = new MbcBand(mbc.getBand(i));
+
+            mbcBand.setEnabled(enabled);
+            mbcBand.setCutoffFrequency(frequency);
+            mbcBand.setAttackTime(attackTime);
+            mbcBand.setReleaseTime(releaseTime);
+            mbcBand.setRatio(ratio);
+            mbcBand.setThreshold(threshold);
+            mbcBand.setKneeWidth(kneeWidth);
+            mbcBand.setNoiseGateThreshold(noiseGateThreshold);
+            mbcBand.setExpanderRatio(expanderRatio);
+            mbcBand.setPreGain(preGain);
+            mbcBand.setPostGain(postGain);
+
+            mbc.setBand(i, mbcBand);
+
+            //compare
+            assertEquals("mbc enabled is different", enabled, mbc.getBand(i).isEnabled());
+            assertEquals("mbc cutoffFrequency is different in band "+ i,
+                    frequency, mbc.getBand(i).getCutoffFrequency(), EPSILON);
+            assertEquals("mbc attackTime is different in band "+ i,
+                    attackTime, mbc.getBand(i).getAttackTime(), EPSILON);
+            assertEquals("mbc releaseTime is different in band "+ i,
+                    releaseTime, mbc.getBand(i).getReleaseTime(), EPSILON);
+            assertEquals("mbc ratio is different in band "+ i,
+                    ratio, mbc.getBand(i).getRatio(), EPSILON);
+            assertEquals("mbc threshold is different in band "+ i,
+                    threshold, mbc.getBand(i).getThreshold(), EPSILON);
+            assertEquals("mbc kneeWidth is different in band "+ i,
+                    kneeWidth, mbc.getBand(i).getKneeWidth(), EPSILON);
+            assertEquals("mbc noiseGateThreshold is different in band "+ i,
+                    noiseGateThreshold, mbc.getBand(i).getNoiseGateThreshold(), EPSILON);
+            assertEquals("mbc expanderRatio is different in band "+ i,
+                    expanderRatio, mbc.getBand(i).getExpanderRatio(), EPSILON);
+            assertEquals("mbc preGain is different in band "+ i,
+                    preGain, mbc.getBand(i).getPreGain(), EPSILON);
+            assertEquals("mbc postGain is different in band "+ i,
+                    postGain, mbc.getBand(i).getPostGain(), EPSILON);
+        }
+    }
+
+    public void test2_8Limiter() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        final boolean inUse = true;
+        final boolean enabled = true;
+        final int linkGroup = 4;
+        final float attackTime = 3.2f;
+        final float releaseTime = 2 * attackTime;
+        final float ratio = 1.2f;
+        final float threshold = (-12.8f);
+        final float postGain = (-0.2f);
+
+        Limiter limiter = new Limiter(inUse, enabled, linkGroup, attackTime, releaseTime, ratio,
+                threshold, postGain);
+        assertEquals("limiter inUse is different", inUse, limiter.isInUse());
+        assertEquals("limiter enabled is different", enabled, limiter.isEnabled());
+        assertEquals("limiter linkGroup is different", linkGroup, limiter.getLinkGroup());
+
+        //defaults
+        assertEquals("limiter attackTime is different",
+                attackTime, limiter.getAttackTime(), EPSILON);
+        assertEquals("limiter releaseTime is different",
+                releaseTime, limiter.getReleaseTime(), EPSILON);
+        assertEquals("limiter ratio is different",
+                ratio, limiter.getRatio(), EPSILON);
+        assertEquals("limiter threshold is different",
+                threshold, limiter.getThreshold(), EPSILON);
+        assertEquals("limiter postGain is different",
+                postGain, limiter.getPostGain(), EPSILON);
+
+        //changes
+        final boolean newEnabled = !enabled;
+        final int newLinkGroup = 7;
+        final float newAttackTime = attackTime + 10;
+        final float newReleaseTime = releaseTime + 10;
+        final float newRatio = ratio + 2f;
+        final float newThreshold = threshold -20f;
+        final float newPostGain = postGain + 3f;
+
+        limiter.setEnabled(newEnabled);
+        limiter.setLinkGroup(newLinkGroup);
+        limiter.setAttackTime(newAttackTime);
+        limiter.setReleaseTime(newReleaseTime);
+        limiter.setRatio(newRatio);
+        limiter.setThreshold(newThreshold);
+        limiter.setPostGain(newPostGain);
+
+        assertEquals("limiter enabled is different", newEnabled, limiter.isEnabled());
+        assertEquals("limiter linkGroup is different", newLinkGroup, limiter.getLinkGroup());
+        assertEquals("limiter attackTime is different",
+                newAttackTime, limiter.getAttackTime(), EPSILON);
+        assertEquals("limiter releaseTime is different",
+                newReleaseTime, limiter.getReleaseTime(), EPSILON);
+        assertEquals("limiter ratio is different",
+                newRatio, limiter.getRatio(), EPSILON);
+        assertEquals("limiter threshold is different",
+                newThreshold, limiter.getThreshold(), EPSILON);
+        assertEquals("limiter postGain is different",
+                newPostGain, limiter.getPostGain(), EPSILON);
+    }
+
+    public void test2_9BandStage() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        final boolean inUse = true;
+        final boolean enabled = true;
+        final int bandCount = 3;
+
+        BandStage bandStage = new BandStage(inUse, enabled, bandCount);
+        assertEquals("bandStage inUse is different", inUse, bandStage.isInUse());
+        assertEquals("bandStage enabled is different", enabled, bandStage.isEnabled());
+        assertEquals("bandStage bandCount is different", bandCount, bandStage.getBandCount());
+
+        //change
+        bandStage.setEnabled(!enabled);
+        assertEquals("bandStage enabled is different", !enabled, bandStage.isEnabled());
+    }
+
+    public void test2_10Stage() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        final boolean inUse = true;
+        final boolean enabled = true;
+        final int bandCount = 3;
+
+        DynamicsProcessing.Stage stage = new DynamicsProcessing.Stage(inUse, enabled);
+        assertEquals("stage inUse is different", inUse, stage.isInUse());
+        assertEquals("stage enabled is different", enabled, stage.isEnabled());
+
+        //change
+        stage.setEnabled(!enabled);
+        assertEquals("stage enabled is different", !enabled, stage.isEnabled());
+    }
+
+    public void test2_11BandBase() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        final boolean enabled = true;
+        final float frequency = 100.3f;
+
+        BandBase bandBase = new BandBase(enabled, frequency);
+
+        assertEquals("bandBase enabled is different", enabled, bandBase.isEnabled());
+        assertEquals("bandBase cutoffFrequency is different",
+                frequency, bandBase.getCutoffFrequency(), EPSILON);
+
+        //change
+        final float newFrequency = frequency + 10f;
+        bandBase.setEnabled(!enabled);
+        bandBase.setCutoffFrequency(newFrequency);
+        assertEquals("bandBase enabled is different", !enabled, bandBase.isEnabled());
+        assertEquals("bandBase cutoffFrequency is different",
+                newFrequency, bandBase.getCutoffFrequency(), EPSILON);
+    }
+    //-----------------------------------------------------------------
+    // 3 - Builder
+    //----------------------------------
+
+    public void test3_0Builder_stagesAllChannels() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        DynamicsProcessing.Config config = getBuilderWithValues(MIN_CHANNEL_COUNT).build();
+        DynamicsProcessing.Config.Builder builder = getBuilderWithValues(TEST_CHANNEL_COUNT);
+
+        //get Stages, apply all channels
+        Eq preEq = new Eq(config.getPreEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand preEqBand = new EqBand(preEq.getBand(TEST_BAND_INDEX));
+        preEqBand.setGain(TEST_GAIN1);
+        preEq.setBand(TEST_BAND_INDEX, preEqBand);
+        builder.setPreEqAllChannelsTo(preEq);
+
+        Mbc mbc = new Mbc(config.getMbcByChannelIndex(TEST_CHANNEL_INDEX));
+        MbcBand mbcBand = new MbcBand(mbc.getBand(TEST_BAND_INDEX));
+        mbcBand.setPreGain(TEST_GAIN1);
+        mbc.setBand(TEST_BAND_INDEX, mbcBand);
+        builder.setMbcAllChannelsTo(mbc);
+
+        Eq postEq = new Eq(config.getPostEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand postEqBand = new EqBand(postEq.getBand(TEST_BAND_INDEX));
+        postEqBand.setGain(TEST_GAIN1);
+        postEq.setBand(TEST_BAND_INDEX, postEqBand);
+        builder.setPostEqAllChannelsTo(postEq);
+
+        Limiter limiter = new Limiter(config.getLimiterByChannelIndex(TEST_CHANNEL_INDEX));
+        limiter.setPostGain(TEST_GAIN1);
+        builder.setLimiterAllChannelsTo(limiter);
+
+        //build and compare
+        DynamicsProcessing.Config newConfig = builder.build();
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, newConfig.getPreEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, newConfig.getMbcBandByChannelIndex(i, TEST_BAND_INDEX).getPreGain(),
+                    EPSILON);
+
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, newConfig.getPostEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("limiter gain is different in channel " + i,
+                    TEST_GAIN1, newConfig.getLimiterByChannelIndex(i).getPostGain(), EPSILON);
+        }
+    }
+
+    public void test3_1Builder_stagesByChannelIndex() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        DynamicsProcessing.Config config = getBuilderWithValues(MIN_CHANNEL_COUNT).build();
+        DynamicsProcessing.Config.Builder builder = getBuilderWithValues(TEST_CHANNEL_COUNT);
+
+        Eq preEq = new Eq(config.getPreEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand preEqBand = new EqBand(preEq.getBand(TEST_BAND_INDEX));
+
+        Mbc mbc = new Mbc(config.getMbcByChannelIndex(TEST_CHANNEL_INDEX));
+        MbcBand mbcBand = new MbcBand(mbc.getBand(TEST_BAND_INDEX));
+
+        Eq postEq = new Eq(config.getPostEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand postEqBand = new EqBand(postEq.getBand(TEST_BAND_INDEX));
+
+        Limiter limiter = new Limiter(config.getLimiterByChannelIndex(TEST_CHANNEL_INDEX));
+
+        //get Stages, apply per channel
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            float gain = i % 2 == 0 ? TEST_GAIN1 : TEST_GAIN2;
+
+            preEqBand.setGain(gain);
+            preEq.setBand(TEST_BAND_INDEX, preEqBand);
+            builder.setPreEqByChannelIndex(i, preEq);
+
+            mbcBand.setPreGain(gain);
+            mbc.setBand(TEST_BAND_INDEX, mbcBand);
+            builder.setMbcByChannelIndex(i, mbc);
+
+            postEqBand.setGain(gain);
+            postEq.setBand(TEST_BAND_INDEX, postEqBand);
+            builder.setPostEqByChannelIndex(i,postEq);
+
+            limiter.setPostGain(gain);
+            builder.setLimiterByChannelIndex(i, limiter);
+        }
+        //build and compare
+        DynamicsProcessing.Config newConfig = builder.build();
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            float expectedGain = i % 2 == 0 ? TEST_GAIN1 : TEST_GAIN2;
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    expectedGain,
+                    newConfig.getPreEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    expectedGain,
+                    newConfig.getMbcBandByChannelIndex(i, TEST_BAND_INDEX).getPreGain(),
+                    EPSILON);
+
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    expectedGain,
+                    newConfig.getPostEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("limiter gain is different in channel " + i,
+                    expectedGain, newConfig.getLimiterByChannelIndex(i).getPostGain(), EPSILON);
+        }
+    }
+
+    public void test3_2Builder_setAllChannelsTo() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        DynamicsProcessing.Config config = getBuilderWithValues(MIN_CHANNEL_COUNT).build();
+        DynamicsProcessing.Config.Builder builder = getBuilderWithValues(TEST_CHANNEL_COUNT);
+
+        Channel channel = new Channel(config.getChannelByChannelIndex(TEST_CHANNEL_INDEX));
+
+        //get Stages, apply all channels
+        Eq preEq = new Eq(config.getPreEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand preEqBand = new EqBand(preEq.getBand(TEST_BAND_INDEX));
+        preEqBand.setGain(TEST_GAIN1);
+        preEq.setBand(TEST_BAND_INDEX, preEqBand);
+        channel.setPreEq(preEq);
+
+        Mbc mbc = new Mbc(config.getMbcByChannelIndex(TEST_CHANNEL_INDEX));
+        MbcBand mbcBand = new MbcBand(mbc.getBand(TEST_BAND_INDEX));
+        mbcBand.setPreGain(TEST_GAIN1);
+        mbc.setBand(TEST_BAND_INDEX, mbcBand);
+        channel.setMbc(mbc);
+
+        Eq postEq = new Eq(config.getPostEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand postEqBand = new EqBand(postEq.getBand(TEST_BAND_INDEX));
+        postEqBand.setGain(TEST_GAIN1);
+        postEq.setBand(TEST_BAND_INDEX, postEqBand);
+        channel.setPostEq(postEq);
+
+        Limiter limiter = new Limiter(config.getLimiterByChannelIndex(TEST_CHANNEL_INDEX));
+        limiter.setPostGain(TEST_GAIN1);
+        channel.setLimiter(limiter);
+
+        builder.setAllChannelsTo(channel);
+        //build and compare
+        DynamicsProcessing.Config newConfig = builder.build();
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, newConfig.getPreEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, newConfig.getMbcBandByChannelIndex(i, TEST_BAND_INDEX).getPreGain(),
+                    EPSILON);
+
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    TEST_GAIN1, newConfig.getPostEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("limiter gain is different in channel " + i,
+                    TEST_GAIN1, newConfig.getLimiterByChannelIndex(i).getPostGain(), EPSILON);
+        }
+    }
+
+    public void test3_3Builder_setChannelTo() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
+
+        DynamicsProcessing.Config config = getBuilderWithValues(MIN_CHANNEL_COUNT).build();
+        DynamicsProcessing.Config.Builder builder = getBuilderWithValues(TEST_CHANNEL_COUNT);
+
+        Channel channel = new Channel(config.getChannelByChannelIndex(TEST_CHANNEL_INDEX));
+
+        Eq preEq = new Eq(config.getPreEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand preEqBand = new EqBand(preEq.getBand(TEST_BAND_INDEX));
+
+        Mbc mbc = new Mbc(config.getMbcByChannelIndex(TEST_CHANNEL_INDEX));
+        MbcBand mbcBand = new MbcBand(mbc.getBand(TEST_BAND_INDEX));
+
+        Eq postEq = new Eq(config.getPostEqByChannelIndex(TEST_CHANNEL_INDEX));
+        EqBand postEqBand = new EqBand(postEq.getBand(TEST_BAND_INDEX));
+
+        Limiter limiter = new Limiter(config.getLimiterByChannelIndex(TEST_CHANNEL_INDEX));
+
+        //get Stages, apply per channel
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            float gain = i % 2 == 0 ? TEST_GAIN1 : TEST_GAIN2;
+
+            preEqBand.setGain(gain);
+            preEq.setBand(TEST_BAND_INDEX, preEqBand);
+            channel.setPreEq(preEq);
+
+            mbcBand.setPreGain(gain);
+            mbc.setBand(TEST_BAND_INDEX, mbcBand);
+            channel.setMbc(mbc);
+
+            postEqBand.setGain(gain);
+            postEq.setBand(TEST_BAND_INDEX, postEqBand);
+            channel.setPostEq(postEq);
+
+            limiter.setPostGain(gain);
+            channel.setLimiter(limiter);
+
+            builder.setChannelTo(i, channel);
+        }
+        //build and compare
+        DynamicsProcessing.Config newConfig = builder.build();
+        for (int i = 0; i < TEST_CHANNEL_COUNT; i++) {
+            float expectedGain = i % 2 == 0 ? TEST_GAIN1 : TEST_GAIN2;
+            assertEquals("preEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    expectedGain,
+                    newConfig.getPreEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("mbcBand preGain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    expectedGain,
+                    newConfig.getMbcBandByChannelIndex(i, TEST_BAND_INDEX).getPreGain(),
+                    EPSILON);
+
+            assertEquals("postEQBand gain is different in channel " + i + " band "+ TEST_BAND_INDEX,
+                    expectedGain,
+                    newConfig.getPostEqBandByChannelIndex(i, TEST_BAND_INDEX).getGain(),
+                    EPSILON);
+
+            assertEquals("limiter gain is different in channel " + i,
+                    expectedGain, newConfig.getLimiterByChannelIndex(i).getPostGain(), EPSILON);
+        }
+    }
     //-----------------------------------------------------------------
     // private methods
     //----------------------------------
@@ -260,11 +1099,11 @@
         createDynamicsProcessingWithConfig(session, config);
     }
 
-    private DynamicsProcessing.Config.Builder getBuilder() {
+    private DynamicsProcessing.Config.Builder getBuilder(int channelCount) {
         //simple config
         DynamicsProcessing.Config.Builder builder = new DynamicsProcessing.Config.Builder(
                 DEFAULT_VARIANT /* variant */,
-                MIN_CHANNEL_COUNT /* channels */,
+                channelCount/* channels */,
                 DEFAULT_PREEQ_IN_USE /*enable preEQ*/,
                 DEFAULT_PREEQ_BAND_COUNT /*preEq bands*/,
                 DEFAULT_MBC_IN_USE /*enable mbc*/,
@@ -276,13 +1115,18 @@
         return builder;
     }
 
-    private DynamicsProcessing.Config.Builder getBuilderWithValues() {
+    private DynamicsProcessing.Config.Builder getBuilderWithValues(int channelCount) {
         //simple config
-        DynamicsProcessing.Config.Builder builder = getBuilder();
+        DynamicsProcessing.Config.Builder builder = getBuilder(channelCount);
 
         //Set Defaults
         builder.setPreferredFrameDuration(DEFAULT_FRAME_DURATION);
         builder.setInputGainAllChannelsTo(DEFAULT_INPUT_GAIN);
         return builder;
     }
+
+    private DynamicsProcessing.Config.Builder getBuilderWithValues() {
+        return getBuilderWithValues(MIN_CHANNEL_COUNT);
+    }
+
 }
\ No newline at end of file