USB audio streaming I2S to pc

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Post Reply
beandigital
Member
Posts: 10
Joined: Mon Nov 23, 2015 5:10 pm

USB audio streaming I2S to pc

Post by beandigital »

I am trying to use the USB audio code to create a design that streams I2S audio over USB to a pc. If I set the I2S_CHANS_DAC to 0 I get errors. If I set to say 2 then its fine. Is it not possible to just have I2S input to the device rather than output too?
Thanks


User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

Hi, that's exactly what the reference design does so should be OK to meet your needs.

No probe with setting I2S_CHANS_DAC to zero, but you will also need to set NUM_USB_CHAN_OUT to zero to ensure the host is presented with no output channels. They are different because the audio output could also be output on other interfaces such as SPDIF.

What error do you get?
beandigital
Member
Posts: 10
Joined: Mon Nov 23, 2015 5:10 pm

Post by beandigital »

If I do what you say I get this error

use of undeclared identifer `p_i2s_dac'
audioports.xc /module_usb_audio/ports line 116 C/C++ Problem
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Have you defined CODEC_MASTER?

Looks like those loops should be guarded by #if (I2S_CHANS_DAC != 0)
beandigital
Member
Posts: 10
Joined: Mon Nov 23, 2015 5:10 pm

Post by beandigital »

I did define CODEC_MASTER in my custom_defines.h file but I am not sure that it was being used. If I look at this code

#else /* CODEC_MASTER */

/* Stop bit and master clock blocks */
stop_clock(clk_audio_bclk);

/* Clock bclk clock-block from bclk pin */
configure_clock_src(clk_audio_bclk, p_bclk);

/* Clock I2S output data ports from b-clock clock block */
for(int i = 0; i < I2S_WIRES_DAC; i++)
{
configure_out_port_no_ready(p_i2s_dac, clk_audio_bclk, 0);
}

It was grayed out. So I set the value to 1 in the devicedefines.h file and now it isn't.
But I still get the error. If I look at the I2S_WIRES_DAC value it says its 0/2.

If I look through the code were p_i2s_dac is defined then it seems to only exist if I2S_CHANS_DAC != 0. But it is set to 0 as I set it to that because I want no I2S outputs.

Not really sure what I am doing wrong. I am just trying to get the audio working on an explorer 200 board.
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Which tools version are you using?
beandigital
Member
Posts: 10
Joined: Mon Nov 23, 2015 5:10 pm

Post by beandigital »

I just downloaded the latest from your website. 14.1.1. firs time I have used XMOS.
AudioBoy
Member++
Posts: 19
Joined: Fri Jun 13, 2014 1:35 pm

Post by AudioBoy »

Hello,
I have a question about the subject:
I used my old reference board with L1 chip, without it's codec - I connect my own DAC which is able to operate up to 384kHz.
L1 was burned with firmware, made with 6.6.0 Ref Design at 13.1.0 Tool.
Then I simply connect I2S Data output to data input, to make a loop and run the software:
1) freeware WaveGen Ver 1.50E to send sine wave,
2) freeware WaveSpectra 1.51 to get the signal and to view it's shape and spectrum.

Everything is OK, but just up to 192.
But at 384 - there is no receiving.
I see the valid signal at I2S bus, I see the valid analog signal at the DAC's output, so - no problem with 384kHz output, just with input.

Did somebody tried to make 384kHz input?

P.S. I wants to change I2S from master to slave for the some reasons, but stoped now because if even the loop not works, there is no sense to continue.
Post Reply