Choppy audio on a phone system: jitter, loss and the network
Choppy audio on a phone system means that some of the packets that carry the voice are late, out of order or missing, so the listener hears gaps, clicks, a robotic voice or words that run together. The cause is usually in the network between the two ends, and sometimes in the machine running the phone system. This guide shows how to tell which, how to measure it and what to change first.
What choppy audio is
A call's audio travels as small packets, usually fifty a second. The receiving end holds them for a moment in a jitter buffer and plays them out evenly. Three things spoil that:
- Loss. A packet that never arrives leaves a gap, which the codec hides if it can.
- Jitter. Packets arrive at uneven intervals. One that arrives after its turn has passed is thrown away, so late is as bad as lost.
- Reordering. Packets arrive in the wrong order, and one that comes too late is thrown away in the same way.
What you hear points at the cause, though it is a hint and not proof.
| What you hear | What it usually means |
|---|---|
| Short gaps or clicks | Packet loss |
| A robotic or metallic voice, or words that speed up and slow down | Jitter beyond what the buffer can absorb, or a lot of loss |
| A pause before the other person answers, and people talking over each other | Delay, which is not loss |
| An echo of your own voice | A fault in echo handling, usually at a handset or an analogue end |
| Bad on one phone only | That phone's connection, handset or Wi-Fi |
| Bad on every call at the same moment | The internet link, or the machine running the phone system |
Measure it before you change anything
Capture a bad call and open it in Wireshark. Under Telephony, choose RTP and then RTP Streams. Each direction of the call is listed with the packets it lost and its jitter, and you can analyse one to see the largest gap between packets and the mean and maximum jitter. Compare the two directions, because loss in one direction only points at the network on the way to that end.
Capture in two places if you can: at the phone system, and on the firewall's outside port. If the loss is already there at the outside port, it happened before your router. If it appears only inside, it happened on your own network or at the phone system.
Then compare with a call that you know is clean, such as one between two phones on the same switch. The difference between the two is the fault.
The causes, cheapest first
- Wi-Fi. A handset or a softphone on Wi-Fi shares the air with everything else, and loses packets to interference, a weak signal and moving between access points. Test the same phone on a cable. If the fault goes, it is the Wi-Fi.
- A full internet link. A large upload, such as a backup, a cloud sync or a video call, fills the upload link, and voice packets queue behind it. If the audio is bad only when someone is uploading, this is it. Schedule the upload for another time, or prioritise voice on the router.
- No priority for voice. Mark voice packets with DSCP EF (46) and give them priority on your router and switches. The internet beyond your link usually ignores the marking, so it matters most on your own link, at the narrowest point, which is usually the upload.
- A faulty port, cable or switch. Look at the error counters on the switch ports between the phone and the router. A port with errors, or a speed or duplex that has not negotiated properly, loses packets.
- The machine running the phone system. A server that is short of memory and paging, a virtual machine that shares a busy host, or a processor that is saturated by transcoding spoils every call at once. Check the machine's own load while a call is bad.
- Codec and transcoding. Converting from one codec to another costs processing and adds delay. Where both ends can use the same codec, use it, and keep the list of offered codecs short so that nothing needs converting.
- Loss at the provider. If the capture shows packets lost before they reach your outside port, the loss is on the provider's side. Take the capture to them with the time of the call.
- A tunnel with the wrong size. A VPN or tunnel with a packet size that is too large breaks packets into pieces, and a piece that is lost loses the whole packet. Lower the tunnel's MTU and test again.
How much bandwidth does a call need?
For G.711 with a packet every 20 milliseconds, each packet carries 160 bytes of audio. Add 12 bytes for RTP, 8 for UDP, 20 for IP and 18 for Ethernet and the packet is 218 bytes, sent fifty times a second. That is 87,200 bits a second, or about 87 kbps, in each direction for each call. A link with a different overhead needs a different figure, and a codec that compresses more needs less, so work out the most calls you will have at once, from your call records, and multiply.
Questions people ask
What packet loss is acceptable for VoIP?
There is no figure that suits every codec and every listener. Even a small, steady loss can be audible, so measure it in each direction and treat any sustained loss as a fault to find.
Why is my VoIP choppy only when someone uploads a file?
Because the upload fills the link and the voice packets wait in the same queue. Prioritise voice on the router, or move the upload to another time. A faster link only moves the point at which it fills.
Does a faster internet connection fix choppy audio?
Not by itself. What matters is whether the link is ever full and whether the path loses packets. A fast link that is full for ten seconds still gives ten seconds of bad audio.
In Wafflr
Wafflr is a phone system in development, and it has not launched, so this section describes its console as it is being built. Its Live calls page lists one row for each audio channel with the packets received, sent and lost, and shows loss as a percentage for each leg. The percentage is coloured amber from one per cent and red from five, which the console's code describes as where G.711 starts to be audible and where a call is unusable. Wafflr's own guide reads it this way: loss on one leg only points at that end's network, and loss on both legs points at Wafflr's own link or its host. It also notes that a machine that is paging, for example one where SQL Server has taken most of the memory, makes every call choppy at once.
Wafflr's handset template for the Yealink T3x, T4x and T5x desk phones offers Opus first, then G.722, G.711 and G.729. Wafflr's guide gives about 47 kbps for Opus at 24 kbps against the 87 kbps of G.711, for the same call, where both ends have Opus.