By splitting the channel he means using two channels and send same data over both the channels as shown below:
I do understand that.
However the I2S module found on xcore github has no i2s_read function.
The i2s_master which is present has a different interface.
Being :
Code: Select all
void i2s_master(r_i2s &r_i2s, streaming chanend c_data, unsigned mclk_bclk_div)
So i need to get the data from streaming channel c_data and split it again into 2 new channels
and push the new samples from 2 receiving channels in to 1 channel c_data again.
Schematically :
Code: Select all
AdcChannel0
/
c_data -
\
AdcChannel1
and
Code: Select all
DacChannel0
\
- c_data
/
DacChannel1
Would it be something like this ?
Code: Select all
for (i=0; i< NUM_OF_IN_CHANNELS; i++)
{
c_data :> InputSamples;
AdcChannel0 <: InputSamples;
AdcChannel1 <: InputSamples;
}
for (i=0; i< NUM_OF_OUT_CHANNELS; i++)
{
OutputSamples <: DacChannel0;
c_data <: OutputSamples;
OutputSamples <: DacChannel1;
c_data <: OutputSamples;
}
Pops up the next question.
Streaming channels do not seem to require a handshake.
If the process of retrieving new samples is busy for NUM_OF_INPUT_CHANNELS-1, being a left sample and right sample, is it blocking the writing of the output samples ? or not ?
How is this performed on HW ?