xCORE-200-MC-AUDIO Question

If you have a simple question and just want an answer.
Alfred Goh
Newbie
Posts: 1
Joined: Fri Sep 01, 2017 6:16 pm

xCORE-200-MC-AUDIO Question

Post by Alfred Goh »

Hi,

I am new to this platform. Currently starting to look at xCORE-200-MC-AUDIO and development tools.

I have 2 questions:


1. Here is the issue, I downloaded and imported, sw_usb_audio_[sw]_6.15.2rc1, app_usb_aud_xk_216_mc.
The built configuration was 2i10o10xssxxx, no code was modified. When I connect to my Macbook Air and Pro, the audio plays. However, when I connect to my Window 10 Home system (after running XMOS_TUSBAudio_eval_v4.11.0_2017-05-16_setup) and directed to XMOS XK-AUDIO-216-MC-AB...the device status shows "This device cannot start (Code 10)...{Operation Failed} The requested operation was unsuccesful."...Same issue on Windows 7. What am I doing wrong?


2. 1. What is the firmware configuration that came with the xCORE-200-MC-AUDIO board? Anyway I can re-build with the same factory configuration and flash to the factory version that came with the board?


Thanks!!!


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

Post by infiniteimprobability »

Hi,
1) may be the case if the device has crashed and is no longer available to service requests from the USB host. Have you run it on the debugger to find out what happens to the target in this state? xrun --dump-state can be handy if you do't want to use xgdb. It's only a guess.. Also, try something simpler liker 2i10o10xxxxxx and see if that runs. It should all work OK but I'm wondering if enabling spdif Rx is an issue for the driver..

2) Default image is app_usb_aud_xk_216_mc_2i10o10xsxxxx.xe (so no input SPDIF). I would recommend building and running a freshly built version rather than relying on the default image on a board that may have been in stock a while
alexjaw
Active Member
Posts: 35
Joined: Wed Jan 24, 2018 9:13 am

Post by alexjaw »

I'm trying the build configurations app_usb_aud_xk_216_mc_2i10o10xsxxxx.xe and 2i10o10xssxxx without success. usb works but not spdif/toslink. I have used usb as source when testing spdif/toslink tx. There is no optical signal but there is a digital signal on spdif tx, however, it's there even without any input signals. Pk-Pk 1.2 V without coax connected, 600 mV when connected. Frq = 1.4MHz, LRCLK = 44.1kHz. Is there something that must be adjusted in the code (customdefines, etc...) or on the board (jumper settings?) in order to use spdif/toslink rx/tx?

(AN00231 _asrc demo and AN00162_i2s demo works out of the box)
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

You know that SPDIF is mapped to channels 8/9 by default in customdefines.h?
/* Channel index of SPDIF Rx channels (duplicated DAC channels 1/2 when index is 0) */
#define SPDIF_TX_INDEX (8)

/* Channel index of SPDIF Rx channels */
#define SPDIF_RX_INDEX (8)
Make sure you are listening/sending on these channels or modify your config..
maqu67
Member++
Posts: 22
Joined: Tue Jan 23, 2018 3:26 pm

Post by maqu67 »

Hello,

I'm using xCORE-200 MC AUDIO Board and I'd like to input Analog audio using the LINE-IN socket to have analog Audio output from LINE-OUT sockets.
Can you show me which configuration from the set of configurations I've downloaded from XMOS site for this board, I have to use?

Thanks a lot for your help.

The possible configurations are:

# Test build configs (Note these make use of the defaults in customdefines.h)

# Audio Class 2, Input (8), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM mode
XCC_FLAGS_2i8o8xxxxx_tdm8 = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000
INCLUDE_ONLY_IN_2i8o8xxxxx_tdm8 =

# Audio Class 2, Input (8), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM slave mode
XCC_FLAGS_2i8o8xxxxx_tdm8_slave = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000 -DMIXER=0 -DCODEC_MASTER=1
INCLUDE_ONLY_IN_2i8o8xxxxx_tdm8_slave =


# Audio Class 2, Input (0), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM slave mode
XCC_FLAGS_2i0o8xxxxx_tdm8_slave = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=0 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=0 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000 -DMIXER=0 -DCODEC_MASTER=1
INCLUDE_ONLY_IN_2i0o8xxxxx_tdm8_slave =



# Audio Class 2, Input (16), Output (16), No MIDI, No SPDIF i/o, No ADAT i/o, No DSD, TDM mode
# Note: sample rate restricted to 96K to fit in USB bandwidth
XCC_FLAGS_2i16o16xxxxx_tdm8 = $(BUILD_FLAGS) -DI2S_CHANS_DAC=16 -DI2S_CHANS_ADC=16 -DNUM_USB_CHAN_OUT=16 -DNUM_USB_CHAN_IN=16 \
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
-DI2S_MODE_TDM=1 -DMAX_FREQ=96000
INCLUDE_ONLY_IN_2i16o16xxxxx_tdm8 =

