AnsweredAssumed Answered

ASRC SoftwareModule Outputs

Question asked by Probbie on Aug 2, 2018
Latest reply on Aug 10, 2018 by Jithul_Janardhanan

Hi Folks


I am using the AsynchSampleRateConverter-SH-Rel.2.0 SoftwareModule on an ADSP-21488, and am confused about how to extract output samples in a real-time environment.
The example projects output to file, so are not real-time as such; the outputs are made available, as indicated by in the call to adi_asrc_pp_process() at the point where input samples are written to the ASRC.
As the user guide says: "the member variable num_output_samples_per_chan in the oASRCOutStatus structure informs the user of the output PCM sample count per audio channel".

However, in a real-time environment, I expected to have a read function which will return exactly the number of samples I need to occupy the output SPORT for the time it takes for the ASRC to process one complete block of input values.
In theory, if the ratio has been properly established, then the number of output samples available (per channel) will be exactly the number of samples required to fill an output block buffer which can then, under DMA feed a SPORT.
Take a (fictitious) example where we are converting from 48kHz to 24kHz with an input block size of 64. We need 32 output samples from the ASRC in order to fill the output block buffer. However, if the ASRC has, due to quantisation of the measured ratio of sample rates, only managed to produce 31 output samples, I cannot then transfer the number of samples needed for the next output block.

Worse than that; if we take another example of conversion from 48k to 44.1k using a block size of 64, then I need to feed an output block for use by the SPORT DMA once every 69.7 input samples. If we make our call to adi_asrc_pp_process() every 64 input samples and extract our outputs at the same time, then how can I (easily) get 64 output samples every 69.7 input samples without involving queues.

It feels like there is something I have misunderstood. Can you help please? Is there a real-time example of the ASRC library module?


Many thanks