USB Audio 2 software on a core-200 sliceKIT? Topic is solved

New to XMOS and XCore? Get started here.
keno
Member++
Posts: 16
Joined: Tue Jul 10, 2018 4:49 pm

USB Audio 2 software on a core-200 sliceKIT?

Postby keno » Thu Jul 12, 2018 4:09 pm

Hi Everyone. I just started on my first xmos project, and Im quite excited, but I may have started off with the wrong demo board.

Will the USB Audio 2.0 reference software run on a core-200 sliceKIT?
I bought a CORE-200 sliceKIT, with the hope of running some demo USB Audio 2.0 code. I now notice that this board is not listed as supported hardware, and none of the projects seem to work with this board. Am I selecting the wrong target in the makefile?
Did I buy the wrong board?
Is there usb audio 2.0 demo software for this board?
Which board should I buy?
Thanks
View Solution
User avatar
infiniteimprobability
XCore Legend
Posts: 1113
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Fri Jul 13, 2018 9:40 am

The slice kit is a generic platform where the I/O is specialised using slice cards.

There is no reason why you couldn't plug in an audio slice - https://www.digikey.co.uk/products/en?k ... A-SK-AUDIO

There will be some minor customisation (xn file, customdefines.h and audiohw.xc) but USB audio should run just fine with this combination. The customisation would be the same process as porting to your own board. It's not too hard and is described in section 5.6 of this document:

https://www.xmos.com/support/boards?ver ... 442&page=4


You could borrow the hardware setup code from app_usb_aud_skc_u16 which uses this card on the old XS1 slicekit..
keno
Member++
Posts: 16
Joined: Tue Jul 10, 2018 4:49 pm

Postby keno » Fri Jul 13, 2018 11:35 am

Thanks, I will check those out.
User avatar
infiniteimprobability
XCore Legend
Posts: 1113
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Fri Jul 13, 2018 12:07 pm

oh, forgot to say, I'd start with app_usb_aud_xk_216_mc.. 2i10o10xxxxxx is the basic audio in/out only build

How many channels do you need and what other interfaces are on the list?

The audio slice card will do 4 in 4 out with MIDI and SPDIF output from memory
keno
Member++
Posts: 16
Joined: Tue Jul 10, 2018 4:49 pm

Postby keno » Mon Jul 23, 2018 7:41 pm

Thanks for your help. Sorry for the delay, I only get to work on this part of the time.
The final product will have 4 audios in, 4 audios out (stereo each so 8 channels? not sure yet how they are defined in Xmos land) analog and s/pdif. We will have 4 uarts, a bunch of GPIO in and out. It will run USB connected to a Linux PC.

I have modified customdefines.h, and think I understand some of .xn getting converted to .h and how that will map my IO which Im trying to get straight. I haven't made any changes to audiohw.xc

Some pins in XA-SK_AUDIO Slice Hardware Guide dont match the XA-SK-AUDIO-SCH.pdf.
EX: pin A4 - hardware guide says is I2S_LR_CLOCK schematic says is MCLK_XCORE
Do you know which is correct? I basically copied app_usb_aud_skc_u16 .xn audio settings into app_usb_aud_xk_216_mc.

I compile app_usb_aud_xk_216_mc - many warnings, no errors, and run.
The Thesycon USB Audio 2 driver shows xCORE USB Audio 2.0 when board is connected to my PC.
After about 30 seconds I get: "xrun: Problem in connection to device" on the console. Any ideas?

Other questions:
1) I previously programmed a (non-working) set of code into the flash. Is it safe to erase by "xflash --erase-all"? Does this erase the boot loader also? Could this be causing my "xrun: Problem in connection to device"?
2) This project will run as a box connected to a linux PC via USB. Will I need to implement the loader function in USB Audio 2.0? or is there a bootloader that can load to ram from USB? If convenient would rather load on power up than program into flash.
3) In a 2 tile device, can 1 tile drive/read IO from the other tile?
4) We will be outputting AES3 not spdif - Can I just change a bit in preableWords_1 and get the control word set from consumer to professional? Or is there more to it?
Thanks,
User avatar
infiniteimprobability
XCore Legend
Posts: 1113
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Mon Jul 30, 2018 11:51 am

Thanks for your help. Sorry for the delay, I only get to work on this part of the time.
The final product will have 4 audios in, 4 audios out (stereo each so 8 channels? not sure yet how they are defined in Xmos land) analog and s/pdif. We will have 4 uarts, a bunch of GPIO in and out. It will run USB connected to a Linux PC.

