Custom i2s in with simultaneous S/PDIF & USB out
-
- Experienced Member
- Posts: 73
- Joined: Tue Nov 24, 2015 4:06 pm
I did that in audio.xc
-
Verified
- XCore Legend
- Posts: 1163
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
Try samplesIn_0
-
- Experienced Member
- Posts: 73
- Joined: Tue Nov 24, 2015 4:06 pm
thanks mate
i now get
incompatible type for argument 2 of `__builtin_out_uint' audio.xc /module_usb_audio line 703 C/C++ Problem
incompatible type for argument 2 of `__builtin_out_uint' audio.xc /module_usb_audio line 702 C/C++ Problem
those two lines of code are as follows
outuint(c_spd_out, samplesIn_0); /* Forward left sample to S/PDIF Tx thread */
outuint(c_spd_out, samplesIn_1); /* Forward right sample to S/PDIF Tx thread */
i now get
incompatible type for argument 2 of `__builtin_out_uint' audio.xc /module_usb_audio line 703 C/C++ Problem
incompatible type for argument 2 of `__builtin_out_uint' audio.xc /module_usb_audio line 702 C/C++ Problem
those two lines of code are as follows
outuint(c_spd_out, samplesIn_0); /* Forward left sample to S/PDIF Tx thread */
outuint(c_spd_out, samplesIn_1); /* Forward right sample to S/PDIF Tx thread */
-
- Experienced Member
- Posts: 73
- Joined: Tue Nov 24, 2015 4:06 pm
Any more suggestions guys? Would be much appreciated if I can get this SPDIF out copy working.
Many thanks
Tom
Many thanks
Tom
-
Verified
- XCore Legend
- Posts: 1156
- Joined: Thu May 27, 2010 10:08 am
Hi - take a look at the declaration of the buffers which are used to store the samples as they go from the device up to the host:
They are arrays of unsigned ints..
So you will need to access them with an array index, rather than referencing the start of the array as you have done..
Try that..
Code: Select all
/* Two buffers for ADC data to allow for DAC and ADC ports being offset */
static unsigned samplesIn_0[NUM_USB_CHAN_IN];
static unsigned samplesIn_1[I2S_CHANS_ADC];
So you will need to access them with an array index, rather than referencing the start of the array as you have done..
Code: Select all
samplesIn_0[0]
samplesIn_0[1]
-
- Experienced Member
- Posts: 73
- Joined: Tue Nov 24, 2015 4:06 pm
Some progress made!
Now when I play music I see data coming out the SPDIF socket. However when I connect this to my very un-fussy SPDIF input (JBL LSR4326 monitors) all I get are sporadic loud pops and no actual music.
I can verify XMOS is receiving the I2S audio just fine as it comes through as clean audio on the USB host computer.
The popping SPDIF output stays the same whether or not the USB is connected and whether or not I am playing music from the I2S. The SPDIF signal coming out doesn't look completely idle when nothing is playing but the USB host has no problem with hearing the I2s.
Is there any chance that the SPDIF side of things does not like my external MCLK (11.2MHz) or that the I2s is too dirty of a signal for it (but USB is happy)?
Strangely I am getting a 11.2MHz clock out of my source whether it's playing at 44.1 or 48k and I've set it to 256 x fs. anyhow I get the same results either way around.
Now when I play music I see data coming out the SPDIF socket. However when I connect this to my very un-fussy SPDIF input (JBL LSR4326 monitors) all I get are sporadic loud pops and no actual music.
I can verify XMOS is receiving the I2S audio just fine as it comes through as clean audio on the USB host computer.
The popping SPDIF output stays the same whether or not the USB is connected and whether or not I am playing music from the I2S. The SPDIF signal coming out doesn't look completely idle when nothing is playing but the USB host has no problem with hearing the I2s.
Is there any chance that the SPDIF side of things does not like my external MCLK (11.2MHz) or that the I2s is too dirty of a signal for it (but USB is happy)?
Strangely I am getting a 11.2MHz clock out of my source whether it's playing at 44.1 or 48k and I've set it to 256 x fs. anyhow I get the same results either way around.
-
- Experienced Member
- Posts: 73
- Joined: Tue Nov 24, 2015 4:06 pm
I have a separate but relevant question:
Can this x200 xmos board / system generate it's own MCLK using the 3 wire i2s approach?
So I feed it the data, bit clock and word clock and it generates the MCLK? That might simplify things.
Can this x200 xmos board / system generate it's own MCLK using the 3 wire i2s approach?
So I feed it the data, bit clock and word clock and it generates the MCLK? That might simplify things.
-
Verified
- XCore Legend
- Posts: 1156
- Joined: Thu May 27, 2010 10:08 am
SPDIF output will be fine with a 11.2896MHz MCLK - it will only support 88.2KHz (or 44.1KHz) though..Is there any chance that the SPDIF side of things does not like my external MCLK (11.2MHz) or that the I2s is too dirty of a signal for it (but USB is happy)?
Not sure what you mean about I2S too dirty?
-
- Experienced Member
- Posts: 73
- Joined: Tue Nov 24, 2015 4:06 pm
Well I'm flying I2S and clock over loose jumper wires from another board. But the USB seems happy with it.
Thanks
Thanks
-
Verified
- XCore Legend
- Posts: 1156
- Joined: Thu May 27, 2010 10:08 am
I have had some success with using 20cm jump cables for I2S - sometimes OK but there have been cases where signal integrity causes noise.. Often this noise improves when you grab the cable (dampen down the SI issues)..
Generally jump cables for 24MHz signals not a good idea :(
Generally jump cables for 24MHz signals not a good idea :(