diff --git a/module_usb_audio/mixer/mixer.xc b/module_usb_audio/mixer/mixer.xc index cf0f8417..b8910309 100644 --- a/module_usb_audio/mixer/mixer.xc +++ b/module_usb_audio/mixer/mixer.xc @@ -1,7 +1,6 @@ #include -#include #include "mixer.h" #include "devicedefines.h" #include "xc_ptr.h" @@ -184,8 +183,10 @@ void giveSamplesToHost(chanend c, xc_ptr samples, xc_ptr ptr, xc_ptr multIn) } #pragma unsafe arrays -static void getSamplesFromHost(chanend c, xc_ptr samples, int base) +static void getSamplesFromHost(chanend c, xc_ptr samples, int base, unsigned underflow) { + if(!underflow) + { #pragma loop unroll for (int i=0;i 0 outuint(c_mixer2, 0); giveSamplesToHost(c_host, samples, samples_to_host_map, multIn); @@ -506,10 +511,10 @@ void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) } #else /* IF MAX_MIX_COUNT > 0 */ /* No mixes, this thread runs on its own doing just volume */ - giveSamplesToDevice(c_mixer2, samples, samples_to_device_map, multOut); + giveSamplesToDevice(c_mixer2, samples, samples_to_device_map, multOut, underflow); getSamplesFromDevice(c_mixer2, samples, NUM_USB_CHAN_OUT); giveSamplesToHost(c_host, samples, samples_to_host_map, multIn); - getSamplesFromHost(c_host, samples, 0); + getSamplesFromHost(c_host, samples, 0, underflow); #endif } } @@ -517,6 +522,7 @@ void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) int mixer2_mix2_flag = (DEFAULT_FREQ > 96000); +#if (MAX_MIX_COUNT > 0) #pragma unsafe arrays void mixer2(chanend c_mixer1, chanend c_audio) { @@ -622,6 +628,7 @@ void mixer2(chanend c_mixer1, chanend c_audio) } } } +#endif void mixer(chanend c_mix_in, chanend c_mix_out, chanend c_mix_ctl) {