Yes, that is 8i 8o. Adding UARTs should be fine.

I have modified customdefines.h, and think I understand some of .xn getting converted to .h and how that will map my IO which Im trying to get straight. I haven't made any changes to audiohw.xc

That's right - the xn file gets converted to platform.h at compile time and basically sets up defines.

Eg.

Code: Select all

<Port Location="XS1_PORT_1A"  Name="PORT_I2S_BCLK"/>

becomes

Code: Select all

#define PORT_I2S_BCLK XS1_PORT_1A


Some pins in XA-SK_AUDIO Slice Hardware Guide dont match the XA-SK-AUDIO-SCH.pdf.
EX: pin A4 - hardware guide says is I2S_LR_CLOCK schematic says is MCLK_XCORE
Do you know which is correct? I basically copied app_usb_aud_skc_u16 .xn audio settings into app_usb_aud_xk_216_mc.

The xn file will be correct. Apologies for inconsistent docs..

I compile app_usb_aud_xk_216_mc - many warnings, no errors, and run.
The Thesycon USB Audio 2 driver shows xCORE USB Audio 2.0 when board is connected to my PC.
After about 30 seconds I get: "xrun: Problem in connection to device" on the console. Any ideas?


Does it start running at all? (Check for LR clock). Can you run hello world OK?

Other questions:
1) I previously programmed a (non-working) set of code into the flash. Is it safe to erase by "xflash --erase-all"? Does this erase the boot loader also? Could this be causing my "xrun: Problem in connection to device"?

Bootloader is in ROM so not erasable. Flashing automatically pre-erases. You only need --erase-all when you want to leave it blank
2) This project will run as a box connected to a linux PC via USB. Will I need to implement the loader function in USB Audio 2.0? or is there a bootloader that can load to ram from USB? If convenient would rather load on power up than program into flash.

It's feasible (We do this for the XTAG debug adapter) but a fair bit of work as we do not have a published example. Maybe you could use the existing DFU framework to allow update of the firmware from the host if needed.
3) In a 2 tile device, can 1 tile drive/read IO from the other tile?

No - you will need a remote I/O server. Lib_gpio allows you to do this or you can roll your own using a channel (or interface)
4) We will be outputting AES3 not spdif - Can I just change a bit in preableWords_1 and get the control word set from consumer to professional? Or is there more to it?
Thanks
Double check the specs but I believe this is the case.
keno
Member++
Posts: 16
Joined: Tue Jul 10, 2018 4:49 pm

Postby keno » Mon Jul 30, 2018 4:38 pm

Thanks infiniteimprobability,

I am getting an LR clk at about 3.5uS.
I dont get any i2c traffic - not surprising:

When I tried to port some of app_usb_aud_skc_u26... audiohw.xc over to app_usb_aud_xk_216_mc, I get into trouble. It seems like code app_usb_aud_xk_216_mc wants to setup USB on tile[1] and lots of audio on tile[0] - right? I have my audio card plugged into tile[0] Triangle

So when I go to disable SPI:
on tile[1] : out port p_disableSPI = XS1_PORT_32A;
p_disableSPI <: 1;
xrun: Program received signal ET_ILLEGAL_RESOURCE, Resource exception.
AC_AudioHwInit () at ../src/extensions/audiohw.xc:126
126 p_disableSPI <: 1;
To Use correct I2C address:
on tile [0] : struct r_i2c r_i2c = {XS1_PORT_4A};
//on tile[1] : struct r_i2c r_i2c = {XS1_PORT_4E};
I get same error.
User avatar
infiniteimprobability
XCore Legend
Posts: 1113
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Wed Aug 01, 2018 4:00 pm

Hmm, you will need to decide which tile to put your audio system on and plan the ports accordingly. This will be determined by which slot you wish to use on the slicekit. That means I2C, DAC reset, I2S etc. all must be on the same tile. It can actually be the same as USB if you like. USB can be on either tile. Just make sure that AUDIO_IO_TILE and XUD_TILE (XUD=USB) are correct in customdefines.
If you are getting exceptions it's likely you are writing to a port on a wrong tile.
Audiohwcfg and Audiohwinit are called from I2S, so will assume all ports are on AUDIO_IO_TILE

Who is online

Users browsing this forum: No registered users and 20 guests