options connecting 2 VS1005 together

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
QuatroDos
User
Posts: 2
Joined: Tue 2019-07-16 0:16

options connecting 2 VS1005 together

Post by QuatroDos » Tue 2019-07-16 0:37

Hi,
Is there an easy way to connect 2 VS1005 into a pipeline?
I would like to achieve something like:
use one VS1005 as SoC (to control LCD, USB, SD card and as audio decoder) and I would like the output (digital 24 bits) to be the input of another VS1005 (which would run FTEQU and produce digital data using I2S for external DAC)

so far I looked at:
1. connecting them via I2S (but it seems that I can't run I2S as both input and output simultaneously which prevents me from using it for connection since I need output of the 2nd VS1005 to pass I2S to the external DAC)
2. using S/PDIF, however the support in VSOS seems to be lacking and I saw a post stating that it can't be used together with USB

it seems like the only option would be to invent a custom SPI protocol where the 1st VS1005 captures digital output and uses SPI to pass data to the 2nd VS1005 and the second one uses it as PCM input, but it feels like there should be an easier way to achieve that, I just can't see it

any idea if there is an easier way?

thanks,
Tom

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2691
Joined: Tue 2010-06-22 13:43

Re: options connecting 2 VS1005 together

Post by Panu » Tue 2019-07-16 10:28

Hi!

You can use I2S for both input and output as long as the sample data format and clock is the same.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Henrik
VLSI Staff
Posts: 1144
Joined: Tue 2010-06-22 14:10

Re: options connecting 2 VS1005 together

Post by Henrik » Tue 2019-07-16 12:58

Hello!

To elaborate on what Panu said: if your card #2 is intended to read data through I2S input, then process the audio in any way that doesn't alter the sample rate, then output the end result through I2S, the process goes roughly as follows:

1) Make the connections as shown in the image below. The idea is that all other signals from VS1005 #1 go to both VS1005 #2 and the I2S DAC, except actual data, which is routed through VS1005 #2 to the DAC. This is assuming 12.288 MHz is high enough a clock signal to ensure operation of the DAC. This again depends on the sample rates / bit depths needed.
i2s_chain.png
i2s_chain.png (7.66 KiB) Viewed 100 times
2) Software configuration on VS1005 #1. Let's make it a master running at 96 kHz and 32 bits. Add this to config.txt:
AUOI2SMA
Now everything that is written to stdaudioout (VS1005 #1's internal DAC, that is), regardless of its original sample rate, will be automatically upconverted to 96 kHz 32-bit resolution, then sent through I2S outputs. If the DAC is incapable of handling 96/32 with a 12 MHz crystal, you can change the output to 16 bits with the following lines:
AUOI2SMA
RUN auoutput -dauoi2sma -b16 -r96000
Alternatively, if you know that you will never ever playback audio with a sample rate higher than 48 kHz on VS1005 #1, then you can alternatively turn the output to 48 kHz:
AUOI2SMA
RUN auoutput -dauoi2sma -b32 -r48000

3) Software configuration on VS1005 #2. Let's make it a slave running at the same parameters as VS1005 #1. Add this to config.txt:
AUXI2SS s
Now you have the I2S slave driver connected to both stdaudioin and stdaudioout. Also, if the config.txt file has activation of any other audio drivers, like e.g. AUODAC, AUOSPDA, or AUIADC, remove them.

4) Configuration of the I2S DAC. Can be either through setting some external pins hi/lo/etc, or through SPI, but depends on DAC, so not drawn in the picture.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

QuatroDos
User
Posts: 2
Joined: Tue 2019-07-16 0:16

Re: options connecting 2 VS1005 together

Post by QuatroDos » Wed 2019-07-17 23:35

that's perfect! thank you very much

cheers,
Tom

Post Reply