Can't compile USB audio software

Discussions about USB Audio on XMOS devices
johnflashnathan
New User
Posts: 2
Joined: Tue Jun 25, 2024 8:48 pm

Can't compile USB audio software

Post by johnflashnathan »

Hi,

I am designing a Hi-Fi portable headphone amplifier destined for commercialization. I want to add an integrated Hi-Fi USB-C DAC, so I started designing one myself. As the decoder chip itself, I am using the ESS Sabre ES9039Q2M, which is one of the best chips out there for sound quality. As for the USB controller, I chose an XMOS chip, particularly the XMOS XUF208-256-TQ64-C10, since all the firmware the chip needs is provided by XMOS (and also because I have zero experience in coding).

Hence, I spent months learning how everything works, then I designed my circuit, got my PCB manufactured and everything, only to get stuck at the firmware part. I used the guide provided by XMOS (Porting the XMOS USB 2.0 Audio Reference Software onto XU208 custom hardware) and did exactly as the guide suggests. I spent complete days only trying to get the code to compile, but all I got were XTime Composer bugs, and random error codes (that were different each time I followed the steps, and yes, I have reinstalled xtime composer multiple times, completely erased the workspace, etc.).

I decided not to spend any more time on this. It would be very appreciated if you guys could help me with making the code for my DAC, I would really like to have one in my amplifier. I could continue the commercialization without, but I think having an integrated DAC is a great feature. If someone is willing to help, I will send all the technical details (the I2S port location, etc.)

Thanks in advance!
Audma_lm
Member
Posts: 11
Joined: Thu Oct 05, 2023 3:14 pm

Post by Audma_lm »

Hi, are you using v15 tools? xTIMEcomposer does not use them by default.
I can suggest to use VSCode for code development and build your project manually (e.g. xmake --makefile=Makefile CONFIG=1AMi2o2xxxxxx)
User avatar
Ross
Verified
XCore Legend
Posts: 1070
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

This should be pretty straight forward project once you get the examples building - then add the (i2c I assume) reg writes to configure the DAC.

You'll need to provide some descriptions of the build errors to allow people to help you. Audio_lm's advice looks pretty solid.

If you need someone to do the whole thing for you, there is the "Jobs" section.
Technical Director @ XMOS. Opinions expressed are my own
Joe
Verified
Experienced Member
Posts: 66
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

On Windows 10 (for me), the standard flow would be:

Download and install the latest XTC tools: https://www.xmos.com/software-tools/

Download the complete usb audio codebase latest release and unzip:

https://github.com/xmos/sw_usb_audio/re ... _8.1.0.zip

Open the "XTC Tools 15.2.1 Command Prompt", navigate to the unzipped files, cd to the sw_usb_audio_8.1.0\sw_usb_audio\app_usb_aud_xk_216_mc directory and type xmake.

This will build xcore-200 configs for the xcore-200 multi channel audio board.

You can then edit the files in the src directory to customise the build to your needs.

Similar flow for other OS.

Cheers,
Joe
XMOS hardware grey beard.
johnflashnathan
New User
Posts: 2
Joined: Tue Jun 25, 2024 8:48 pm

Post by johnflashnathan »

Thanks to everyone for your help.

Honestly, this seems way too complicated for me to take on, and I have very little resources right now (I don't have the money to pay someone).

That said, I think I will just focus on commercializing the analog amplifier for now (which is already done) and maybe have a DAC in the next version.

Thanks again for everyone's advice!
vladimir593
Member++
Posts: 20
Joined: Tue Dec 12, 2023 11:33 pm

Post by vladimir593 »

Hi johnflashnathan,

I can try to compile a USB - i2s app for you, free of charge.
I made my XUF208 board last year and it works.
Just send your pin map or schematics for the USB part and I will do this in a few days.
I am an audiophile and a fan of portable HiFi amplifiers :)

Best regards,
Vladimir
MaximLiadov
XCore Addict
Posts: 143
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

>> I have zero experience in coding

Not being a programmer, but having many years of programming experience, I wrote my first firmware for XMOS without any EVB, just on a custom PCB. So it's possible for sure. But it definitely took me more than 1 day. So nothing wrong with you. Don't give up!

In my opinion, XMOS programming is not something you will understand right away. Programming an ESS DAC would also take some effort. Take your time. That's very exciting! Why are you in such a rush?

Once you have your first firmware working, you may want to add your own customizations. So it would be better to find a programmer next to you, get him a beer and ask for help. Read a book/online lessons (C language) for basic knowledge. Make sure you have the XTAG hardware adapter to run, debug or flash firmware.

Another option is to simply purchase a ready-to-use PCBA for DIY use with loaded firmware. Not a lot of money. Time-saving option.