Patch to enable SSI Master Mode when using ASRC_P2P function based on Kernel 3.0.35 for I.MX6DL/DQ SebreSD boards

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Patch to enable SSI Master Mode when using ASRC_P2P function based on Kernel 3.0.35 for I.MX6DL/DQ SebreSD boards

Patch to enable SSI Master Mode when using ASRC_P2P function based on Kernel 3.0.35 for I.MX6DL/DQ SebreSD boards

When using SSI Slave Mode for ASRC_P2P function (https://community.freescale.com/docs/DOC-95342), the waveform of the converted 24bit data is abnormal(have some values between 0 and 1). When using SSI Master Mode, these abnormal data disappear. This patch shows how to enable SSI Master Mode based on ASRC_P2P patches.

Because SSI Master Mode uses fixed data width for LRCLK(32bits for each L or R), and the SSI Dual FIFO Mode is not supported for ASRC_P2P, the converted 16bit data is not well supported in this patch.

Suggestions:

If you want to convert the audio data to 16bit, you can use SSI Slave Mode; if you want to convert the audio data to 24bit, you can use SSI Master Mode.

Attachments
Comments

good patch

_at

Hi Lei Ge,

I had used above patch. It is for Normal Audio Playback (ASRC added in between PLAYBACK path & uses only one OUT CLK source i.e OUTCLK_SSI2_TX while IN CLK source is INCLK_NONE) and working perfectly fine!.

Now, I want to use ASRC in between Recording Path.I had tried following setup (taking above patch for reference):

1.  Request DMA channel for P2P:

        - DMA Request-SSI RX0

        - P2P DMA request-ASRC RX1

    Configured abvoe channel as Slave DMA channel. Input src is SSI-1 RX0, output dst is ASRC RX1 & direction is DMA_DEV_TO_DEV

   

2.  Request DMA channel for P2M:

        - DMA request-ASRC TX1

    Configured abvoe channel as Slave DMA channel. Input src is ASRC TX1, output dst is MEMORY & direction is DMA_FROM_DEV

   

SSI is configured as SLAVE I2S device.

Configuratin of ASRC:

    config.input_word_width = ASRC_WIDTH_24_BIT;

    config.output_word_width = ASRC_WIDTH_24_BIT;

    config.pair = iprtd->asrc_index; [ASRC_PAIR_A]

    config.channel_num = channel;    [2]  

    config.input_sample_rate = 48000;   

    config.output_sample_rate = 44100;

    config.inclk = INCLK_SSI1_RX;       [clk coming from SSI RX & its slave device]

    config.outclk = OUTCLK_SSI2_TX;     [clk coming from playback codec, SSI is master I2S (same as above patch)]

I had verified that both clock coming to ASRC.

My Result:

I received 'blank' data from MEMORY

Can you help me out, why i received 'blank' data. Or something is missing in above setup.

-Ankit.   

_at

Hello All,

Found the solution: Configure SSI-1  & AUDMUX's ports to ASYNC MODE. Otherwise, SSI-1 never get clock on SRCK.

-Ankit.

Can you attach or share the patch in community?

_at

Hi Lei Ge,

I am attaching patch at following locatin Audio LOST after ~10 hrs on i.MX 6Q for your reference. Please review it & give comments upon it.

Now, We got Audio lost after ~10 hrs after this attached patch. Issue explained in above link.

Note:

- We able to play smoothly till 10 hrs.

_at

Hi Lei Ge,

Can you please give a comments over last attached patch here-Audio LOST after ~10 hrs on i.MX 6Q?

-Ankit.

%3CLINGO-SUB%20id%3D%22lingo-sub-1122599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPatch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20using%20SSI%20Slave%20Mode%20for%20ASRC_P2P%20function%20(%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-95342%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.freescale.com%2Fdocs%2FDOC-95342%3C%2FA%3E)%2C%20the%20waveform%20of%20the%20converted%2024bit%20data%20is%20abnormal(have%20some%20values%20between%200%20and%201).%20When%20using%20SSI%20Master%20Mode%2C%20these%20abnormal%20data%20disappear.%20This%20patch%20shows%20how%20to%20enable%20SSI%20Master%20Mode%20based%20on%20ASRC_P2P%20patches.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBecause%20SSI%20Master%20Mode%20uses%20fixed%20data%20width%20for%20LRCLK(32bits%20for%20each%20L%20or%20R)%2C%20and%20the%20SSI%20Dual%20FIFO%20Mode%20is%20not%20supported%20for%20ASRC_P2P%2C%20the%20converted%2016bit%20data%20is%20not%20well%20supported%20in%20this%20patch.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESuggestions%3A%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20convert%20the%20audio%20data%20to%2016bit%2C%20you%20can%20use%20SSI%20Slave%20Mode%3B%20if%20you%20want%20to%20convert%20the%20audio%20data%20to%2024bit%2C%20you%20can%20use%20SSI%20Master%20Mode.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1122599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20using%20SSI%20Slave%20Mode%20for%20ASRC_P2P%20function%20(%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-95342%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.freescale.com%2Fdocs%2FDOC-95342%3C%2FA%3E)%2C%20the%20waveform%20of%20the%20converted%2024bit%20data%20is%20abnormal(have%20some%20values%20between%200%20and%201).%20When%20using%20SSI%20Master%20Mode%2C%20these%20abnormal%20data%20disappear.%20This%20patch%20shows%20how%20to%20enable%20SSI%20Master%20Mode%20based%20on%20ASRC_P2P%20patches.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBecause%20SSI%20Master%20Mode%20uses%20fixed%20data%20width%20for%20LRCLK(32bits%20for%20each%20L%20or%20R)%2C%20and%20the%20SSI%20Dual%20FIFO%20Mode%20is%20not%20supported%20for%20ASRC_P2P%2C%20the%20converted%2016bit%20data%20is%20not%20well%20supported%20in%20this%20patch.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESuggestions%3A%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20convert%20the%20audio%20data%20to%2016bit%2C%20you%20can%20use%20SSI%20Slave%20Mode%3B%20if%20you%20want%20to%20convert%20the%20audio%20data%20to%2024bit%2C%20you%20can%20use%20SSI%20Master%20Mode.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1122605%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Patch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122605%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Lei%20Ge%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ECan%20you%20please%20give%20a%20comments%20over%20last%20attached%20patch%20here-%3CA%20_jive_internal%3D%22true%22%20data-containerid%3D%222004%22%20data-containertype%3D%2214%22%20data-objectid%3D%22380162%22%20data-objecttype%3D%222%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fmessage%2F380162%23380162%22%20onclick%3D%22%22%20target%3D%22_blank%22%3EAudio%20LOST%20after%20~10%20hrs%20on%20i.MX%206Q%3C%2FA%3E%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E-Ankit.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1122604%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Patch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122604%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Lei%20Ge%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20am%20attaching%20patch%20at%20following%20locatin%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fmessage%2F380162%22%20target%3D%22_blank%22%3EAudio%20LOST%20after%20~10%20hrs%20on%20i.MX%206Q%3C%2FA%3E%20for%20your%20reference.%20Please%20review%20it%20%26amp%3B%20give%20comments%20upon%20it.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ENow%2C%20We%20got%20Audio%20lost%20after%20~10%20hrs%20after%20this%20attached%20patch.%20Issue%20explained%20in%20above%20link.%3C%2FP%3E%3CP%3ENote%3A%3C%2FP%3E%3CP%3E-%20We%20able%20to%20play%20smoothly%20till%2010%20hrs.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1122603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Patch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECan%20you%20attach%20or%20share%20the%20patch%20in%20community%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1122602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Patch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EFound%20the%20solution%3A%20Configure%20SSI-1%26nbsp%3B%20%26amp%3B%20AUDMUX's%20ports%20to%20ASYNC%20MODE.%20Otherwise%2C%20SSI-1%20never%20get%20clock%20on%20SRCK.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E-Ankit.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1122601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Patch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Lei%20Ge%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20had%20used%20above%20patch.%20It%20is%20for%20Normal%20Audio%20Playback%20(ASRC%20added%20in%20between%20PLAYBACK%20path%20%26amp%3B%20uses%20only%20one%20OUT%20CLK%20source%20i.e%20OUTCLK_SSI2_TX%20while%20IN%20CLK%20source%20is%20INCLK_NONE)%20and%20working%20perfectly%20fine!.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ENow%2C%20I%20want%20to%20use%20ASRC%20in%20between%20Recording%20Path.I%20had%20tried%20following%20setup%20(taking%20above%20patch%20for%20reference)%3A%3C%2FP%3E%3CP%3E1.%26nbsp%3B%20Request%20DMA%20channel%20for%20P2P%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20DMA%20Request-SSI%20RX0%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20P2P%20DMA%20request-ASRC%20RX1%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Configured%20abvoe%20channel%20as%20Slave%20DMA%20channel.%20Input%20src%20is%20SSI-1%20RX0%2C%20output%20dst%20is%20ASRC%20RX1%20%26amp%3B%20direction%20is%20DMA_DEV_TO_DEV%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3CP%3E2.%26nbsp%3B%20Request%20DMA%20channel%20for%20P2M%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20DMA%20request-ASRC%20TX1%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Configured%20abvoe%20channel%20as%20Slave%20DMA%20channel.%20Input%20src%20is%20ASRC%20TX1%2C%20output%20dst%20is%20MEMORY%20%26amp%3B%20direction%20is%20DMA_FROM_DEV%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3CP%3ESSI%20is%20configured%20as%20SLAVE%20I2S%20device.%20%3C%2FP%3E%3CP%3EConfiguratin%20of%20ASRC%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.input_word_width%20%3D%20ASRC_WIDTH_24_BIT%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.output_word_width%20%3D%20ASRC_WIDTH_24_BIT%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.pair%20%3D%20iprtd-%26gt%3Basrc_index%3B%20%5BASRC_PAIR_A%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.channel_num%20%3D%20channel%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%5B2%5D%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.input_sample_rate%20%3D%2048000%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.output_sample_rate%20%3D%2044100%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.inclk%20%3D%20INCLK_SSI1_RX%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%5Bclk%20coming%20from%20SSI%20RX%20%26amp%3B%20its%20slave%20device%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20config.outclk%20%3D%20OUTCLK_SSI2_TX%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%5Bclk%20coming%20from%20playback%20codec%2C%20SSI%20is%20master%20I2S%20(same%20as%20above%20patch)%5D%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20had%20verified%20that%20both%20clock%20coming%20to%20ASRC.%3C%2FP%3E%3CP%3EMy%20Result%3A%3C%2FP%3E%3CP%3EI%20received%20'blank'%20data%20from%20MEMORY%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ECan%20you%20help%20me%20out%2C%20why%20i%20received%20'blank'%20data.%20Or%20something%20is%20missing%20in%20above%20setup.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E-Ankit.%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1122600%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Patch%20to%20enable%20SSI%20Master%20Mode%20when%20using%20ASRC_P2P%20function%20based%20on%20Kernel%203.0.35%20for%20I.MX6DL%2FDQ%20SebreSD%20boards%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122600%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Egood%20patch%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎08-06-2013 10:56 PM
Updated by: