i2s question Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
qwerasdfzxcv
Member++
Posts: 20
Joined: Thu Oct 19, 2017 1:44 pm

i2s question

Post by qwerasdfzxcv »

hey,guys.I would like to ask how I can get i2s to output sound directly via DAC, instead of i2s to PC, and then from PC to DAC


View Solution
xmosbrendon
Posts: 3
Joined: Thu Aug 24, 2017 12:03 pm

Post by xmosbrendon »

What board are you using? Are you using the USB audio reference design as a basis for this work?
qwerasdfzxcv
Member++
Posts: 20
Joined: Thu Oct 19, 2017 1:44 pm

Post by qwerasdfzxcv »

hi,guy.I'm using the XVF3000 development board.I was using the Getting started file directly to bring app_vf_spk_base_1i0_cir43_i2s_only_48khz. Xe to the development board, but no sound was issued
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

We have been here before in this thread http://www.xcore.com/viewtopic.php?p=30826#p30826

Are you saying you want to modify app_vf_spk_base_1i0_cir43_i2s_only_48khz so that the sound (presumably near-end mic audio) comes from the DAC instead of an I2S line on the header?
qwerasdfzxcv
Member++
Posts: 20
Joined: Thu Oct 19, 2017 1:44 pm

Post by qwerasdfzxcv »

What I want to say is that I want the sound to go directly from the microphone through the i2s to the speaker, not via USB to the PC.I thought it would be possible to burn the app_vf_spk_base_1i0_cir43_i2s_only_48khz to the development board.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

You can use 1i0o0_cir43_i2s_only_48khz to output the captured mic to the 3.5mm socket but you will need to make these changes:

Change the I2S output port to be the one connected to the DAC:

Code: Select all

--- a/app_vf_spk_base/src/core/vfspk_base_i2s.xn
+++ b/app_vf_spk_base/src/core/vfspk_base_i2s.xn
@@ -64,8 +64,8 @@
             <Port Location="XS1_PORT_1M"  Name="PORT_I2S_BCLK"/>
             
             <!-- connected to DAC -->
-            <!-- <Port Location="XS1_PORT_1P"  Name="PORT_I2S_DAC0"/> -->
-            <Port Location="XS1_PORT_1D"  Name="PORT_I2S_DAC0"/>
+            <Port Location="XS1_PORT_1P"  Name="PORT_I2S_DAC0"/>
+            <!-- <Port Location="XS1_PORT_1D"  Name="PORT_I2S_DAC0"/> -->
             <Port Location="XS1_PORT_1C"  Name="PORT_I2S_ADC0"/>
             <Port Location="XS1_PORT_4E"  Name="PORT_I2C"/>
             <Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
Change the clock mode of the xmos chip to master so that it is not expecting an external BCLK and LRCLK:

Code: Select all

+++ b/app_vf_spk_base/Makefile
@@ -247,7 +247,7 @@ XCC_FLAGS_1i0o0_cir43_i2s_only_16khz_i2cctl = $(COMBINED_BUILD_FLAGS) $(I0O0) $(
 
 XCC_FLAGS_1i0o0_cir43_i2s_only_16khz_i2cdfu_i2cctl = $(COMBINED_BUILD_FLAGS) $(I0O0) $(FREQ16K) -DPDM_MIC_INDEX=2 -DBECLEAR_AECREF_I2S=1 -DBECLEAR_SMARTHOME=1 -DNO_USB=1 -DBECLEAR_CONTROL_I2C=1 -DDFU_CONTROL_I2C=1 -DCODEC_MASTER=1
 
-XCC_FLAGS_1i0o0_cir43_i2s_only_48khz = $(COMBINED_BUILD_FLAGS) $(I0O0) $(FREQ48K_I2S) -DPDM_MIC_INDEX=2 -DI2S_DOWNSAMPLE_MONO_IN=0 -DBECLEAR_AECREF_I2S=1 -DBECLEAR_SMARTHOME=1 -DNO_USB=1 -DCODEC_MASTER=1
+XCC_FLAGS_1i0o0_cir43_i2s_only_48khz = $(COMBINED_BUILD_FLAGS) $(I0O0) $(FREQ48K_I2S) -DPDM_MIC_INDEX=2 -DI2S_DOWNSAMPLE_MONO_IN=0 -DBECLEAR_AECREF_I2S=1 -DBECLEAR_SMARTHOME=1 -DNO_USB=1 -DCODEC_MASTER=0
 
 XCC_FLAGS_1i0o0_cir43_i2s_only_48khz_i2cctl = $(COMBINED_BUILD_FLAGS) $(I0O0) $(FREQ48K_I2S) -DPDM_MIC_INDEX=2 -DI2S_DOWNSAMPLE_MONO_IN=0 -DBECLEAR_AECREF_I2S=1 -DBECLEAR_SMARTHOME=1 -DNO_USB=1 -DBECLEAR_CONTROL_I2C=1 -DCODEC_MASTER=1
 
qwerasdfzxcv
Member++
Posts: 20
Joined: Thu Oct 19, 2017 1:44 pm

Post by qwerasdfzxcv »

I changed it according to your instructions:
<Port Location="XS1_PORT_1M" Name="PORT_I2S_BCLK"/>

<!-- connected to DAC -->
<Port Location="XS1_PORT_1P"  Name="PORT_I2S_DAC0"/>
<!-- <Port Location="XS1_PORT_1D"  Name="PORT_I2S_DAC0"/> -->
<Port Location="XS1_PORT_1C" Name="PORT_I2S_ADC0"/>
<Port Location="XS1_PORT_4E" Name="PORT_I2C"/>
But that's the problem with compile-time:
Using build modules: module_vocalfusion module_quadflash lib_i2c(4.0.1) lib_mic_array(3.1.1) lib_logging(2.1.1) module_dfu module_usb_audio module_usb_midi lib_device_control(3.2.0) lib_src(1.1.0) lib_dsp(4.0.0) lib_spi(3.0.3) module_xud module_usb_device module_usb_shared lib_xbeclear(1.1.1) module_beclear_conf lib_xassert(3.0.1) module_queue
Analyzing userevents_default.c
.././src/core/vfspk_base_i2s.xn:78: error: no '=' after attribute name '聽'
xmake[1]: *** [.build_1i0o0_cir43_i2s_only_48khz/_m_vocalfusion/src/userevents_default.c.pca.xml.decouple] Error 1
xmake: *** [analyze] Error 2
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

The above changes worked for me..


What is at line 78 of vfspk_base_i2s.xn?

Sounds like a typo on that line?
qwerasdfzxcv
Member++
Posts: 20
Joined: Thu Oct 19, 2017 1:44 pm

Post by qwerasdfzxcv »

My friend, thank you very much for your reply. I have found the problem and solved it. Thanks again
qwerasdfzxcv
Member++
Posts: 20
Joined: Thu Oct 19, 2017 1:44 pm

Post by qwerasdfzxcv »

This one should be this one:<Port Location="XS1_PORT_1P"Name="PORT_I2S_DAC0">
</Port><!-- <Port Location="XS1_PORT_1D" Name="PORT_I2S_DAC0"/> -->
Post Reply