AnsweredAssumed Answered

i.MX6 ASRC audio support

Question asked by Alexander Smirnov on May 29, 2013
Latest reply on Jun 18, 2013 by Alex Smirnov
Branched to a new discussion

Hi folks,


could anybody help me please with ASRC support for audio playback in i.MX6q-based board.


I use LTIB Linux kernel as a reference and wrote a driver for DAC, which is connected to SSI2. The code is derived from sgtl5000 and cs42888 drivers. I've added 2 dai links with names: "HiFi" and "HiFi_ASRC". The first link assumes to play the stream with sample rate it has, and the second - should use ASRC. "HiFi" configuration works, when I start the following command:

$ aplay -D "hw:0,0" my.wav

I see a data at oscilloscope and hear sound. But when I try to use "HiFi_ASRC":

$ aplay -D "hw:0,1" my.wav

I get an I/O error after some timeout. Moreover I see about 4-5 SDMA interrupts only in 'cat /proc/interrupts' after each execution, while for the first case there are about 100.


In my base driver implementation I used the following ASRC configuration:

        config.input_word_width = get_asrc_input_width(params);
        config.output_word_width = iprtd->p2p->p2p_width;
        config.pair = iprtd->asrc_index;
        config.channel_num = channel;
        config.input_sample_rate = rate;
        config.output_sample_rate = iprtd->p2p->p2p_rate;
        config.inclk = INCLK_NONE;
        config.outclk = OUTCLK_SSI2_TX;

But also I tried to use different combinations of clocks for 'inclk' and 'outclk', but result was the same.


So I have several question and any hints are highly appreciated:

1. How ASRC works, does it require both clocks: input and output? According to the RM, it uses input clock to process samples, but how the output clock is involved to this process?

2. How "asrc_clk" and "asrc_serial_clk" are used, should I set some magic rate for them?

3. Lets say I have an input stream with sample rate 44.1KHz and I want to play it over SSI2 at 48KHz rate. Which clocks should I use? Should I manually setup input clock rate to: F = 44100 * WORD_SIZE * CHANNELS Hz?


Thank you!


With best regards,