# Audio Class 2, Input, Output, No MIDI, No SPDIF Tx, TDM (32in/32out)
XCC_FLAGS_2i32o32xxxxx_tdm8 = $(BUILD_FLAGS) -DSPDIF_TX=0 -DI2S_MODE_TDM=1 -DI2S_CHANS_ADC=32 -DMAX_FREQ=48000 -DI2S_CHANS_DAC=32 -DNUM_USB_CHAN_OUT=32 -DNUM_USB_CHAN_IN=32
INCLUDE_ONLY_IN_2i32o32xxxxx_tdm8 =

# Audio Class 2, Input, Output, No MIDI, SPDIF, TDM (32in/32out)
XCC_FLAGS_2i32o32xsxxx_tdm8 = $(BUILD_FLAGS) -DSPDIF_TX=1 -DI2S_MODE_TDM=1 -DI2S_CHANS_ADC=32 -DMAX_FREQ=48000 -DI2S_CHANS_DAC=32 -DNUM_USB_CHAN_OUT=32 -DNUM_USB_CHAN_IN=32
INCLUDE_ONLY_IN_2i32o32xsxxx_tdm8 =

# Audio Class 2, Input, Output, MIDI, SPDIF
XCC_FLAGS_2i10o10msxxxx = $(BUILD_FLAGS) -DMIDI=1 -DSPDIF_TX=1
INCLUDE_ONLY_IN_2i10o10msxxxx =

# Audio Class 2, Input, Output, MIDI, SPDIF, DSD
XCC_FLAGS_2i10o10xxxxxd = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=0 -DDSD_CHANS_DAC=2
INCLUDE_ONLY_IN_2i10o10xxxxxd =

# Audio Class 2, Input, Output, no MIDI, no SPDIF
XCC_FLAGS_2i10o10xxxxxx = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=0
INCLUDE_ONLY_IN_2i10o10xxxxxx =

# Audio Class 2, Input, Output, no MIDI, no SPDIF
XCC_FLAGS_2i10o10xxxxxx_slave = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=0 -DCODEC_MASTER=1
INCLUDE_ONLY_IN_2i10o10xxxxxx_slave =

# Audio Class 2, Input, Output, no MIDI, SPDIF
XCC_FLAGS_2i10o10xsxxxx = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=1
INCLUDE_ONLY_IN_2i10o10xsxxxx =

# Audio Class 2, Input, Output, no MIDI, SPDIF
XCC_FLAGS_2i10o10xsxxxx_mix8 = $(BUILD_FLAGS) -DMIDI=0 -DSPDIF_TX=1 -DMAX_MIX_COUNT=8
INCLUDE_ONLY_IN_2i10o10xsxxxx_mix8 =

# Audio Class 2, Input, Output, No Midi, SPDIF, DSD
XCC_FLAGS_2i10o10xsxxxd = $(BUILD_FLAGS) -DSPDIF_TX=1 -DDSD_CHANS_DAC=2
INCLUDE_ONLY_IN_2i10o10xsxxxd =

# Audio Class 2, 10 Input, 16 Output, no MIDI, no SPDIF tx, no SPDIF Rx, ADAT tx, no ADAT rx, no DSD
XCC_FLAGS_2i10o16xxxaxx = $(BUILD_FLAGS) -DSPDIF_TX=0 -DMIDI=0 -DADAT_TX=1 -DMAX_FREQ=96000 -DNUM_USB_CHAN_OUT=16
INCLUDE_ONLY_IN_2i10o16xxxaxx =

# Audio Class 2, 16 Input, 10 Output, no MIDI, no SPDIF tx, no SPDIF Rx, ADAT tx, ADAT rx, no DSD
# Sample rate restriced to 96kHz fit in USB bandwidth
XCC_FLAGS_2i16o16xxxaax = $(BUILD_FLAGS) -DSPDIF_TX=0 -DMIDI=0 -DADAT_RX=1 -DADAT_TX=1 -DMAX_FREQ=96000 -DNUM_USB_CHAN_OUT=16 -DNUM_USB_CHAN_IN=16
INCLUDE_ONLY_IN_2i16o16xxxaax =

# Audio Class 2, Input, Output, No MIDI, SPDIF out, SPDIF in
XCC_FLAGS_2i10o10xssxxx = $(BUILD_FLAGS) -DSPDIF_RX=1
INCLUDE_ONLY_IN_2i10o10xssxxx =

# Audio Class 1, 2 channels Input, 2 channels Output, no MIDI, no SPDIF
XCC_FLAGS_1i2o2xxxxxx = $(BUILD_FLAGS) -DAUDIO_CLASS=1
INCLUDE_ONLY_IN_1i2o2xxxxxx =

# Audio Class 1, 8 channels Input, 2 channels Output, no MIDI, no SPDIF
XCC_FLAGS_1i8o2xxxxxx = $(BUILD_FLAGS) -DAUDIO_CLASS=1 -DNUM_USB_CHAN_IN_FS=6 -DMAX_FREQ_FS=44100 -DSTREAM_FORMAT_INPUT_1_RESOLUTION_BITS=16
INCLUDE_ONLY_IN_1i8o2xxxxxx =

