No sound with COAX RX Topic is solved

Discussions relating to the XK-EVK-XU316
vladimir593
Member++
Posts: 20
Joined: Tue Dec 12, 2023 11:33 pm

No sound with COAX RX

Post by vladimir593 »

Hi everyone!

A week ago I bought an XK-AUDIO-316-MC-AB development kit from Digikey in Germany. I have built a few firmware configurations and the board works perfectly as a USB DAC.
Now I am struggling to add SPDIF input support to my project. I am building with xtools 15.2.1 and app_usb_aud_xk_316_mc is version 8.1.0. I tried 2AMi10o10xssxxx and 2AMi10o8xsxxxx configs, but unfortunately, I hear no sound from OUT 1/2 as I heard with USB input.
Also, I tried the following config

INCLUDE_ONLY_IN_2AMi6o6xssxxx =
XCC_FLAGS_2AMi6o6xssxxx = $(BUILD_FLAGS) -DXUA_SPDIF_TX_EN=1 \
-DXUA_SPDIF_RX_EN=1 \
-DI2S_CHANS_DAC=4 \
-DI2S_CHANS_ADC=4

And I, can't hear any sound from OUT 1/2.

I am supplying the SPDIF signal to the COAX RX port from my digital audio player and USB-SPDIF converter that I have - no sound from both. Also, I tried the loopback test - I shorted COAX TX and COAX RX, but also no sound. So, then I checked the COAX TX of xmos dev kit and COAX OUT of my digital audio player with an oscilloscope - looks good.

Has anyone had any experience with this issue?
It is my first post here and I don't have much experience with SPDIF in XMOS.
Many thanks in advance.
View Solution
Joe
Verified
Experienced Member
Posts: 66
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

Hi,

The default sw_usb_audio software has the routing that SPDIF IN is routed to the USB host. You will probably find it on channels 5/6 in the host if you have built a 6in6out app with 4 i2s channels.

To route spdif in to the dacs isn't a standard config as it's architecturally different, you would need to lock the master clock to the spdif in stream and other changes. Of course it is possible in general but not supported by the default software.

The core functionality of the sw_usb_audio software is as an interface from multiple interface types - i2s, spdif, adat but all to the usb host. Things like e.g. routing the ADC I2S inputs to SPDIF output is possible in the hardware but would need custom software writing.

Cheers,
Joe
XMOS hardware grey beard.
vladimir593
Member++
Posts: 20
Joined: Tue Dec 12, 2023 11:33 pm

Post by vladimir593 »

Joe wrote: Thu Jun 13, 2024 10:13 am you would need to lock the master clock to the spdif in stream and other changes.
Hi Joe
Thanks a lot for your answer. Could you please give me some hints and tips?
Should I make changes inside SPDIF library or lib_xua?
I tried to record channels 5 and 6 with Audacity but got only "Error -9998 invalid number of channels"
So I couldn't test coax rx from USB host :( Any ideas? I am testing on windows 10

Regards,
Vladimir
User avatar
Ross
Verified
XCore Legend
Posts: 1071
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

You can route S/PDIF input chans to I2S output chans very simply by adding two lines in UserBufferManagement() to copy the samples

As Joe mentions, the USB host sets the SR of the system, it is not auto-detected from S/PDIF - this is an intentional design choice. It would require some work to add this functionality.

Sounds like you just want an S/PDIF -> I2S app, the usb audio SW might not be the best starting point.
Technical Director @ XMOS. Opinions expressed are my own
vladimir593
Member++
Posts: 20
Joined: Tue Dec 12, 2023 11:33 pm

Post by vladimir593 »

Hi Ross,

Many thanks for your reply. I routed SPDIF to I2S, but it
works only with 44.1 kHz - you are right XU316 is getting sample rate from usb. Is there is a variable that stores a sample rate ?

What I am trying to do is actually a DAC with both Coaxial and USB inputs with a switch to choose between them. Is it possible to store 2 firmwares - one inside QSPI Flash and one inside OTP ? I also saw an AN00231 spdif i2s app - may be it would be the right choice, if it is possible to switch between two firmwares. Do you have any ideas?

Regards,
Vladimir
User avatar
Ross
Verified
XCore Legend
Posts: 1071
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

It would be easier to have both images stored in flash with a customer boot loader to choose between them based on a switch or similar.

Both applications could/should cause a rebook based on this switch.

Here's is a related app notes on the boot-steering

https://www.xmos.com/download/XM-006679-AN-4.pdf
Technical Director @ XMOS. Opinions expressed are my own
User avatar
Ross
Verified
XCore Legend
Posts: 1071
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Technical Director @ XMOS. Opinions expressed are my own
vladimir593
Member++
Posts: 20
Joined: Tue Dec 12, 2023 11:33 pm

Post by vladimir593 »

Hi Ross,

Thanks a lot for your answer, it was very helpful.
It will be a perfect solution for my problem.
I have a question regarding AN00231 ASRC Spdif receiver app.
To build this app for my XC-AUDIO-316-MC-AB board, do I need to add .xn file from sw_usb_Audio App and the execute xmake command? Or should I just redefine ports in main.xc ?

I am a little bit confused with new build system with XTC tools 15.2
Earlier I built just with xmos composer studio, but it doesn’t support
xmos.ai devices.

And also about AN00109 Multiple Firmware Booting. Do I build it as described or should I make some transistion for the new build system like with new usb apps ?

I will post my results here.

Best regards,
Vladimir
vladimir593
Member++
Posts: 20
Joined: Tue Dec 12, 2023 11:33 pm

Post by vladimir593 »

Hi Ross,

I tried to build the AN00231 ASRC Spdif app for the XK-AUDIO-316-MC-AB board.

I changed port locations in the main.xc file and added .xn file.
But got the following error:

Compiling main.xc
xcc1: internal compiler error
Failed in ..\FrontEnd\Lowering\lower_combined_pars.cpp, line 183
info->stateObj
For bug reporting instructions, please see:
https://www.xmos.ai/support
xmake[1]: *** [.build_/main.xc.o] Error 1
xmake: *** [bin//AN00231 ASRC SPDIF.xe] Error 2

What can cause this error?

Regards,
Vladimir
User avatar
Ross
Verified
XCore Legend
Posts: 1071
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Hi Vladimir

Can I request that you make separate threads, with appropriate titles, for your issues regarding the app note and boot steering.

This helps create a useful resource for people in the future and also more easily allows others to help with specific issues rather than having to read a long thread.

Thanks
Technical Director @ XMOS. Opinions expressed are my own