Integrate lib_i2s in app_usb_aud_xk_216_mc

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
Active Member
Posts: 40
Joined: Tue Jan 07, 2020 10:35 am

Integrate lib_i2s in app_usb_aud_xk_216_mc

Postby nick » Mon Nov 16, 2020 11:54 am

I'm developing a firmware based on the app_usb_aud_xk_216_mc. I need 32 input and 32 output channels, but on TDM16 lines.
I've already modified the code to do TDM16, but after some tests I noticed a sample loss when using both lines: I tried to send a tone (on 2 channels) to a device (working in TDM slave mode) which it sends it back to the XMOS.
- if I send the tone on channels 1-2 the recorded signal is perfect: no loss.
- if I send the tone on channels 17-18 the recorded signal is perfect: no loss.
- if I send the tone on channels 16-17 the recorded signal on channel 16 is perfect but the one on channel 17 has sample losses (zero samples).
This made me think that when streaming audio to both the TDM lines, the second line has problems due to TDM performances.

Then I tried the same setup, but using the AVB firmware (based on AN00203), which I modified to use TDM16. With this setup I didn't noticed sample losses and everything worked perfectly.
So it seems an optimization problem with TDM code in the USB application. Is this the real cause of the problem I'm facing?

So I thought to integrate the library lib_i2s in the USB application. Has anyone tried to do this? Any suggestions on the part of the code to modify?
I'm pretty sure the file involved is the audio.xc (in module_usb_audio), but it's not so clear to me how to integrate the tdm client task of the lib_i2s.

Who is online

Users browsing this forum: No registered users and 5 guests