USB XMOS + SHARC DSP + ES9016 DAC ... I2S question

Trying to figure out how connection of xmos, dsp and dac should look like.
DAC
https://www.diyinhk.com/shop/audio-...84khz-32bit-es9016-pcm-dxd-dsd-audio-dac.html
DSP
https://www.aliexpress.com/item/32978121788.html
i took only small board with DSP + USBi interface
XMOS
CM6632A based, there is software available for both Master and Slave mode I2s

What worries me is that on DSP side i only have single pins for clocks for both input and output.
Pinout i got in description from aliexpress seller:

  • FS(96KHz) A11
  • CLK(6.144MHz) A8
  • Master CLK(24.576MHz) A14
  • IN A/B A9
  • IN C/D A5
  • OUT1/2 A6
  • OUT3/4 A10
  • OUT5/6 A20
  • OUT7/8 A15
So how to connect all this? Can I just 'split' clocks from dsp and connect to both in and out on dac and xmos??
If needed i can post all the pinout and schematics i gathered.
 

Attachments

  • i2s.jpg
    i2s.jpg
    113.8 KB · Views: 229
Option 1: Everything needs to run on the same master clock and at the same sample rate, same I2S format (I2S, LJ, RJ). That means the DSP board will have to be I2S clock master. The ES9016 would have to be configured to operate as an I2S clock slave, and share the same master clock as the DSP board.

Option 2: Let the DSP board be clocked the way it is, and let the ES9016 be clocked from its onboard clock. ES9016 will be an I2S clock slave (the normal default for a dac). The dac chip internal ASRC will convert the DSP I2S clocks and data to whatever sample rate ES9016 is using internally.

Also, its not clear if the DSP board is designed to interface with an XMOS USB board. From looking at the pics and reading the ad text it kinda looks more like they assume audio will go into the board as analog audio, NOT digital audio from a computer. If so, IMHO that would be unfortunate. Of course, the DSP chip itself could probably handle I2S from a USB board if there are spare input pins available that could be programmed for that purpose.
 
Thanks Mark,
Honestly I was hoping it will be like Lego🙂 connect proper pins and enjoy.. still hope wont be too bad experience.

ADSP 21489 work natively @48khz or 96khz and that actually suits me, if it wont be problem to connect dac🙂

Xmos is standard I2s, dac also. Hope dsp is configured that way also, there are 2 options:
https://www.analog.com/en/products/adsp-21489.html
*serial ports (SPORTs) supporting I2S, left-justified sample pair




If I understand well, their mainboard 2 ADC and 4 DAC can be connected. So there is analog in via ADC, and then it uses i2s(LJ?) to connect with DSP.
According to schematics and if I read them well.. both ADC and DAC are connected Always to same pins on DSP when it comes to clock (no matter if its i2s IN or OUT):
DAI_P11 - LRCK
DAI_P11 - BCLK
DAI_P11 - MCLK
and only data lines are different
Is it possible?
pinout1.jpg

I am adding full schematics in attachment also.


As for now I did try to connect xmos to DSP via spdif (DAI_P17 pin) with 'success' - i see in SigmaStudio that there is signal on input

Cant connect with I2S yet, I did flash XMOS with slave firmware, connected LRCK, BCLK, MCLK, GROUND, DATA and nothing
 

Attachments

An XMOS USB board will not match the clock frequency on the DSP board exactly. Does the DSP chip have internal ASRC function to deal that issue? If so, the DSP chip may need to be programmed to use its ASRC to convert USB board I2S data to be compatible with the DSP board clock.
 
So we talk about option2?
Programing DSP is very limited as i dont have access to VisualDSP (thats where programing of I/O is) or interface to connect, no source code either as it is custom board. I can only use SigmaStudio with USBi and there can add filters, equalizer etc from blocks.

Also can you tell me makes devices 'compatible'? Oscillator or is it something else?

Option1 wont work - use MCLK?
That i2s connection dont work for me might be trivial problem - first time doing anything with I2S
 
Last edited:
Let's clarify a bit what you want to do in terms of interconnections.

Is it that you want to connect the output of an XMOS USB board to an input of the ASDP-214xx?

If so, do you also want to connect the ES9016 DAC board to an output of the ASDP-214xx?

If not the above, then what device do you want to interconnect to what other device?
 
My intention was to build digital crossover with dac and usb input

PC-->USB XMOS --(i2s 2ch)--> ADSP-21489 --(i2s 6ch)--> 6ch DAC

