During our Lync Conference 2014 session “Meetings & Media the detailed view (MEET400)” we explained what codecs are offered by the Lync 2013 Desktop Client, I figured this is something we need to blog about and here it is.
When a Lync client starts a conversation with someone (user, phone or server) it will always send out the same codecs during initial codec negotiation. The following slide demonstrates the codecs included in the SDP (Session Description Protocol) Offer that is included in the SIP (Session Initiation Protocol) INVITE message that is sent to the other party, the other party will respond with 183 Session Progress or 200 OK message that includes the remote party codecs in order for proper codec negotiation will be performed. Please not that I am not explaining the STUN/TURN/ICE Process as I am focusing on the codecs only and stripped out none relevant information from the INVITE & SDP.
The slide below shows what codecs are sent by the Lync client. We can see this is an Audio call based on the m=audio string in the SDP, RTP/AVP means that we don’t require encryption (which is not default in Lync, RTP/SAVP would mean encryption required) and then there is a list of numbers, this list of number represents the order of codec preference. The numbered list is also listed on the lines below with a=rtpmap what describes the different codecs.
Now that we know about the preference we can look at the list of codecs and then we see G722/8000/2 listed as the most preferred codec which is not RTAudio.
If we look at this list there does seem to be a discrepancy between the logic one would expect from Lync to use always Wideband codecs as the most preferred codecs in the list. Wideband codecs are take more frequencies from the sound spectrum and are listed as clock rate 16000. Lets have a look at the codecs list again then we see a codec on top that has the specifications of a Narrowband codec “G722/8000/2”. Now this does not seem right, Lync would prefer a codec that is not Wideband and prefer it above any other codec, clearly there must be something wrong here…
And yes there is something wrong, it is not related to what Microsoft is doing and it is not the Lync client making this mistake, the reason why this is can be found in the following IETF RCP: http://tools.ietf.org/html/rfc3551#section-4.5.2 (specifically looking at the second paragraph copied below)
Even though the actual sampling rate for G.722 audio is 16,000 Hz, the RTP clock rate for the G722 payload format is 8,000 Hz because that value was erroneously assigned in RFC 1890 and must remain unchanged for backward compatibility. The octet rate or sample-pair rate is 8,000 Hz.
So our conclusion is that G722/8000/2 is a Wideband codec as is the G722/8000. The only difference between these two codecs is that the first one is a Stereo codec used by Lync Room Systems what is prescribed with “/2” at the end and the second one is exactly the same codec but the Mono version. So life is still good because now we know all the upper codecs really are Wideband codecs. All Wideband codecs are listed in Green and all Narrowband Codecs are listed in Red on the slide below.
Now lets look at all the different codecs what they actually mean:
- G722/8000/2 : Wideband Stereo Codec used for Conferencing and used by Lync Room Systems (can be consumed by other Lync clients)
- x-msrta/16000 : Wideband Codec RTAudio and the preferred codec for Peer to Peer communications
- SILK/16000 : Wideband Codec used by Skype (added to the Lync Client with CU4 – November 2013) and will be used in Skype Federation V2 timeframe to communicate directly between Skype & Lync
- G722/8000 : Wideband Codec used for Conferencing in Lync & Room Systems without Stereo Microphones
- G7221/16000 : Wideband Codec based on Siren (not really sure when this codec is being used)
- SIREN/16000 : Wideband Codec for primarily for Conferencing but will also be used in certain peer to peer scenario’s where a more flexible codec is required (when packet loss, low bandwidth and or round trip times are high)
- PCMU/8000 : Narrowband Codec used “u-law” for PSTN Calls in US & Japan
- PCMA/8000 : Narrowband Codec used “a-law” for PSTN Calls in Europe
- AAL2-G726-32/8000 : Narrowband Codec (did not find much information about this codec)
- x-msrta/8000 : Narrowband Codec RTAudio and the preferred codec for doing PSTN Calls when calling from Internet or in bad network.
- SILK/8000 : Narrowband Codec used by Skype (added to the Lync Client with CU4 – November 2013) and will be used in Skype Federation V2 timeframe to communicate directly between Skype & Lync
- RED/8000 : Narrowband Codec used in Forward Error Correction scenario’s (other codecs also have FEC built into the codec like RTAudio, SILK and others)
- CN/8000 : Comfort Noise in scenario where no data is sent
- CN/16000 : Comfort Noise in scenario where no data is sent
- telephone-event/8000 : Key (touch) tones used in PSTN calls to send keys pressed during a call
Conclusion: Lync supports many many codecs and they change over time and even when Updates are applied, so you can expect this list to change in the future. If you want to know more about this then watch our session of Lync Conference
(MEET400) Meetings and Media – the detailed view