[Home]

Summary:ASTERISK-26428: codec_opus: No Audio when using Codec Opus from Chrome WebRTC Web Audio Stream
Reporter:Dan Jenkins (danjenkins)Labels:
Date Opened:2016-09-29 19:58:30Date Closed:2017-10-24 09:42:36
Priority:MajorRegression?
Status:Closed/CompleteComponents:Codecs/codec_opus
Versions:14.0.1 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-26478 codec_opus: Opus transcoding one-way audio issue
Environment:Attachments:( 0) gistfile1.txt
Description:In terms of logging errors, Asterisk 99% of the time doesn't log that anything has gone wrong. However, one time, it did and heres the log

https://gist.github.com/danjenkins/73bbabbbe06bab2a2b2c82131549fbc6

I can't be sure if this would help or not, or if its even related (I can only presume it is)

Scenario:

Connect Chrome up using WebRTC to Asterisk and using a Web Audio Stream as the mediaStream into WebRTC, putting the extension into a bridge using ARI and other extens join from the PSTN (SRTP and RTP)

I've used Asterisk 13.11.2 using the open source Opus patches available and everything works brilliantly.

Upgraded to Asterisk 14 with Opus (core show channels shows opus on that channel) but no audio makes it into the bridge - I want to say that rtp debug on also doesn't show any data but with limited data connectivity while in the US is hampering testing this properly.

I can help out with a basic scenario to reproduce this

Like I say, everything worked perfectly with Opus on Ast 13.11.2 but not with Opus supplied with 14.0.1
Comments:By: Asterisk Team (asteriskteam) 2016-09-29 19:58:31.022-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-10-04 11:38:19.903-0500

What specific version of Chrome were you using?

By: George Joseph (gjoseph) 2016-10-04 11:41:50.340-0500

Hey Dan,

Can you try the current 13 git branch?  It has the codec_opus support and it'd be good to know if the issue is opus related or something else in 14 that might be causing the issue.




By: Dan Jenkins (danjenkins) 2016-10-05 05:15:23.019-0500

How do you @ someone in jira, i can never remember...

@josh I tried up to date versions on stable, beta and canary so  53.0.2785.116 ,Version 54.0.2840.27 beta (64-bit) and Version 55.0.2879.0 canary (64-bit) (which isnt up to date now)

@george - sure! Do I just have to clone it down, configure it in the same way as 14 using menuselect etc? I'll also attach a basic html file demo today.


By: George Joseph (gjoseph) 2016-10-05 07:16:41.766-0500

Yeah, just clone it.  It's only an outside chance that the issue is 14 related but since replicating the issue is a little complex it'd be good just to eliminate the possibility.

The "@" should start searching when you type the next letter.  Not working?



By: Dan Jenkins (danjenkins) 2016-10-05 07:26:30.179-0500

nope! I'll try cloning it now

By: Dan Jenkins (danjenkins) 2016-10-05 08:40:54.894-0500

Asterisk 13 git branch - no audio, rtp set debug on shows receiving packets

Got  RTP packet from    <ip>:61476 (type 111, seq 029908, ts 1136137639, len 000003)

core show channel <id> shows
NativeFormats: (opus)
   WriteFormat: opus
    ReadFormat: slin
WriteTranscode: No
 ReadTranscode: Yes (opus@48000)->(slin@48000)->(slin@8000)

After removing the other codecs which are now installable through the same means so that its exactly the same as my asterisk 13.11.2 install in terms of configing install, same result.


For some reason I now can't get my asterisk 13.11.2 thats patched with the other version of the opus codec to install/compile. Keeps failing on pjproject but I'll figure that out in a bit - but yes basically, same issue with 13 with the digium opus codec as 14

By: Dan Jenkins (danjenkins) 2016-10-05 09:09:21.289-0500

Heres the demo app you can run yourselves

you need to change the strings at the bottom of src/index.js
you need to have node installed
you need to run npm install

to run the app you need to run npm start

https://github.com/nimbleape/asterisk-opus-test


By: Dan Jenkins (danjenkins) 2016-10-05 09:12:01.415-0500

Oh and just to confirm, 13.11.2 with the patch works.

However, when doing a core show channel I get a different result

NativeFormats: (opus)
   WriteFormat: opus
    ReadFormat: slin
WriteTranscode: No
 ReadTranscode: Yes (opus@48000)->(slin@8000)

Dan

By: Kevin Harwell (kharwell) 2016-10-19 12:22:49.904-0500

[~djenkins], I was able to get the app installed and have it make a call. However, I don't see the error(s) you saw and actually don't seem to be getting any audio from it in the bridge. I want to make sure I have not missed something.

From the app's webpage I click "call". I have it dialing into an extension that places it into an ARI app. From there I add the channel (A) to a mixing bridge, place another channel (B) in the bridge with it, and then hear no audio. I place a third channel (C) in the bridge and can hear audio between B and C.

As a side note, I can hear audio (what sounds like MOH) playing from the computer hosting your app. I'm assuming that is the audio that I should be hearing in the bridge? Is there something else I am missing?



By: Dan Jenkins (danjenkins) 2016-10-20 07:15:10.103-0500

Yeah the errors only show up every once in a while - most of the time, no errors and no audio.

Yeah I get no audio from client up to bridge so your demo is definitely showing the problem

If I use the open source opus codec on 13 , everything works fine - the open source codec now works with 14 so I'll give that a go next time I have a chance to

By: Kevin Harwell (kharwell) 2016-10-21 12:31:10.868-0500

This appears to be a problem with the Asterisk implementation of opus and how it handles forward error correction (FEC) when decoding. In the invite the browser specifies to use in band fec in the sdp's fmtp line for opus:
{noformat}
a=fmtp:111 minptime=10;useinbandfec=1
{noformat}
Due to the nature of the problem for now we are going to specify the decoder to always not do fec. That should go out in the next release of the codec. However, it's planned that a future version will be able to properly handle fec.

In the meantime, to work around this for now specify to not use fec in the sdp (either set it to 0 or just don't include it as it will default to 0) and audio should work again.



By: Ross Beer (rossbeer) 2017-02-01 09:03:37.512-0600

I am seeing the same issue with a call from an Opus softphone going to a G722 hardware phone.

Opus <- G722 One way Audio
G722 -> Opus Two way Audio

By: Kevin Harwell (kharwell) 2017-02-01 10:36:31.419-0600

A new version of codec_opus has not been released yet with the mentioned fix. However, in that time an appropriate handling of inband fec has been implemented in codec_opus. It will go out in the next release of the codec that should be out soon-ish.

[~rossbeer] In the negotiation between the g722->opus leg are you seeing "useinbandfec=1" in the sdp? If so then yeah probably the same issue. If not then it might be something else in which case a new issue should be created.

By: Ross Beer (rossbeer) 2017-02-01 10:43:28.157-0600

I am using the latest version from GIT Asterisk GIT-13-13.12.2-311-g56e925fM which should have the fix.




By: Kevin Harwell (kharwell) 2017-02-01 10:56:31.917-0600

{quote}
I am using the latest version from GIT Asterisk GIT-13-13.12.2-311-g56e925fM which should have the fix.
{quote}

Any current branch of Asterisk will not have the fix. The Digium codec_opus for Asterisk is an external library released separately from Asterisk. The fix for this issue has not been released yet.