From 202c90f750f084dc56ccc08c5706ba758dbe3496 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Wed, 9 Dec 2015 16:21:22 +0000 Subject: [PATCH 1/7] 'Record release: 6.14.1beta0' --- xpd.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xpd.xml b/xpd.xml index 1922b7ce..25cdebda 100644 --- a/xpd.xml +++ b/xpd.xml @@ -96,7 +96,8 @@ - + + XM-004720-SM XMOS @@ -105,4 +106,4 @@ 1.0 - + \ No newline at end of file From 6a80cc85e287ecbf98eab1fcaa728167e9ce3d83 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Thu, 4 Feb 2016 12:00:36 +0000 Subject: [PATCH 2/7] Initialisation issue with DAC ports for TDM slave mode fixed --- module_usb_audio/audio.xc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index 6754b60a..e33166f7 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -421,7 +421,7 @@ static inline void InitPorts(unsigned divide) #pragma loop unroll for(int i = 0; i < I2S_WIRES_ADC; i++) { - asm("setpt res[%0], %1"::"r"(p_i2s_adc[i]),"r"(tmp+31)); + asm("setpt res[%0], %1"::"r"(p_i2s_adc[i]),"r"(tmp-1)); } #endif #endif From 7353d4d0a404e44e891357a59950af0df65c61e4 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Thu, 4 Feb 2016 12:35:35 +0000 Subject: [PATCH 3/7] DAC data mis-alignment issue in TDM slave mode added to changelog. --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0cf4ec8e..85366856 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ sc_usb_audio Change Log ======================= +6.15.1 +------ + - RESOLVED: DAC data mis-alignment issue in TDM slave mode + 6.15.0 ------ - CHANGE: Removed 32kHz sample-rate support when PDM microphones enabled (lib_mic_array From 75815a0da62895bb7744076b2ae7b9e014cb5b87 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Thu, 4 Feb 2016 12:39:18 +0000 Subject: [PATCH 4/7] Added the ability to offset DAC data from ADC data (useful if ADC and DAC do not agree on TDM formats as on the xCORE-200-MC-AUDIO board. --- CHANGELOG.rst | 3 +++ module_usb_audio/audio.xc | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 85366856..5a46b8fe 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,8 +3,11 @@ sc_usb_audio Change Log 6.15.1 ------ + - ADDED: Ability to offset DAC data from ADC data. Useful if ADC and DAC do not agree + on TDM formats as on the xCORE-200-MC-AUDIO board. See I2S_ADC_TO_DAC_SAMP_OFFSET - RESOLVED: DAC data mis-alignment issue in TDM slave mode + 6.15.0 ------ - CHANGE: Removed 32kHz sample-rate support when PDM microphones enabled (lib_mic_array diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index e33166f7..ac1b3168 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -106,6 +106,12 @@ extern void device_reboot(void); #define MAX_DIVIDE (MAX_DIVIDE_48) #endif +/* Useful for correcting a difference in sample clock polarity between DAC and ADC */ +#ifndef I2S_ADC_TO_DAC_SAMP_OFFSET +#define I2S_ADC_TO_DAC_SAMP_OFFSET 0 +#endif + + #ifndef CODEC_MASTER static inline void doI2SClocks(unsigned divide) { @@ -656,7 +662,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, /* Output "even" channel to DAC (i.e. left) */ for(int i = 0; i < I2S_CHANS_DAC; i+=I2S_CHANS_PER_FRAME) { - p_i2s_dac[index++] <: bitrev(samplesOut[(frameCount)+i]); + p_i2s_dac[index++] <: bitrev(samplesOut[((frameCount+I2S_ADC_TO_DAC_SAMP_OFFSET)&(I2S_CHANS_PER_FRAME-1))+i]); } #endif @@ -761,7 +767,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, #pragma loop unroll for(int i = 1; i < I2S_CHANS_DAC; i+=I2S_CHANS_PER_FRAME) { - p_i2s_dac[index++] <: bitrev(samplesOut[frameCount+i]); + p_i2s_dac[index++] <: bitrev(samplesOut[(frameCount+i+I2S_ADC_TO_DAC_SAMP_OFFSET)&(I2S_CHANS_PER_FRAME-1)]); } #endif From 967ac894201befcef4a99ff701e50e42efd8b992 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 9 Feb 2016 19:12:04 +0000 Subject: [PATCH 5/7] Merge --- module_usb_audio/audio.xc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index ac1b3168..5e4a6c48 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -106,12 +106,6 @@ extern void device_reboot(void); #define MAX_DIVIDE (MAX_DIVIDE_48) #endif -/* Useful for correcting a difference in sample clock polarity between DAC and ADC */ -#ifndef I2S_ADC_TO_DAC_SAMP_OFFSET -#define I2S_ADC_TO_DAC_SAMP_OFFSET 0 -#endif - - #ifndef CODEC_MASTER static inline void doI2SClocks(unsigned divide) { @@ -662,7 +656,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, /* Output "even" channel to DAC (i.e. left) */ for(int i = 0; i < I2S_CHANS_DAC; i+=I2S_CHANS_PER_FRAME) { - p_i2s_dac[index++] <: bitrev(samplesOut[((frameCount+I2S_ADC_TO_DAC_SAMP_OFFSET)&(I2S_CHANS_PER_FRAME-1))+i]); + p_i2s_dac[index++] <: bitrev(samplesOut[frameCount +i]); } #endif @@ -767,7 +761,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, #pragma loop unroll for(int i = 1; i < I2S_CHANS_DAC; i+=I2S_CHANS_PER_FRAME) { - p_i2s_dac[index++] <: bitrev(samplesOut[(frameCount+i+I2S_ADC_TO_DAC_SAMP_OFFSET)&(I2S_CHANS_PER_FRAME-1)]); + p_i2s_dac[index++] <: bitrev(samplesOut[frameCount + i]); } #endif From a07fe64c1d367315760a27d1c4e5f867715f53e5 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Wed, 10 Feb 2016 12:28:16 +0000 Subject: [PATCH 6/7] Removed I2S_ADC_DAC_OFFSET from changelog --- CHANGELOG.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5a46b8fe..684db173 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,8 +3,6 @@ sc_usb_audio Change Log 6.15.1 ------ - - ADDED: Ability to offset DAC data from ADC data. Useful if ADC and DAC do not agree - on TDM formats as on the xCORE-200-MC-AUDIO board. See I2S_ADC_TO_DAC_SAMP_OFFSET - RESOLVED: DAC data mis-alignment issue in TDM slave mode From 431c7f5db9e64aa65973a7d364727ff63c966a65 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 9 Feb 2016 19:06:19 +0000 Subject: [PATCH 7/7] comment typo only --- module_usb_audio/audio.xc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index 5e4a6c48..de905b83 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -407,7 +407,7 @@ static inline void InitPorts(unsigned divide) tmp += (I2S_CHANS_PER_FRAME * 32) - 32 + 1 ; /* E.g. 2 * 32 - 32 + 1 = 33 for stereo */ - /* E..g 8 * 32 - 32 + 1 = 225 for 8 chan TDM */ + /* E.g. 8 * 32 - 32 + 1 = 225 for 8 chan TDM */ #if (I2S_CHANS_DAC != 0) #pragma loop unroll