Audio Choppiness Both I/O

For a while now I have been getting choppy audio both during recording and playback. Im looking for any ideas or suggestions. I cant for the life of me figure this out. Ill edit the post with more as I think of it.

Heres all the information ive collected:

  • Quad Core CPU with 64GB RAM with 1GB ETH (Debian GNU/Linux 9.5 (stretch))
  • Calls peak around 100.
  • Load average is about 1.5 with ~100 calls and < 1 normally as calls average around ~60.
  • I have tried 4 different versions of asterisk now with the same problems
  • Current version: Asterisk certified/13.21-cert2
  • I have performed hours of RAM checks to see if any errors occured. There were none.
  • I have been monitoring the disk (8TB Helium) and have had no errors.
  • I have 16GB of Swap assigned but its not being used.
  • This issue happens on both VoiP and PRI (using both in my system)
  • Ive tried all 3 different timing modules and am currently using
  • I have dramatically reduced the number of modules loaded (see below for list)
  • Using ulaw codec.
# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 590212 1744836 27748772    0    0   213   255    2    0  9  9 81  1  0

Current Timing Module

Module                         Description                              Use Count  Status      Support Level          Timerfd Timing Interface                 161        Running              core
1 modules loaded

Currently loaded modules:

Module                         Description                              Use Count  Status      Support Level                 Listen to the audio of an active channel 0          Running              core              Conference Bridge Application            40         Running              core         Control Playback Application             0          Running              core                    Dialing Application                      0          Running              core               Extension Directory                      0          Running              core                    Simple Echo Application                  0          Running              core                   Extension Macros                         0          Running              core              Mixed Audio Monitoring Application       13         Running              core                    Page Multiple Phones                     0          Running              core                Sound File Playback Application          4          Running              core                Send DTMF digits Application             0          Running              core                   Dialplan subroutines (Gosub, Return, etc 0          Running              core                Transfers a caller to another extension  0          Running              core                 Send verbose output                      0          Running              core     Built in bridging features               1          Running              core               Simple two channel bridging module       0          Running              core              Multi-party software based channel mixin 18         Running              core                  DAHDI Telephony w/PRI                    6          Running              core                    Session Initiation Protocol (SIP)        51         Running              core                   GSM Coder/Decoder                        0          Running              core                  mu-Law Coder/Decoder                     316        Running              core                  Raw GSM data                             0          Running              core                  Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU), G. 0          Running              core                  Microsoft WAV/WAV16 format (8kHz/16kHz S 40         Running              core               Party ID related dialplan functions (Cal 0          Running              core                Channel information dialplan functions   0          Running              core               Dialplan Context/Extension/Priority Chec 0          Running              core          Periodic dialplan hooks.                 1          Running              core                 Technology independent volume control    0          Running              core                  Text Extension Configuration             0          Running              core                   Outgoing Spool Support                   0          Running              core                     Asterisk Gateway Interface (AGI)         59         Running              core                     Asterisk RESTful Interface               0          Running              core                  Cryptographic Digital Signatures         1          Running              core                     Generic FAX Applications                 1          Running              core             Spandsp G.711 and T.38 FAX Technologies  0          Running          extended                 Call Monitoring Resource                 1          Running              core             Music On Hold Resource                   12         Running              core            Asterisk RTP Stack                       52         Running              core                    Simplified Message Desk Interface (SMDI) 1          Running              core          Sorcery Configuration File Object Wizard 0          Running              core                  Generic Speech Recognition API           0          Running              core                  Stasis application support               0          Running              core          Timerfd Timing Interface                 173        Running              core




channel => 1-24

Something else I noticed:

After restarting Asterisk things seem OK for ~72 hours and then degradation starts to happen and I have the audio problems.

Not sure if that helps generate some ideas or advice.

It suggests some sort of resource leak, so look at memory, in particular, to see if something is hogging RAM. Choppiness might be the result of thrashing the page file.

I’m not seeing any RAM issues. Plenty available and swap is hardly ever used.

Can I bring this theme up again? I have same issue word-to-word. Can’t find any solution.
My specifications are:
Linux 3.10.0-693.17.1.el7.x86_64
Asterisk 13.19.0
Lenovo server, 48 cores, 125G RAM, fast storage. asterisk starts to chop and chew any audio (even while calling IVR from local phones). If I fwconsole restart (FreePBX is my distro for now) - all’s great till some time passes by and for no visible cause it starts to chop and chew again.

Current state: chopping, chewing, dropping some seconds
Current overhead: 176 threads and 56% CPU (according to atop), 20.7 G. RAM

Network is not an issue. For now I have direct copper link between my server and my Yealink. For testing purposes.

Asterisk 13 is no longer supported, and 13.19.0 is not the end of life version of Asterisk 13.

fwconsole is part of FreePBX, which is not supported here. IVRs are a FreePBX abstraction on top of Asterisk.

chan_sip was deprecated from Asterisk 17, isn’t supported by anyone, and will be removed next year.

Are you really dedicating all of this machine just to Asterisk?

As you said your situation was exactly the same, in spite of being a different OS and Asterisk version, I’ll add the following paragraphs, however, basically you should start a new thread, probably on the FreePBX forum, and provide all your evidence. You can then link to this thread, but your new thread should stand without it.

Setting insecure=invite in the general section is a very bad idea. Both nat= and insecure=port are heavily overused.

Using jitter buffers are SIP Is unusual. The phone or PSTN gateway should do this.

Just a note for this old issue of mine (if it matters)…

The choppiness was due to the networking at the provider. Since moving to OVH Cloud I have not had any issues.