From 9036bac9323fd9f1d1e09b1eb35bac9da81cda8a Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Wed, 9 Sep 2015 11:15:06 +0100 Subject: [PATCH] Fixed up mixer channel comms scheme --- module_usb_audio/mixer/mixer.xc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/module_usb_audio/mixer/mixer.xc b/module_usb_audio/mixer/mixer.xc index 85a6282d..d593655a 100644 --- a/module_usb_audio/mixer/mixer.xc +++ b/module_usb_audio/mixer/mixer.xc @@ -203,6 +203,9 @@ static inline void GiveSamplesToHost(chanend c, xc_ptr ptr, xc_ptr multIn) #pragma unsafe arrays static inline void GetSamplesFromHost(chanend c) { +#if (NUM_USB_CHAN_OUT == 0) + inuint(c); +#else { #pragma loop unroll for (int i=0; i 0 outuint(c_mixer2, 0); GiveSamplesToHost(c_host, samples_to_host_map, multIn); @@ -543,7 +548,7 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) inuint(c_mixer2); #ifdef FAST_MIXER mixed = doMix0(samples, mix_mult_slice(0)); -#else +NN#else mixed = doMix(samples, mix_map_slice(0),mix_mult_slice(0)); #endif write_via_xc_ptr_indexed(samples_array, (NUM_USB_CHAN_OUT + NUM_USB_CHAN_IN + 0), mixed); @@ -559,11 +564,11 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) #if MAX_MIX_COUNT > 2 #ifdef FAST_MIXER - mixed = doMix2(samples, mix_mult_slice(2)); + mixed = doMix2(samples, mix_mult_slice(2)); #else - mixed = doMix(samples, mix_map_slice(2),mix_mult_slice(2)); + mixed = doMix(samples, mix_map_slice(2),mix_mult_slice(2)); #endif - write_via_xc_ptr_indexed(samples_array, (NUM_USB_CHAN_OUT + NUM_USB_CHAN_IN + 2), mixed); + write_via_xc_ptr_indexed(samples_array, (NUM_USB_CHAN_OUT + NUM_USB_CHAN_IN + 2), mixed); #if defined (LEVEL_METER_HOST) || defined(LEVEL_METER_LEDS) ComputeMixerLevel(mixed, 2); @@ -603,8 +608,8 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) #endif GiveSamplesToDevice(c_mixer2, samples_to_device_map, multOut); GetSamplesFromDevice(c_mixer2); - GiveSamplesToHost(c_host, samples_to_host_map, multIn); GetSamplesFromHost(c_host); + GiveSamplesToHost(c_host, samples_to_host_map, multIn); #endif } }