ifeq ($(TEST_CONFIGS),1)
XCC_FLAGS_upgrade1 = $(BUILD_FLAGS) -DBCD_DEVICE_J=0x99 -DBCD_DEVICE_M=0x0 -DBCD_DEVICE_N=0x1
XCC_FLAGS_upgrade2 = $(BUILD_FLAGS) -DBCD_DEVICE_J=0x99 -DBCD_DEVICE_M=0x0 -DBCD_DEVICE_N=0x2
endif

else

# MFi test build configs - iAP support enabled

# # Audio Class 2, iAP enabled, Input, Output, No MIDI, SPDIF Tx
XCC_FLAGS_2i10o10xsxxxx_mfi = $(BUILD_FLAGS) -DIAP=1 -DSPDIF_TX=1 -DMIDI=0
INCLUDE_ONLY_IN_2i10o10xsxxxx_mfi =

# # Audio Class 2, iAP enabled, No Input, Output, No MIDI, SPDIF Tx, DSD
XCC_FLAGS_20i10oxsxxxxd_mfi = $(BUILD_FLAGS) -DIAP=1 -DSPDIF_TX=1 -DMIDI=0 -DDSD_CHANS_DAC=2
INCLUDE_ONLY_IN_20i10oxsxxxxd_mfi =

#Audio Class 2, iAP enabled, EA Protocol (Native Transport), Input, Output, No MIDI, No SPDIF Tx. i
# Hid controls disabled (buttons used for EA)
# XCC_FLAGS_210i10oxxxxx_mfi_n = $(BUILD_FLAGS) -DIAP=1 -DIAP_EA_NATIVE_TRANS=1 -DMIDI=0 -DSPDIF_TX=0 -DHID_CONTROLS=0
# INCLUDE_ONLY_IN_210i10oxxxxx_mfi_n =

#Audio Class 2, iAP enabled, Input, Output, No, No SPDIF Tx. Select USB A port. Ignore VBUS.
#Note, this is the config used for Apple role-switch
XCC_FLAGS_2ioxx_usba_mfi = $(BUILD_FLAGS) -DIAP=1 -DMIDI=0 -DSPDIF_TX=0 -DUSB_SEL_A=1 -DXUD_PWR_CFG=0
INCLUDE_ONLY_IN_2ioxx_usba_mfi =
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

See section 5.4 of http://www.xmos.com/download/private/US ... 5.a%29.pdf

Basic analog in/out with no whistles/bells is 2i10o10xxxxxx
maqu67
Member++
Posts: 22
Joined: Tue Jan 23, 2018 3:26 pm

Post by maqu67 »

After compiling and flashing the software of AN00162_i2s_loopback_demo[1.0.3] I can play audio
from analog_in to analog_out in xCORE-200 MC AUDIO Board.
All works fine (using analog input ch1 I can obtain audio on analog output ch1, using analog input ch2 I can obtain audio on analog output ch2 and so on for all the 4 analog stereo channels).
This means that the board from hardware point of view if configured in the right manner (I mean regarding the Jumpers after ADC and before the DAC).

When I compile the 2i10o10xxxxxx configuration of the app_usb_aud_xk_216_mc software the analog loopback doesn't work. Instead works Audio streaming from usb
to the first stereo analog channel.

I think that there is something to configure about the channels map in the software. It may be that it is possible with the PC application for Apple-pc via usb sending command to the EP0 control channel (USB).
But I have only a WIN PC so I can't use the application shown in figure 3 in the file "Fundamentals of USB Audio.pdf".
Do you know what I need to change in the software ? It may be in the mixer.xc or decoupler.xc.

Thanks in advance for your help

Massimiliano
stnschrdr
Member
Posts: 13
Joined: Thu Jan 24, 2019 7:35 pm

Post by stnschrdr »

maqu67 -
Did you connect a microphone to Line IN ch 1? If so what kind of microphone did you use? Did you need to power it. I'm using the 'AN00162_i2s_loopback_demo' project but would like to also get it to work in the 'app_usb_aud_xk_216_mc' project. I'm currently running in Windows.
I can stream a wav file from Audacity into the Line in and play it out of Line out connected to speakers, but I don't know how to read audio in directly from a mic attached on a Line IN channel and either record it from Audacity or play it out through the Line Out speakers. Please help if you can.
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

You'll probably need some kind of microphone amplifier if you're using a microphone; mics won't give you line levels. Check your local music store and tell them what mic you need to hook up into your MC audio board line in.
stnschrdr
Member
Posts: 13
Joined: Thu Jan 24, 2019 7:35 pm

Post by stnschrdr »

Thanks akp. That worked! I used a breakout board equipped with electret microphone and adjustable amplifier. For others trying to do that same thing, the microphones worked pretty well by powering the amplifier Vcc from the 5VA-GND3 header on the XCORE-200 MC board.
Post Reply