[Home]

Summary:ASTERISK-24121: [patch] pass-through support for AMR and AMR-WB
Reporter:Alexander Traud (traud)Labels:
Date Opened:2014-07-25 09:24:02Date Closed:2014-08-21 09:21:53
Priority:MajorRegression?
Status:Closed/CompleteComponents:Codecs/NewFeature
Versions:Feature Tracker Frequency of
Occurrence
Related
Issues:
Environment:Ubuntu 14.04 LTSAttachments:( 0) CMakeLists.txt
( 1) codec_amr.c
( 2) codecDynamic_for_Asterisk11.patch
( 3) codecDynamic_for_Asterisk12.patch
Description:This patch and the module should speed up the development of your own, favorite pass-through codec: The patch allows to load a pass-through media-codec module while Asterisk is running. As example of such a module, AMR(-WB) was implemented.

This is an implementation of [RFC 4867|https://tools.ietf.org/html/rfc4867]. Sometimes, AMR is called AMR Narrowband (AMR-NB). AMR Wideband (ITU-T Recommendation G.722.2) is sometimes abbreviated W-AMR ([GSA|http://www.gsacom.com/hdvoice/]). GSMA Mobile [HD Voice|https://www.youtube.com/playlist?&list=PLj1MyDu3jckpSciPQ1Max0W6HDSaY8-n4] is based on [AMR-WB|http://www.youtube.com/watch?v=T6HsGyKU46c]. Research papers comparing various audio codecs: [InterSpeech 2010|http://research.nokia.com/files/public/%5B12%5D_Interspeech%202010_Voice%20Quality%20Evaluation%20of%20Recent%20Open%20Source%20Codecs.pdf], [ICASSP 2010|http://research.nokia.com/files/public/%5B11%5D_ICASSP2010_Voice%20Quality%20Evaluation%20of%20Various%20Codecs.pdf], [InterSpeech 2011|http://research.nokia.com/files/public/%5B16%5D_InterSpeech2011_Voice_Quality_Characterization_of_IETF_Opus_Codec.pdf]. Further [samples …|http://www.voiceage.com/Audio-Samples-Listening-Room.html]
\\
\\
*Limitations*

* Removing the module/format without restarting Asterisk, is not supported. If you need this, please, add this!

* Not all AMR attributes mentioned in the RFC are supported.

* Asterisk 12 does not pass-through SDP attributes, yet. Opus faces the same limitation. To address this, I have a patch in testing right now, and I am going to post it in August. Until then, you are limited to the default values, like octet-align=0 and all modes set. This could create no-audio. situations. If you need GSM compatibility (3GPP TS 26.103) or you want to reduce the RTP bandwidth from 40 kb/s to below 30 kb/s
{{octet-align=0; mode-set=0,1,2; mode-change-period=2; mode-change-neighbor=1}}
just change the call of {{ast_format_set}}.

* Asterisk 12 is not able to remove pass-through codecs in a SDP offer, if the remote call-leg does not support them, see ASTERISK-11782. Opus faces the same limitation. This could create no-audio situations. Again, the patch for this issue (same as above) is in its testing phase.
\\

*How-to Compile*
before you start, patch your Asterisk as usual; Asterisk 11.11 and Asterisk 12.4 were tested
{{sudo apt-get install build-essential cmake}}
{{mkdir codec_amr && cd ./codec_amr/}}
{{wget https://issues.asterisk.org/jira/secure/attachment/50793/CMakeLists.txt}}
{{wget https://issues.asterisk.org/jira/secure/attachment/50794/codec_amr.c}}
{{cmake .}}
{{sudo make install}}

*Thank You*
goes to [~marcelloceschia] for the idea, the initial patch, and allowing me to post the final version to the general public.
Comments:By: Matt Jordan (mjordan) 2014-07-25 12:22:56.325-0500

The media format work in trunk will have changed a large part of how this works. In order for this to be accepted, you'll want to take a look at the changes that have been made in trunk. In particular, how formats of different rates are applied to a codec is very different than the approach you've taken here, and is already handled in the format structure.

In general, I'd highly suggest you start engaging the asterisk developer community on the mailing list or in the IRC channel before writing such patches. Doing so would help reduce the likelihood that an approach you've taken conflicts with other development efforts.

Before proceeding any further with this issue, a discussion of what you are attempting to accomplish here should be done on the asterisk-dev mailing list.

By: Rusty Newton (rnewton) 2014-07-28 09:31:34.246-0500

Putting this in waiting on feedback while discussion goes on.

By: Rusty Newton (rnewton) 2014-08-21 09:21:27.162-0500

No discussion is on-going and this report doesn't include a patch for trunk so I'm going to close it out for now. New features require a patch for trunk. https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[~traud] Feel free to request on #asterisk-bugs or #asterisk-dev for a bug marshal to reopen the issue once there is a patch for trunk.

By: Matt Jordan (mjordan) 2014-08-21 09:26:44.488-0500

Unfortunately, there's been no further discussion :-(

As this is an improvement, the patch needs to be made against trunk. Since the media format architecture was heavily revamped in 13/trunk, the patch - as is - won't apply cleanly.

{quote}
* Asterisk 12 does not pass-through SDP attributes, yet. Opus faces the same limitation. To address this, I have a patch in testing right now, and I am going to post it in August. Until then, you are limited to the default values, like octet-align=0 and all modes set. This could create no-audio. situations. If you need GSM compatibility (3GPP TS 26.103) or you want to reduce the RTP bandwidth from 40 kb/s to below 30 kb/s
   octet-align=0; mode-set=0,1,2; mode-change-period=2; mode-change-neighbor=1
   just change the call of ast_format_set.

* Asterisk 12 is not able to remove pass-through codecs in a SDP offer, if the remote call-leg does not support them, see ASTERISK-11782. Opus faces the same limitation. This could create no-audio situations. Again, the patch for this issue (same as above) is in its testing phase.
{quote}

While there were bugs with passing through attributes, those should have been resolved in both 12 and 13/trunk. This patch is not necessary to fix the attribute pass through issues that occurred in those versions.

If there isn't going to be any discussion of this patch and its intended purpose, as well as a port to trunk, then I'd move to close it out.