New to XMOS bulding USB I2S bridge

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
adamDavid
Newbie
Posts: 1
Joined: Sat Sep 10, 2022 3:27 am

New to XMOS bulding USB I2S bridge

Post by adamDavid »

Hi All,

Forgive the clueless newbie prost.

I'm in the process of designing a USB to I2S bridge for a project and finding this much harder than I expected.

I have the dev kit XK-AUDIO-216-MC-AB and have downloaded all the documents tools etc available.

I'm not a super proficient professional coder. I'm a hardware guy who knows enought to push Arduino's to their very limit so know enough C/C++ to do that.
Having read through the documents and looked at the code my first impression was I'm really not sure that this documentation is sufficient to lean this platform and toolset from scratch.
I looked at the example code base for the dev board app_usb_aud_xk_216_mc. Looking at the code didn't enlighten me a great deal as to how it worked.

I had expected to be able to look at the code for the dev board, it be pretty close to a functioning USB to I2S bridge and kind of understand what it is doing but I'm not getting that feeling at all.

I tried to compile the code using XTC Tools 15.1.4 and it doesn't compile
Found in a YAML file a line listing a version of XTime composer from 7 years ago. It does compile with this.

I found a post by fabriceo pointing to his git archive for DXIO. It is based on the example code but a lot has changed. Comparing the modules/libraries to the XMOS guthub things are a lot different.

So my question is, is it me not knowing enough programming or are the learning resources incredibly piss poor?

Is is feasible to learn the environment from the available documentation? How big was the leaning curve for you? Did you go on some XMOS course to get up to speed or is it indeed possible to do it from the documentation?

All I want to do is setup a USB to I2S bridge with SPDIF and USB in. Add to the code some communication with a front panel userinterface so say display the current bitrate etc. Be able to talk to an ESS DAC IC over I2C to set register values.

I had initially thought that with access to the dev board and example code for it that this was not going to be a big task. Thinking I'm wrong in that assumption at the moment.

Thanks Adam


User avatar
CousinItt
Respected Member
Posts: 360
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Hi Adam,
adamDavid wrote: Thu Oct 06, 2022 5:24 am So my question is, is it me not knowing enough programming or are the learning resources incredibly piss poor?
The resources aren't great, but I think they are sufficient if you have enough time. By resources I mean the available documentation (language guides, architecture docs, data sheets, app notes, and so on), a few youtube videos from xmos, and the people that provide help on this site. Have you got the USB Audio Design Guide, for example?
adamDavid wrote: Thu Oct 06, 2022 5:24 am Is is feasible to learn the environment from the available documentation? How big was the leaning curve for you? Did you go on some XMOS course to get up to speed or is it indeed possible to do it from the documentation?
I learned using the documentation, with xTimeComposer and an xCore-200 explorer kit. The IDE has a facility for downloading libraries (e.g. for providing interfaces such as I2C or I2S) with the relevant documentation, and it's really useful to study the library code. I'd say it is a fairly big learning curve, but for me it was well worth it.

In the transition from xTimeComposer 14.x to XTC tools 15.x, xmos has tried to do a few things: mainly abandoning the IDE, and using a more "C-friendly" approach. Presumably they thought xC was too big a hurdle for the average programmer. Not all the documentation or code examples have caught up, and some might never be updated. I still use xTC 14.4.1 and I doubt I'll change unless I need to, but I dabble with 15.x just in case.

I hope you'll get more comments from others. I don't know much about USB audio, but there are people here that do.

HTH
mmar
Experienced Member
Posts: 122
Joined: Fri Jul 05, 2013 5:55 pm

Post by mmar »

Hi Adam,
your understanding start with architecture. 216 mean 2 hw cores L2 in package and 16 threads codes max. (8+8)
This for you result you can write aka 16 main codes. And plus handle in core and out core between threads communication.
For simple learn start with one core kits and understand 208.
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

A new USB Audio release is actually imminent - it will work with tools 15 and includes a documentation refresh. The older release needs tools 14 as per the yml file you reference.
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

adamDavid wrote: Thu Oct 06, 2022 5:24 am Hi All,

