{"id":124,"date":"2016-11-02T01:00:16","date_gmt":"2016-11-02T01:00:16","guid":{"rendered":"https:\/\/testmozilla.wpengine.com\/webrtc\/?p=124"},"modified":"2017-03-23T11:12:17","modified_gmt":"2017-03-23T11:12:17","slug":"audio-fec-experiments","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/","title":{"rendered":"Audio FEC Experimentation"},"content":{"rendered":"<p>We recently enabled <a href=\"https:\/\/tools.ietf.org\/html\/draft-ietf-rtcweb-fec-03\">Forward Error Correction<\/a> (FEC) for audio streams in Firefox&#8217;s WebRTC implementation using the built in support provided by the Opus codec. FEC creates a redundant, low bitrate encoding of audio that can be used to recreate lost packets. Since enabling FEC requires splitting some of the bitrate for use by the redundant encoding that could otherwise be used for the primary encoding, it was important to test whether or not FEC would actually result in improved call quality.<!--more--><\/p>\n<p>The way that Opus splits bitrate is such that for the default setting for audio bitrate in Firefox (40 kbps) FEC will not be enabled for two input channels, so all testing was done with the number of input channels set to one. Work is underway in Opus to make it more effective at lower bitrates, but for now, the bitrate would have to be increased to 58000 kbps for Opus to start producing <a href=\"https:\/\/tools.ietf.org\/html\/rfc6716#section-4.2.5\">LBRR<\/a> packets with two channels enabled.<\/p>\n<p>We collect <a href=\"https:\/\/telemetry.mozilla.org\/new-pipeline\/dist.html#!cumulative=1&amp;end_date=2016-08-01&amp;keys=__none__!__none__!__none__&amp;max_channel_version=aurora%252F49&amp;measure=WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS_RATE&amp;min_channel_version=null&amp;product=Firefox&amp;sanitize=1&amp;sort_keys=submissions&amp;start_date=2016-07-02&amp;table=0&amp;trim=1&amp;use_submission_date=0\">telemetry on dropped packets<\/a>. The telemetry values are <a href=\"https:\/\/en.wikipedia.org\/wiki\/Per_mille\">permille<\/a>, so even at the 75th percentile, we\u2019re seeing around 1.854% reported packet loss. The threshold for enabling LBRR within Opus is around 1%, so if our telemetry is accurate, FEC would not have any effect on about 66% of calls made. The tests were performed at the 75th and 95th percentiles, so 1.854% simulated packet and 19.435% packet loss. The tests were done using netem on Linux and also included 1000ms of simulated latency, the scripts containing the exact commands used can be found <a href=\"https:\/\/github.com\/dminor\/netem-scripts\">here<\/a>. Calls were made from Firefox Nightly to Google Chrome 51 using default settings.<\/p>\n<p>The Opus configuration under test was set in <a href=\"https:\/\/dxr.mozilla.org\/mozilla-central\/rev\/ffac2798999c5b84f1b4605a1280994bb665a406\/media\/webrtc\/trunk\/webrtc\/modules\/audio_coding\/main\/acm2\/acm_generic_codec.cc#263\">ACMGenericCodec::ResetAudioEncoder<\/a> to force the number of channels and whether or not FEC was enabled to the desired values without having to be concerned about them being overwritten by other parts of the system. This is also were experimentation with bitrates was performed. The recording controls in the Linux Pulse Audio Volume Control application were used to play the clip into Firefox, bypassing the microphone, and record the audio from Chrome, bypassing the speakers.<\/p>\n<p>Call with no packet loss:<\/p>\n<!--[if lt IE 9]><script>document.createElement('audio');<\/script><![endif]-->\n<audio class=\"wp-audio-shortcode\" id=\"audio-124-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_packetloss.mp3?_=1\" \/><a href=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_packetloss.mp3\">http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_packetloss.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>Call with 1.854% packet loss and no FEC:<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-124-2\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_fec_1.854_packetloss.mp3?_=2\" \/><a href=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_fec_1.854_packetloss.mp3\">http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_fec_1.854_packetloss.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>Call with 1.854% packet loss and FEC:<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-124-3\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/fec_1.854_packetloss.mp3?_=3\" \/><a href=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/fec_1.854_packetloss.mp3\">http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/fec_1.854_packetloss.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>Call with 19.435% packet loss and no FEC:<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-124-4\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_fec_19.435_packetloss.mp3?_=4\" \/><a href=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_fec_19.435_packetloss.mp3\">http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/no_fec_19.435_packetloss.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>Call with 19.435% packet loss and FEC:<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-124-5\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/fec_19.435_packetloss.mp3?_=5\" \/><a href=\"http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/fec_19.435_packetloss.mp3\">http:\/\/blog.mozilla.org\/webrtc\/files\/2017\/03\/fec_19.435_packetloss.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>The difference between FEC on and off is subtle at low packet loss rates and is unlikely to have much impact on the majority of calls made; at high packet loss rates it makes a very noticeable difference.<\/p>\n","protected":false},"excerpt":{"rendered":"We recently enabled Forward Error Correction (FEC) for audio streams in Firefox&#8217;s WebRTC implementation using the built in support provided by the Opus codec. FEC creates a redundant, low bitrate encoding of audio that can be used to recreate lost packets. Since enabling FEC requires splitting some of the bitrate for use by the redundant [&hellip;]","protected":false},"author":1396,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[221,296203,4516,109858,42003],"coauthors":[301097],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Audio FEC Experimentation - Advancing WebRTC<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Audio FEC Experimentation - Advancing WebRTC\" \/>\n<meta property=\"og:description\" content=\"We recently enabled Forward Error Correction (FEC) for audio streams in Firefox&#8217;s WebRTC implementation using the built in support provided by the Opus codec. FEC creates a redundant, low bitrate encoding of audio that can be used to recreate lost packets. Since enabling FEC requires splitting some of the bitrate for use by the redundant [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/\" \/>\n<meta property=\"og:site_name\" content=\"Advancing WebRTC\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-02T01:00:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-23T11:12:17+00:00\" \/>\n<meta name=\"author\" content=\"dminor@mozilla.com\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dminor@mozilla.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/\",\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/\",\"name\":\"Audio FEC Experimentation - Advancing WebRTC\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#website\"},\"datePublished\":\"2016-11-02T01:00:16+00:00\",\"dateModified\":\"2017-03-23T11:12:17+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/webrtc\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Audio FEC Experimentation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/\",\"name\":\"Advancing WebRTC\",\"description\":\"Committed to moving Firefox and WebRTC forward\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/webrtc\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140\",\"name\":\"dminor@mozilla.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/image\/af732858a65119b5fde439df1412fcab\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g\",\"caption\":\"dminor@mozilla.com\"},\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/author\/dminormozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Audio FEC Experimentation - Advancing WebRTC","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/","og_locale":"en_US","og_type":"article","og_title":"Audio FEC Experimentation - Advancing WebRTC","og_description":"We recently enabled Forward Error Correction (FEC) for audio streams in Firefox&#8217;s WebRTC implementation using the built in support provided by the Opus codec. FEC creates a redundant, low bitrate encoding of audio that can be used to recreate lost packets. Since enabling FEC requires splitting some of the bitrate for use by the redundant [&hellip;]","og_url":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/","og_site_name":"Advancing WebRTC","article_published_time":"2016-11-02T01:00:16+00:00","article_modified_time":"2017-03-23T11:12:17+00:00","author":"dminor@mozilla.com","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dminor@mozilla.com","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/","url":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/","name":"Audio FEC Experimentation - Advancing WebRTC","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/#website"},"datePublished":"2016-11-02T01:00:16+00:00","dateModified":"2017-03-23T11:12:17+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/webrtc\/audio-fec-experiments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/webrtc\/"},{"@type":"ListItem","position":2,"name":"Audio FEC Experimentation"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/webrtc\/#website","url":"https:\/\/blog.mozilla.org\/webrtc\/","name":"Advancing WebRTC","description":"Committed to moving Firefox and WebRTC forward","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/webrtc\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140","name":"dminor@mozilla.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/image\/af732858a65119b5fde439df1412fcab","url":"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g","caption":"dminor@mozilla.com"},"url":"https:\/\/blog.mozilla.org\/webrtc\/author\/dminormozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts\/124"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/users\/1396"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/tags?post=124"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/coauthors?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}