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.

Acoustic Echo Removal for c6747

Hi,

I have installed the AER version 15.1.10.3 (We have been already approved for downloading this version- hence we got one). When I try to use the example code under packages\ti\mas\aer\test, I face with the following problems:

1. The function aerSendIn() where actually the AER is used is called nowhere in the example code aersim.c

2. I manually included aerSendIn() to the aersim.c (that is I included siu_tx_execute(inst) just before piuPcmIo is called- please see below). Then, inside siu_tx_execute(), when I tap out the near end signal, which is Fread into the FILE, sendIn in siutx.c (at aerSimFread(send_frm, sin_frm_len, sendIn)). FYI : sendIn = fopen(txin_file, "rb"); where txin_file = "C:/A/fe_16k.pcm";), the near end signal sounds a little bit fast - as if it is sampled at twice the rate. How to get this to sample correctly?

     siu_tx_execute(inst);


    stat = piuPcmIo (inst->piuInst, piu_segment_in, piu_segment_out);

4201.Test_AER_2_22_03_12.zip

I have attached the code herewith for your reference.

How to make the AER work for c6747?

Please help.

  • Hi Tharangini,

    Function aerSendIn() is called in siutx.c. Again, I suggest you looking into AER 16.0.0.1 for example code on how to integrate AER, as I said in another post - http://e2e.ti.com/support/embedded/multimedia_software_codecs/f/356/t/177248.aspx#640124.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    Thank you for your reply. I got the approval from TI today and I downloaded the AER ver 16.0.0.1. I opened the project in ccsv4, there were no compiler or linker errors; but the loader wouldnt load it(I can connect to target, but the "load program" is disabled(like greyed out). the following is the error I got when I select the "debug active project" option (when the AER project was made as the active project.

    "C674X_0: Loader: One or more sections of your program falls into a memory region that is not writable.  These regions will not actually be written to the target.  Check your linker configuration and/or memory map."

  • Hi Tharangini,

    You'll need to modify the linker command file for the specific platform on which you'll be running the executable. The linker command file is: aer_c64Px_obj_16_0_0_1\packages\ti\mas\aer\test\lnkr\c64Ple\aertest_c64Ple.cmd. This file is good only for TCI6482 DSK or C64x+ simulator. The executable aertest_c64Ple.x64P can run on C674x platform, but the memory map must match with aertest_c64Ple.cmd.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    I have pasted( below) the contents of the aertest_c64Ple.cmd. Could you pls let me know which registers/lines need to be changed?

    /******************************************************************************
     * AERTEST_64P.CMD - LINKER COMMAND FILE FOR LINKING C64x+ C PROGRAMS
     *
     * (C) Copyright 2008, Texas Instruments, Inc.
     *****************************************************************************/

    -c
    -heap  0x4000
    -stack 0x800


    MEMORY
    {
        EXT_MEM0 : origin = 0xE0000000, length = 0x00000800
        EXT_MEM1 : origin = 0xE0000800, length = 0x0002F800
        EXT_MEM2 : origin = 0xE0030000, length = 0x00030000
        EXT_MEM3 : origin = 0xE0060000, length = 0x00040000
        EXT_MEM4 : origin = 0xE00a0000, length = 0x00000800
        EXT_MEM5 : origin = 0xE00a0800, length = 0x00000800
        EXT_MEM6 : origin = 0xE00a1000, length = 0x00000800
    }

    SECTIONS
    {
        .aerrxtext    > EXT_MEM2
        {
          ../../aer/c64P/aer_c.a64P (.text:_aerReceiveIn)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_hlc)
          ../../aer/c64P/aer_c.a64P (.text:_aer_hlc_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_hlc_power_calc)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bandsplit_rx)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_rx_nlp_hi)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_rx_nlp)
          ../../aer/c64P/aer_c.a64P (.text:_aer_process_receive_frame)
          ../../aer/c64P/aer_c.a64P (.text:_drc_gain_dB2Lin)      
          ../../aer/c64P/aer_c.a64P (.text:_drc_powlev_est)
          ../../aer/c64P/aer_c.a64P (.text:_drc_gain_table_gen)
          ../../aer/c64P/aer_c.a64P (.text:_drc_gaindB_est)
          ../../aer/c64P/aer_c.a64P (.text:_drc_gain_exp_avg)
          ../../aer/c64P/aer_c.a64P (.text:_drc_gain_application)
          ../../aer/c64P/aer_c.a64P (.text:_drc_compcore_process)
          ../../aer/c64P/aer_c.a64P (.text:_drc_limiter_gaindB_est)
          ../../aer/c64P/aer_c.a64P (.text:_drc_limiter_process)    
          ../../aer/c64P/aer_c.a64P (.text:_drcProcess)             
        }

        .aercomtext    > EXT_MEM2
        {
          ../../aer/c64P/aer_c.a64P (.text:_aer_equalize_signal)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_eq_filter)
          ../../util/c64P/util_c.a64P <util.o64P>(.text)
          ../../util/c64P/util_c.a64P <utillin2db.o64P>(.text)
          ../../util/c64P/util_c.a64P <utildb2lin.o64P>(.text)
          ../../aer/c64P/aer_c.a64P (.text:_aer_abs_ovf)
          ../../aer/c64P/aer_c.a64P (.text:_aer_MulDivLFbyP2)
          ../../aer/c64P/aer_c.a64P (.text:_aer_power)
          ../../aer/c64P/aer_c.a64P (.text:_aer_LF2LF_dQS)
          ../../aer/c64P/aer_c.a64P (.text:_aer_txrx_tdnlp)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bs_dlowpass)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bs_downsample)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_dg_gain)
          ../../aer/c64P/aer_c.a64P (.text:_aer_txrx_path_select_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_dominance_parameters)
          ../../aer/c64P/aer_c.a64P (.text:_aer_txrx_nlp_path_select_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_noise_pwr_tc)
          ../../aer/c64P/aer_c.a64P (.text:_aer_upd_noise_and_total_powers)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bs_ilowpass)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bs_upsample)
          ../../aer/c64P/aer_c.a64P (.text:_aer_gain_convert)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_eqbq_lphp)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_eqbq_bpbs)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_eqbq_process)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_level_dBm2lin)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_atten_dB2lin)      
          ../../aer/c64P/aer_c.a64P (.text:_utlVecLin2dBPower)      
          
        }
        
        .aertxtext    > EXT_MEM2
        {
          ../../aer/c64P/aer_c.a64P (.text:_aer_fft)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fft_post_process)
          ../../aer/c64P/aer_c.a64P (.text:_aer_ifft_pre_process)
          ../../aer/c64P/aer_c.a64P (.text:_aer_ifft_post_process)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fft_io_round)
          ../../aer/c64P/aer_a.a64P <aerfft32x32_sa.o64P> (.text)
          ../../aer/c64P/aer_c.a64P (.text:_aer_get_maxabs_value)
          ../../aer/c64P/aer_c.a64P (.text:_aerSendIn)
          ../../aer/c64P/aer_c.a64P (.text:_aer_nguard_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_set_nguard_atten)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_nguard_atten)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_nguard_estimates)
          ../../aer/c64P/aer_c.a64P (.text:_aer_create_status_report)
          ../../aer/c64P/aer_c.a64P (.text:_aer_handle_tx_saturation)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fsm_update_control)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bandsplit_txin)
          ../../aer/c64P/aer_c.a64P (.text:_aer_bandsplit_rxout)
          ../../aer/c64P/aer_c.a64P (.text:_aer_echo_remove)
          ../../aer/c64P/aer_c.a64P (.text:_aer_handle_saturation_event)
          ../../aer/c64P/aer_c.a64P (.text:_aer_sendin_normal_process)
          ../../aer/c64P/aer_c.a64P (.text:_aer_apply_tx_nlp)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_full_echo_power)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_residual_echo_power)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_tx_clip_level_fd)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_tx_clip_level)
          ../../aer/c64P/aer_c.a64P (.text:_aer_constrain_pure_tx_powers)
          ../../aer/c64P/aer_c.a64P (.text:_aer_dt_nlp_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_nlp_split_gain)
          ../../aer/c64P/aer_c.a64P (.text:_aer_process_send_frame_hi)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_ERL_estimate)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_canc_stats)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fead_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_filter_update_control)
          ../../aer/c64P/aer_c.a64P (.text:_aer_get_filt_coh_upd_control)
          ../../aer/c64P/aer_c.a64P (.text:_aer_nead_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_rx_nld_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_sud_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_filter_converge_rate)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_mic2spk_pwr_ratio)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_state_machines)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_clip_from_res_echo)
          ../../aer/c64P/aer_c.a64P (.text:_aer_filter_upd_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_filter_update)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_buffer_usage)
          ../../aer/c64P/aer_c.a64P (.text:_aer_coherence_update)  
          ../../aer/c64P/aer_c.a64P (.text:_aer_coh_calc_hup)  
          ../../aer/c64P/aer_c.a64P (.text:_aer_coh_calc_s)  
          ../../aer/c64P/aer_c.a64P (.text:_aer_coherence_detect_full_fsm)  
          ../../aer/c64P/aer_c.a64P (.text:_aer_coherence_detect_partial_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_howling_detect_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_canc_log_upd_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_nlp_linear_atten)
          ../../aer/c64P/aer_c.a64P (.text:_aer_tx_nlp_path_select_fsm)
          ../../aer/c64P/aer_c.a64P (.text:_aer_tx_fdnlp)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_fft_win)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_unit_vec)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_Xpow_calc)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_noise_est)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_clip_gain_calc)
          ../../aer/c64P/aer_c.a64P (.text:_aer_vec_sin_cos)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_clip_dB2lin)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_apply_gain)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_cng)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_gain_ramp)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_ifft_win)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_vad)
          ../../aer/c64P/aer_c.a64P (.text:_aer_fdnlp_fft_scale)
          ../../aer/c64P/aer_c.a64P (.text:_aer_hb_fdnlp_delay)
          ../../aer/c64P/aer_c.a64P (.text:_aer_nr_thr_glim)
          ../../aer/c64P/aer_c.a64P (.text:_aer_nr_wiener)
          ../../aer/c64P/aer_c.a64P (.text:_aer_nr_noise_upd)
          ../../aer/c64P/aer_c.a64P (.text:_aer_sqrt)
          ../../aer/c64P/aer_c.a64P (.text:_aer_tx_reconstruct)
          ../../aer/c64P/aer_c.a64P (.text:_aer_proc_tx_eq_sat)
          ../../aer/c64P/aer_c.a64P (.text:_aer_compute_tx_clip_level_hd)
          ../../aer/c64P/aer_c.a64P (.text:_aer_core_process_send_frame)
          
          ../../aer/c64P/aer_c.a64P (.text:_agc_micgain_chg)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_rxout_tone_det)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_avg_txrx_pwr)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_update_avg_pwr_ratio)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_tone_det_num)      
          ../../aer/c64P/aer_c.a64P (.text:_aer_bs_dlowpass_scl)      
          ../../aer/c64P/aer_c.a64P (.text:_agc_max_abssmpl)      
          ../../aer/c64P/aer_c.a64P (.text:_agc_process_send_frame)      
          ../../aer/c64P/aer_c.a64P (.text:_agc_saturation_detect)      
          ../../aer/c64P/aer_c.a64P (.text:_agcSendIn)
     
          
        }

        .stack      > EXT_MEM0

        .aer_inst align = 8   > EXT_MEM1
        {
          /* AER instance buffer */
          aerinstbuff.o64P (.far)
        }
        .agc_inst align = 8   > EXT_MEM1
        {
          /* AGC instance buffer */
          agcinstbuff.o64P (.far)
        }
        .aer_work align = 8   > EXT_MEM1
        {
          /* AER fft work buffer */
          aerworkb.o64P (.far)
        }
        .aer_h align = 8   > EXT_MEM1
        {
          /* AER tail model (H) buffer */
          aerhbuff.o64P (.far)
        }
        .aer_x align = 8   > EXT_MEM1
        {
          /* AER X buffer */
          aerxbuff.o64P (.far)
        }
        .aer_norm align = 8   > EXT_MEM1
        {
          /* AER norm buffer */
          aernbuff.o64P (.far)
        }
        .aer_r align = 8   > EXT_MEM1
        {
          /* AER R buffer */
          aerrbuff.o64P (.far)
        }
        .aer_coh align = 8   > EXT_MEM1
        {
          /* AER coherence buffer */
          aerhupab.o64P (.far)
        }
        .aer_pow align = 8   > EXT_MEM1
        {
          /* AER power measurement buffer */
          aerpowbuff.o64P (.far)
        }
        .aer_hovf align = 8   > EXT_MEM1
        {
          /* AER H overflow buffer */
          aerhovfb.o64P (.far)
        }
        .aer_p align = 8   > EXT_MEM1
        {
          /* AER predicted echo and error buffer */
          aerpbuff.o64P (.far)
        }
        .aer_txeq_fil align = 8   > EXT_MEM1
        {
          /* parameters for tx equalizer */
          aertxeqfb.o64P (.far)
        }
        .aer_rxeq_fil align = 8   > EXT_MEM1
        {
          /* parameters for rx equalizer */
          aerrxeqfb.o64P (.far)
        }
        .aer_bs_del1 align = 8   > EXT_MEM1
        {
          /* parameters for tx/rx band split delay lines */
          aerbsdlb.o64P (.far)
        }
        .aer_bs_del2 align = 8   > EXT_MEM1
        {
          /* parameters for tx/rx band split delay lines */
          aerbsdlb2.o64P (.far)
        }
        .aer_bs_scratch align = 8   > EXT_MEM1
        {
          /* parameters for rx and tx scratch */
          aerrxtxscratch.o64P (.far)
        }
        .aer_rx_bs_out align = 8    > EXT_MEM1
        {
          aerrxbsout.o64P (.far)
        }

        .aer_io align = 8   > EXT_MEM1
        {
          /* I/O buffer */
          aeriobuff.o64P (.far)
        }

        .aerdata    > EXT_MEM4
        {
          /* .far */
          ../../aer/c64P/aer_c.a64P <aerinit.o64P> (.far)
          ../../aer/c64P/aer_c.a64P <aerctx.o64P> (.far)
          ../../aer/c64P/aer_c.a64P <aercostb.o64P> (.far)
        }

        .agcdata    > EXT_MEM5
        {
          /* .far */
          ../../aer/c64P/aer_c.a64P <agcinit.o64P> (.far)
          ../../aer/c64P/aer_c.a64P <agcctx.o64P> (.far)
        }

        .drcdata    > EXT_MEM6
        {
          /* .far */
          ../../aer/c64P/aer_c.a64P <drcinit.o64P> (.far)
          ../../aer/c64P/aer_c.a64P <drc.o64P> (.far)
        }

        .aerswitch  > EXT_MEM2
        {
          /* .switch */
          ../../aer/c64P/aer_c.a64P <aer.o64P> (.switch)
          ../../aer/c64P/aer_c.a64P <aertx.o64P> (.switch)
          ../../aer/c64P/aer_c.a64P <aerrx.o64P> (.switch)
          ../../aer/c64P/aer_c.a64P <aerpathsm.o64P> (.switch)
          ../../aer/c64P/aer_c.a64P <agc.o64P> (.switch)
        }

          /* .const */
        .aerconst align = 8 > EXT_MEM2
        {
          ../../aer/c64P/aer_c.a64P <aerffttb.o64P> (.const)
          ../../aer/c64P/aer_c.a64P (.const)
          ../../util/c64P/util_c.a64P <utillin2db.o64P>(.const)
          ../../util/c64P/util_c.a64P <utildb2lin.o64P>(.const)
        }

        .drc_scratch_buf    > EXT_MEM1
        {
          drcinstbuff.o64P (.drc_scratch_buf)
        }

        .testdatadrc  > EXT_MEM1
        {
          drcinstbuff.o64P (.far)
        }

        .aertext2     > EXT_MEM2
        {
          ../../aer/c64P/aer_c.a64P (.text)
        }

        .sdktext    > EXT_MEM3
        {
          ../../sdk/c64P/sdk_c.a64P (.text)
        }
          
        .text       > EXT_MEM3
        {
          *(.text)
        }

        .testdata   > EXT_MEM3
        {
          *(.far)
        }

        .testconst   > EXT_MEM3
        {
          *(.const)
        }

        .testswitch   > EXT_MEM3
        {
          *(.switch)
        }

        .cinit      > EXT_MEM3
        .bss        > EXT_MEM3
        .data       > EXT_MEM3
        .sysmem     > EXT_MEM3
        .tables     > EXT_MEM3
        .cio        > EXT_MEM3
        AEPSEC      > EXT_MEM3      
    }


    ../../aer/c64P/aer_c.a64P
    ../../aer/c64P/aer_a.a64P
    ../../vpe/c64P/vpe_c.a64P
    ../../sdk/c64P/sdk_c.a64P
    ../../util/c64P/util_c.a64P
    ../../util/c64P/util_a.a64P
    ../../util/c64P/util_c.a64P

    Thanks.

  • Hi Tharangini,


    You need to modify the memory section definitions (see below) according to the memory map of your device.

    MEMORY
    {
        EXT_MEM0 : origin = 0xE0000000, length = 0x00000800
        EXT_MEM1 : origin = 0xE0000800, length = 0x0002F800
        EXT_MEM2 : origin = 0xE0030000, length = 0x00030000
        EXT_MEM3 : origin = 0xE0060000, length = 0x00040000
        EXT_MEM4 : origin = 0xE00a0000, length = 0x00000800
        EXT_MEM5 : origin = 0xE00a0800, length = 0x00000800
        EXT_MEM6 : origin = 0xE00a1000, length = 0x00000800
    }

    Specifically, find out the address of external memory. For example, if your external memory starts from 0x80000000, then you should have:

    MEMORY
    {
        EXT_MEM0 : origin = 0x80000000, length = 0x00000800
        EXT_MEM1 : origin = 0x80000800, length = 0x0002F800
        EXT_MEM2 : origin = 0x80030000, length = 0x00030000
        EXT_MEM3 : origin = 0x80060000, length = 0x00040000
        EXT_MEM4 : origin = 0x800a0000, length = 0x00000800
        EXT_MEM5 : origin = 0x800a0800, length = 0x00000800
        EXT_MEM6 : origin = 0x800a1000, length = 0x00000800
    }


    Regards,

    Jianzhong