XMOS as I2S Slave on U16 Mch

If you have a simple question and just want an answer.
vicacid
Member
Posts: 8
Joined: Thu May 28, 2015 8:36 pm

XMOS as I2S Slave on U16 Mch

Post by vicacid »

Hi there,

I am quiet new to XMOS products and have a question regarding the I2S clock generation on the U16 Multichannel Platform (XP-SKC-U16 with XA-SK-AUDIO8).

I'd like to set the XMOS to I2S slave mode and use the CS5368 as the clock master. To achieve this, I modified the project "app_usb_aud_skx_u16_audio8" in xTIMEcomposer. Specifically, I changed CODEC_MASTER to (1) in "devicedefines.h" (belonging to "module_us_audio") and rebuilt all. 

Running the application on the hardware changes nothing regarding the clock behaviour. The reason seems to be that the change of CODEC_MASTER is not recognized in the main project.

Do I have to change some additional settings, or is it the wrong parameter that I modified?

Thanks in advance.

Vineela
Member++
Posts: 21
Joined: Mon Dec 16, 2013 1:27 pm

Post by Vineela »

Setting CODEC_MASTER as '1' should set the CODEC as I2S master. Recomended way to do this is to set this define in customdefines.h file of app_usb_aud_skc_u16_audio8. 

"Running the application on the hardware changes nothing regarding the clock behaviour. The reason seems to be that the change of CODEC_MASTER is not recognized in the main project."

Expected behaviour is instead of XMOS device CODEC should be driving the BCLK and LRCLK. How are you ensuring this clock behaviour?

vicacid
Member
Posts: 8
Joined: Thu May 28, 2015 8:36 pm

Post by vicacid »

Hi Vineela,

thanks for your reply. I tried setting the XMOS as clock slave by setting the define in "customdefines.h", but the XMOS still remains clokc master. 

I verify this by looking at the I2C data sent to the CS5368 and this data is always 0x97, regardless of the value of CODEC_MASTER. So the Codec is always configured to be slave and since the clock starts running when the program runs, the XMOS still must be the clockmaster.

I suppose there must be some additional changes be done to the code to set the XMOS as clock-slave. Any idea?

 

Thanks,

Stephan

 

krishnabalan
Member++
Posts: 24
Joined: Thu Aug 14, 2014 10:55 am

Post by krishnabalan »

Hi Stephan,

I just looked at the "app_usb_aud_skc_u16_audio8" and found that the CODEC_MASTER is properly taken care in setting up the CS5368 device in audiohw.xc.

There is also a build configuration called "2io_slave" present in the project (Makefile) which complies the code for XMOS to act as slave (i.e CODEC as master).  Can you please try to build this configuration (2io_slave) and test?

Cheers,

Krishna

vicacid
Member
Posts: 8
Joined: Thu May 28, 2015 8:36 pm

Post by vicacid »

Hi Krishna,

when I select the 2io_slave configuration, the CODEC is always set as clock master (config byte is now 0x94), regardless of the value of CODEC_MASTER.

 

As this is what I want, it's certainly better than before, but I would prefer, if the behaviour is related to the configuration in the code :-) Maybe I'm just doing something wrong in the configuration of the project (project settings, debug settings, ...)?

 

What I want to do in the end is to have 8 channels audio input and 8 channels audio output with the XMOS as the clock slave. Which configuration is closest to that behaviour?

 

Thanks a lot,

Stephan

 

krishnabalan
Member++
Posts: 24
Joined: Thu Aug 14, 2014 10:55 am

Post by krishnabalan »

Hi Stephan,

The configuration "2io_tdm8_slave" is what you are looking for.

Meanwhile following is a brief idea of the configuration structure:

In all the projects, there is a Makefile available. The #defines mentioned in the source files can be defined in the Makefile too with the option -D (i.e. -DNUM_USB_CHAN_OUT=8).  Defining an option in the makefile will be visible each and every source file of the project.  So instead of defining the CODEC_MASER in the .h files, you can put it in makefile too.  If you open the project's makefile in a text editor you can find each configuration is defined as XCC_FLAGS_<config_name>.  The required configuration defines can be put in the config's XCC_FLAGS.

If you are defining configuration in the customdefines.h file, then you must include the "devicedefines.h" file wherever you use the configuration define, For example, audiohw.xc uses the CODEC_MASTER define to change the behaviour of the CODEC and this audiohw.xc must have he #include "devicedefines.h".

Hope it helps!

Cheers,

Krishna

vicacid
Member
Posts: 8
Joined: Thu May 28, 2015 8:36 pm

Post by vicacid »

Hi Krishna,

thanks for the explanation of the config structure. With modifications in the makefile it seems to work. 

I would like to use the 8 channels in  / 8 channels out slave mode with audio sampling frequencies up to 192 kHz. If I change the corresponding setting in the makefile to DMAX_FREQ=192000, the highest sample rate that can be played back is still 96 kHz. If I want to play back an audio file with 192 kHz, the clock on the board is set to 44,1 kHz.

Is this a limitation of the hardware or of the Thesycon-driver? Or just another config problem?

 

Thanks,

Stephan