As I'm going through the various example applications on the different libraries and applications, I've now bumped into example application AN246 which can be found on <dir>\lib_xua\examples\AN00246_xua_example and whilst playing with it, I've found some strange behaviours and would please appreciate some guidance on the observed behaviour and what may I be doing incorrectly.
Below are the different observations to which I would very much appreciate some input please :)
1- If I run the application without making any modification, I can see the enumeration on the device manager just fine and the device shows up as a sound card. However, on the TUSBAudio control panel (I have the Thesycon usb driver installed) it does not detect any device. Note that I can get the I2S clocks out, so it currently works even without being being detected on the TUSBaudio control panel.
Is there any specific define that I should be enabling in order for the image that is being built to include any specific usb enumeration that is specific to Thesycon?
2- I modify the configuration of the code slightly so that the device also enumerates as a microphone (along with the speaker). The code modifications are as below: (nothing else was modified)
Code: Select all
#define NUM_USB_CHAN_OUT 2 /* Number of channels from host to device */
#define NUM_USB_CHAN_IN 2 /* Number of channels from device to host */
#define I2S_CHANS_DAC 2 /* Number of I2S channels out of xCORE */
#define I2S_CHANS_ADC 2 /* Number of I2S channels in to xCORE */
I've added a bunch of prints and through the xscope I'm reading the following:
Code: Select all
C:\xmos\lib_xua\examples\AN00246_xua_example>xrun --xscope C:\xmos\lib_xua\examples\AN00246_xua_example\bin\app_xua_simple.xe
AudioHwInit
mClk:-1, curSamFreq:48000
mClk:24576000, curSamFreq:48000, numBits:64
Divide:8
divide > 0
!remainder
!divider_is_odd
ConfigAudioPortsWrapper
p_i2s_dac:539896, I2S_WIRES_DAC:1, p_i2s_adc:0, I2S_WIRES_ADC:1
p_lrclk:65536, p_bclk:65792, p_mclk_in:66304, clk_audio_bclk:1030, divide:8, curSamFreq:48000
xrun: Program received signal ET_ECALL, Application exception.
0x0008093c in XUA_AudioHub (clk_audio_mclk=<optimized out>, clk_audio_bclk=1030, p_mclk_in=66304, c_aud=<optimized out>, p_lrclk=<optimized out>, p_bclk=<optimized out>, p_i2s_dac=..., p_i2s_adc=...) at C:/xmos/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:882
Code: Select all
(gdb) backtrace
#0 0x000800c4 in _DoException ()
#1 0x0008093c in XUA_AudioHub (clk_audio_mclk=<optimized out>, clk_audio_bclk=1030, p_mclk_in=66304, c_aud=<optimized out>,
p_lrclk=<optimized out>, p_bclk=<optimized out>, p_i2s_dac=..., p_i2s_adc=...)
at C:/xmos/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:882
#2 0x0008034c in __main__main_tile_1 (formal.c_aud9=65792, formal.i2c10=<optimized out>) at <synthesized>:118
#3 0x0008168c in main ()
When I run stereo usb IN/OUT (along with the respective I2S channels) on the usb audio reference application, I don't have this problem and it enumerates just fine and I can get the clocks and audio out. I've compared the code between the two on the main of the lib_xua and it's mainly doing the same (just avoiding all the defines from SPDIF, adat & etc).
Any idea why it would be different here? Any suggestion on what I could/should be looking in to?
Thank you!