WELCOME [ Log In · Register ]        SITE [ Search · Page Index · Recent Changes ]    RSS

 


Wanpipe How To

  1. How to reduce load by 70% (DAHDI Chunk size)
  2. How to take an audio recording from the hardware echo canceller
  3. How to know if the hardware echo canceller is being used

 


 

How to reduce load by 70% (DAHDI Chunk size


The following applies only for the following requirements:

-> using Dahdi or Zaptel with Sangoma T1/E1 PRI Cards
-> Sangoma Card MUST have Hardware Echo Cancellation, in order to be able to adjust dahdi chunk size
-> Not supported for Analog and T1/E1 E&M because Dahdi/zaptel hard code 8byte chunk size for Analog/RBS
    timing code

By default Zaptel/Dahdi runs with 8 byte chunk size.  This equates to 1ms interrupt on TDM hardware! This causes congestion on the PCI bus and overal creates a bottle neck.

The default 8byte chunk size exists because of the constraints of running software based echo cancellation that was originally designed into the dahdi/zaptel driver.  Since Sangoma Hardware introduces Hardware based Echo cancellation, this limitation is eliminated.

Sangoma hardware is able to automatically detect Dahdi/zaptel chunk size and adjust it accordingly.

One can configure Zaptel/Dahdi for 8bytes (1ms - default)- 16bytes (2ms) -  40byte (5ms)  or 80byte (10ms) chunk size.  This would drastically reduce number of hardware interrupts on your system and context switches (changes  from user space to kernel space).  Interrupts have to be handled whether calls are up or not, while context switching load depends on the number of active calls. and allow you to scale better with large number of ports.

To configure Dahdi/zaptel for higher chunk size

Zaptel ==>     ./Setup install --zap-chunk=<CHUNK SIZE>

Dahdi ==>     ./Setup install --dahdi-chunk=<CHUNK SIZE>

Where CHUNK SIZE:  8, 16 , 40 or 80
Setup will patch Zaptel/Dahdi source for selected chunk size and will remove wct4xxx (digium) driver out of zaptel Makefile.  Reason for this is that digium wct4xxx driver does not support any chunk size other than 8bytes (1ms).
Chunk size =40 is the maximum that gives reliable timing for meetme and music on hold.  However, if you want to go to the maximum (chunk size=80), the cards have alternate timer that can be used for meetme synchronization


Once Setup recompiles Dahdi/zaptel and wanpipe drivers.  There are no other configuration needed!  Just start wanpipe and Dahdi/zaptel and Asterisk:

  1. wanrouter start
  2. dahdi_cfg -vvv / ztcfg -vvv
  3. asterisk
  4. asterisk -r

In order to confirm that you are running with new Dahdi/zaptel chunk size.  run:

  1. ifconfig w1g1
    -> confirm that MTU = configured chunk size  (8, 16, 40, 80) 

 


 

How to take an audio recording from the hardware echo canceller 


 Follow the instructions below how to take a binary audio recording from the Echo cancellor chip, if you are experiencing these symptoms:
-> Echo/noise
-> DTMF issues
-> one-way audio issues


The hardware echo canceler chip has a debug feature where a DEBUG Monitor will capture chip debug data during active calls. The captured debug binary file can be sent to Sangoma for further processing and analysis.

Below is a block diagram of how the audio is processed during a call (rx and tx read and write)


binary_recording.jpg


Sangoma Support will analyze the Rin/Rout, Sin/Sout audio streams from the binary recording
* Note: if using FreeSWITCH, make sure to use the CLI command: "ftdm trace" to take audio recording from Freetdm point of view, to compare the Tx and Rx audio from FreeSWITCH with that of the hardware echo canceller
 

Before proceeding you should also confirm that Is my Hardware echo canceller running (for Asterisk)?    

  1. Establish a call that has an echo, noise, dtmf, or one-way audio problem  
  2. Determine the call channel number by running "show channels" on Asterisk/FreeSWITCH CLI:      
    CLI> show channels   
  3. Run a echo canceler debug utility on that channel (15 sec recording)

    #>wan_ec_client wanpipe1 monitor <channel number>
         
          Where <channel number> is a channel number obtained in step 2.  
          The above command will record for 15 seconds and then stop.
           The wan_ec_client will write a binary file in your local directory.  
  4.  To record for 2 mintues run

    #> wan_ec_client wanpipe1 monitor120 <channel number>

          Where <channel number> is a channel number obtained in step 2.  
          The above command will record for 120 seconds and then stop.
          The wan_ec_client will write a binary file in your local directory.

     6.  Send the binary file back to techdesk@sangoma.com

 

 For A500 [pre Wanpipe 3.5.21]

  1. Determine which Wanpipe number and channel number the call is using with the aid of the following link:  
    HOW TO DETERMINE SPAN AND CHANNEL on A500 (Asterisk related)  
  2. Start the echo canceler monitoring tool by executing
    #> wan_ec_client wanpipeX monitor Y
    (where X is the wanpipe number and Y is the channel number found in step 1) from the Linux Command prompt.  
  3. Keep the call active for at least 1 minute (2 minutes is better) by having a normal conversation (the weather is always a fun topic).  You should here echo on the local phone.  
  4. Stop the monitoring tool and create a binary file of the audio by running the command
    #> wan_ec_client wanpipeX monitor
    (where X is the wanpipe number found in step 1).  This will take a second or so.  
  5. The binary recording will be saved to the current working directory with the date and channel number in the title.  
  6. Send the binary file back to techdesk@sangoma.com

 


 

How to know if the hardware echo canceller is being used

 

  1. Verify that your Sangoma card has hardware echo cancellation
    -> type: wanrouter hwprobe

    at the end of the output if you see:
    HWEC=0  <---no hardware echo cancellor
    HWEC= <anything not 0>    <---you have hardware echo cancellation

    Example of "wanrouter hwprobe" for card with Hardware echo cancellation:
    -------------------------------
    | Wanpipe Hardware Probe Info |
    -------------------------------
    1 . AFT-A108-SH : SLOT=1 : BUS=5 : IRQ=17 : CPU=A : PORT=1 : HWEC=256 : V=43
    2 . AFT-A108-SH : SLOT=1 : BUS=5 : IRQ=17 : CPU=A : PORT=2 : HWEC=256 : V=43
    3 . AFT-A108-SH : SLOT=1 : BUS=5 : IRQ=17 : CPU=A : PORT=3 : HWEC=256 : V=43
    4 . AFT-A108-SH : SLOT=1 : BUS=5 : IRQ=17 : CPU=A : PORT=4 : HWEC=256 : V=43

  2. type: wanpipemon -i wXg1 -c ehw   (where X=1,2,3..for interface. ie w1g1)

    If your hardware echo cancellor is activated and being used, the output should show the following for all your channels:

    # wanpipemon -i w1g1 -c ehw

    Sangoma HW Echo Canceller is enabled for channel 2
    Sangoma HW Echo Canceller is enabled for channel 3
    Sangoma HW Echo Canceller is enabled for channel 4
    .....

    If your Sangoma card DOES have hardware echo cancellation and you see:

             Sangoma HW Echo Canceller is disabled for all channels!

This means hardware echo cancellation is disabled, not used
so,
-> vi /etc/wanpipe/wanpipeX.conf   (replace X with 1,2,3,4...)
-> verify near the end of each file TDMV_HWEC= YES:
     [w1g1]
     ACTIVE_CH       = ALL
     TDMV_HWEC       = YES
     MTU             = 8

-> If TDMV_HWEC=NO, change to YES, then restart wanpipe, "wanrouter restart" (make sure Asterisk/FreeSWITCH is stopped first)
-> If TDMV_HWEC=YES and you still have this issue, restart wanpipe:
    -> wanrouter restart   (make sure Asterisk/FreeSWITCH is stopped first)
-> run wanpipemon -i wXg1 -c ehw again and see if issue is resolved
    -> if issue not resolved, please contact Sangoma Technical Support
   

For Customers using Asterisk and Dahdi:
-> If wanpipemon -i wXg1 -c ehw indicates echo cancellation is enabled, Dahdi software echo cancellation is NOT used. Disregard the MG2/OSLEC information in /etc/dahdi/system.conf:

       #Sangoma A104 port 1 [slot:1 bus:7 span:1] <wanpipe1>
         span=1,1,0,esf,b8zs
         bchan=1-23
         echocanceller=mg2,1-23
         hardhdlc=24

Dahdi software echo cancellation is only enabled if Sangoma Hardware echo cancellation is disabled/not present.  Asterisk/Dahdi checks to see if Sangoma card has hardware echo cancellation.  If it does, Asterisk/Dahdi uses Hardware echo cancellation and disabled software echo cancellation.  It cannot run both hardware and software echo cancellation at the same time. 

A further check to verify software echo cancellation is not being used:

-> During a call (with wanrouter started of course), run the following command:
    -> lsdahdi

The above command will indicate the live status of Dahdi's software echo cancellation for each channel
The following is an example of "lsdahdi" during a call for a Sangoma card WITH hardware echo cancellation enabled:

## Span  1: WPT1/0 "wanpipe1 card 0" B8ZS/ESF
  1 PRI        Clear       (In use) (EC: MG2 - INACTIVE)
  2 PRI        Clear       (In use) (EC: MG2 - INACTIVE)
  3 PRI        Clear       (In use) (EC: MG2 - INACTIVE)
  4 PRI        Clear       (In use) (EC: MG2 - INACTIVE)

If software echo cancellation was enabled and being used instead of Hardware echo cancellation, the above output would have indicated:
-> (EC: MG2 - ACTIVE)