This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Audio mixing in McASP with OMAP-L13x

Other Parts Discussed in Thread: OMAPL138, MATHLIB

Anyone know where I would start learning code to mix audio channels from McASP.

I have the PDK demo version of McASP audio passthrough working.

Does anyone have example code of something like this working with McASP already I could take a look at?

// 5 channel mixer algorithm in 32 bit without clipping ?

#define     c1   0x19999999        // c1 = 0.2
#define     c2   0x0CCCCCCC    // c2 = 0.1
#define     c3   0x26666666        // c3 = 0.3
#define     c4   0x06666666        // c4 = 0.05
#define     c5   0x39999999        // c5 = 0.45  


// somewhere inside McASP Receive Interrupt Service Routine????


// copy input samples from channels //

r1 = dm(channel_1);    {audio channel 1 input sample}
r2 = dm(channel_2);    {audio channel 2 input sample}
r3 = dm(channel_3);    {audio channel 2 input sample}
r4 = dm(channel_4);    {audio channel 2 input sample}
r5 = dm(channel_5);    {audio channel 2 input sample}

r6 = c1;
mrf = r6 * r1 (ssf);          {mrf = c1*x1}

r7 = c2;
mrf = mrf + r7 * r2 (ssf);    {mrf = c1*x1 + c2*x2}

r8 = c3;
mrf = mrf + r4 * r2 (ssfr);   {mrf = c1*x1 + c2*x2 + c3*x3}

r9 = c4;
mrf = mrf + r4 * r2 (ssfr);    {mrf = c1*x1 + c2*x2 + c3*x3 + c4*x4}

r10 = c5;
mrf = mrf + r4 * r2 (ssfr);    {mrf = y= c1*x1 + c2*x2 + c3*x3 + c4*x4 + c5*x5}


mrf = sat mrf;    /// What is SAT ? what is this doing ?? also what is ssf and ssfr timing or frames ???



// copy mixed channels to both left and right channels ready to go to balance mix code…?


r0 = mrf;       /// was written as mr1f  ,, must have been a typo?? changed to mrf

dm(left_output) = r0; {left output sample}
dm(right_output) = r0; {right output sample}

  • Hi,

    Thanks for your post.

    I don't think, there are readily available examples for audio mixing through McASP with OMAPL138. May be, you could start with OMAPL138 starterware LCDK examples to experiment biometric demos like facedetect  demo. Please check the below wiki resources to start with OMAPL138:

    http://processors.wiki.ti.com/index.php/L138/C6748_Development_Kit_(LCDK)

    You could download the starterware package and try experimenting available examples: www.ti.com/.../starterware-dsparm

    Alternatively, you could try downloading DSP LIB and MATHLIB to explore signal processing routines available that are used in computationally-intensive real-time applications:

    http://software-dl.ti.com/sdoemb/sdoemb_public_sw/dsplib/latest/index_FDS.html

    http://www.ti.com/tool/mathlib

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hi,

    I found some maths functions I could use in mathlib that could maybe add divide audio samples in real time.

    I'll try compile the library into McASP example and call the functions.

    If that doesn't work I'll try and load the face detection example and see how either the mathlib or DSPlib are being used there.

    I found where the samples get copied in the McASP PDK example so maybe I can try adding some math functions in there as a test.


    Anyway, if anyone has any  example code of audio mixing / volume control attenuation working with McASP they wouldn't mind sharing that would be much appreciated.

    ben