If Not possible I might go with
PC--(SPDIF)-->ADSP-21489 --(i2s 6ch)--> 6ch DAC
Since i managed to get signal to dsp with spdif.. or something different
 
Okay. ADSP-21489 datasheet says it includes ASRC blocks. That means if you can figure out how to route I2S from a USB board into the DSP chip, you can convert I2S data from the USB board to the equivalent data as clocked to the DSP board clock. You would have to read the datasheet to see which input pins on the DSP chip can accept I2S input signals that need ASRC processing.

The reason ASRC is needed is for a couple of reasons. Digital audio is based on two families of clock frequencies. One family is for 44.1kHz, 88.2kHz, 176.4kHz, etc. The other family is for 48kHz, 96,kHz, 192kHz, etc. Therefore most dacs and USB boards have two clocks, one for each family. The clocks get switched on and off as needed. OTOH, your DSP chip only has one clock. Okay, that's for first reason.

The other reason is that even if have two clocked intended for one clock family, say, for example, the 44.1kHz family, two clocks never run at perfectly the same exact frequency. They all drift a little over time and temperature, they are slightly different when manufactured, etc. So you always either need to use the same clocks for every device in an reproduction system, or you need ASRC to convert digital data to work with different clock timing.

Okay, I won't go into other things like FIFO buffering. Just trying to explain the basic problem. Also, besides the ASRC inside the DSP chip, there are dedicated ASRC chips we can use.

Regarding finding an I2S input for a USB board somewhere on the DSP board, it might be possible to feed digital audio from the USB board into one of the ADC sockets on the DSP board. To do that you would probably need dedicated ASRC chip to do the same rate conversion between the USB board I2S output and the DSP board ADC input socket.
 
Thanks for explaining Mark every bit of information is precious for me.
So XMOS got 3 oscillators 12MHz 49.152MHz 45.1584MHz and support both 44.1kHz and 96kHz
---
DSP natively support 48kHz and 96kHz and 24.576MHz oscillator
------
DAC
What I found in similar project with exaclty same board:
In typical operation DAC is clocked synchronously from I2S source but board has pads to allow installation of a local oscillator to allow for asynchronous clocking


And I am perfectly fine with constant 96khz if it all works, since DSP will operate on that sample rate.
PC-->USB XMOS --(96kHz)--> ADSP-21489 --(96kHz)--> 6ch DAC



I connected XMOS with DSP again, set xmos output on windows to 96kHz.. and it worked🙂
No idea what was wrong.. connection (there been 2 differnt DGND connections on schematics?).. firmware ( i did try other from vendor).. Anyway seem to be working fine
in Sigmastudio I see signal and it responding as it should react to volume.. tone is flat line on vol meter etc
001.png

Xmos is in slave mode and its connected without MCLK

i2sxmos.jpg


So that part is done (I hope!)

Now I have question:
Can I just take LRCK and BCLK signals from DSP and split them to go to both XMOS AND DAC ?
lrck_split.jpg

In dps schematics it looked like they done it this way, they just added 33R resistors
 
Last edited:
33R resistors are used at the output of I2S sources to damp transmission line reflections. Some people prefer to use somewhat higher values of resistance, maybe as much as 100R. Have to try it with a particular dac to see if any effect on the sound. The theoretical value is usually closer to 33R.

DSP is probably working now since XMOS board is outputting 96kHz, which is maybe close enough even if the XMOS clocks are not exactly the same frequency as the DSP clock (which should result in some errors, but you may or may not notice).

In Windows if you set the default sample rate and bit depth for the XMOS USB board to 96kHz, 16-bit, or maybe 96kHz, 32-bit, then Windows will resample the audio stream using its built-in SRC. Its SRC instead of ASRC since Windows can to it synchronously in this case. However, if you use ASIO drivers and or try to send DSD then you will likely have problems because then you could be sending other than exclusively 96kHz PCM all the time.
 
I bought cheap logic analyzer so I might try compare file from PC with what will be on i2s out of dsp to be sure all is fine and play with resistors.
I dont even think about DSD.. would have to be converted to PCM anyway since DSP will be my crossover🙂 And there is a lot of 24bit 96kHz flac files, rest can be resampled on PC - that suits me.

So to be sure.. its alright to just split LRCK, BLCK from single pin of DSP to two other devices?
 
Supplying I2S clocks doesn't work with USB boards. They need master clocks. Some need 45/49MHz master clocks; Amanero uses 22/24MHz.

Some dacs only need I2S clocks, and other dacs need the master clock too. Old non-oversampling dacs may not use nor need a master clock signal. They only need I2S clocks.

Some modern dacs such as ESS have internal ASRC. That means they can work with I2S clocks from a source device without having to share the master clocks. ESS dacs still need some master clock, at least one of them. The master clock just doesn't have to be shared between devices.
 
Last edited:
So to be sure.. its alright to just split LRCK, BLCK from single pin of DSP to two other devices?
Well I was asking if its electrically correct? about logic I will worry later.. first this🙂 Wouldnt like to break anything.

And now Im confused.. I tried every sample rate from 44.1 to 192 and 16, 24, 32bit.. and I see signal getting to DSP in sigmastudio.. same as it was with 96khz.. so I dont know how but its good I guess🤓. ASRC need to be enabled on both input and output to work?
I can verify this when I receive toroidal transformer for DAC power supply, so need to wait bit more.
 
Are you using Windows? If so, what is the default sample rate shown for the sound device you are using (see pic below for reference)?

OTOH, if you have verified the actual sample rates coming out of the USB board with a scope or other means, and if there are multiple master clocks in use, then ASRC must be happening somewhere, or else you would be getting errors that would affect the sound and or cause it to mute.

To further clarify, even if Windows is set for a default sample rate compatible with the DSP clocking, so long as there are multiple master clocks (after the PC) there should still be some bit errors occurring without ASRC. Whether or not such errors would necessarily be noticeable/audible could vary over time.
 

Attachments

  • WinSoundConfig.jpg
    WinSoundConfig.jpg
    64.5 KB · Views: 105
Last edited:
I have both Linux and windows now as SigmaStudio is for windows only, and yes thats exactly what I did (Your screenshot), was trying (to have other confirmation) ASIO output in foobar and set sample, but i dont see option for this, i could only select 16, 24 or 32bits. So i went for DAW software - Reaper. There is 'request sample rate' for ASIO but that also doesnt seem to work - I put something silly like 515515Hz.. and still was 'playing' in SigmaStudio🙂 🤷‍♂️ Apparently request didnt work.

Dac is very nicely made, there is even i2c socket so i can modify es9106 registers if needed, and can be easy way to implement volume control.

I will check real sample rate with my cheap logic analyzer.. now im in proces of learning how to make PCB at home - on DSP there is non standard male socket 2mm raster. I will try to make pcb, solder to that socket on DSP directly, also i want to put there 33R resistors for i2s signals and socket to connect to DAC.

Anything You can tell me about 'reset dac' pin?
 
ASIO in theory at least bypasses Windows Audio Engine so no SRC should be taking place in the PC. However, if the audio device has a green circle with a white checkmark in it as can be seen in the example I posted, then you may have a problem where Windows interferes with audio stream integrity.

One way to check sample rate at a USB board especially if you don't have a scope is the read to F0 - F3 bits on the USB board output connector with a DVM. They indicate the sample rate in a way that can be understood by an MCU controlling the dac. Since there seems some variation in how manufacturers implement that function, you might need the documentation for the particular USB board to see how they encode the clock-family and sample rate information into those bits.

EDIT: Regarding I2C control of ESS dac chips, one of the more important settings that can affect SQ is DPLL_BANDWIDTH. ESS recommends to set it the minimum stable value for your system. The lower incoming jitter is, the lower DPLL_BANDWIDTH can be set without losing stability.
 
Last edited:
People have tried it before. One guy got a driver working for RPi that worked with the dac boards in the ES9038Q2M thread and that set DPLL_BANDWIDTH to a minimum. The improvement can be pretty obvious if the dac and reproduction system are otherwise in reasonably good shape. Since that time some commercial dacs allow the user to adjust DPLL_BANDWIDTH in the settings. Best way to understand what that does to the sound is find a dac that allows adjustment of it, or else make your own, then give it a listen.
 
Practice. Developed a trained ear, and learn to classify and rate low level artifacts quickly. For ABX, memory can be a bigger problem, especially when artifacts have an unusual sound and are very low level. In that case they must be listened to over and over until they can be transferred to long term memory. It takes great and sustained concentration, as PMA found out when he learned how to pass ABX. That's one reason A/B is easier, because short term memory span may just be long enough for a simpler blind protocol. The foregoing is entirely IMHO and IME. Complain to PMA, not me, if you don't like what he found.