Forgive the clueless newbie prost.

I'm in the process of designing a USB to I2S bridge for a project and finding this much harder than I expected.
...
I had initially thought that with access to the dev board and example code for it that this was not going to be a big task. Thinking I'm wrong in that assumption at the moment.

Thanks Adam
Adam, your frustration is very understandable. But your task is very simple and sure thing you can do it with your board and original source codes adding 50 lines of your code just in 1 file. With no any hw XMOS knowledge and avarage C skill it may take 1 month to sort things out. So just don't give up at start. And this forum is just a brilliant database for verious information.

Our experience with XMOS is very positive. We didn't need even in Evaluation Board. I made my first working firmware without XTAG and just with Chinese noname board USB-I2S. I compiled and downloaded it with DFU utility. It worked fine. Then I said "yes" to XMOS platform and bought XTAG and added debugging information to XTC console. Things went way better then!

Our latest product now uses all cores of XU216, all GPIOs and a lot of additional hardware onbord (4 I2C buses, 10 clients). OLED sctreen too. XMOS is the only MCU inside. Our firmware is 3 times bigger than original one and I can't believe it still works. :)

It would be better if you'd search forum for any specific question or ask something in particular and not so general.
Last edited by MaximLiadov on Tue Apr 18, 2023 10:11 pm, edited 1 time in total.
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Nice work Maxim! What functionality have you added?
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

Ross, first of all, big respect to you personally and all XMOS guys. You are making really fantastic products. Please, keep up your great job!

Firmware most interesting features' list:
1. Unlike EVB and swarm of Chinese PCBA, we use no any Xtal onboard, except one single 24 MHz. So we added custom N-fractional/integer lilbrary for dedicated PLL IC (8ch Silabs). We are very happy to know XS3 already has audio PLL inside XMOS!
2. OLED screen with 4 different brightness modes (hw) and auto-off by timer.
3. Two real-time peakmeters. One full-screen horisontal 128 segments with true dB scale. One small vertical 32 segments on main info screen (on photo).
4. Multi-language menu Settings with saving/loading options inside XMOS memory, in its data area.
5. TTF fonts in main screen, user can choose one from font list. One B/W font is packed in just 2 kbytes.
6. External SPDIF reciver IC and SRC IC to mix SPDIF input of any sample rate with any current USB sample rate. U+S label on photo. No annoying "input select" needed.
7. Realtime input SPDIF speed counter. (No much use, but cool)
8. Hardware volume control. Volume from OS goes to DAC registers, especially useful for DSD mode, when you need bit perfect data transfer.
9. Internal 1 kHz sine wave generator. (Cool feature too)
10. Many peripheral IC for specific DAC/ADC/HPamp features, like automatic line out sound mute when you connect hp. Аcceleration sensitive volume knob.
11. Modern XMOS libraries instead of modules. Client-server for I2C, GPIO. (i.e. all mammoth coprolites from XS1 age were removed).

After all, our sound quality is outstanding, as we use many expensive custom components on PCB and only original circuits in ADC/DAC/HPamp parts with no any single OpAmp. Hope some day you guys could evaluate it too. :)
Last edited by MaximLiadov on Sun Nov 13, 2022 8:02 pm, edited 1 time in total.
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

I hope to have a chance to use XS3 in our next product, to use more fast cores and to add FPU sound processing. So good XU316 XTC 15 audio project from XMOS is very welcome. :)
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Thanks for the kind words, sound's like an interesting project! Very nice enclosure too!
MaximLiadov wrote: Sun Nov 13, 2022 7:56 pm I hope to have a chance to use XS3 in our next product, to use more fast cores and to add FPU sound processing. So good XU316 XTC 15 audio project from XMOS is very welcome. :)
Stay tuned!
RitchRock
XCore Addict
Posts: 186
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Ross wrote: Fri Nov 04, 2022 12:59 am A new USB Audio release is actually imminent - it will work with tools 15 and includes a documentation refresh. The older release needs tools 14 as per the yml file you reference.
Ross - can you give any sort of update on this? Will it be targeting toward the xcore.ai kit?
Post Reply