summaryrefslogtreecommitdiff
path: root/apps/app_meetme.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-02-28 16:56:20 +0000
committerMatthew Jordan <mjordan@digium.com>2013-02-28 16:56:20 +0000
commit62f7acfac6e248ff0087e15a058ea575cd78e05c (patch)
tree7ab16091012adac5075dc1c6dc408202268e3679 /apps/app_meetme.c
parentde9068129364a9c1e8766d3d10f027054a091b4d (diff)
Let channels joining a MeetMe conference opt out of the denoiser
For some channel drivers, specifically those that have a varying rate in the number of audio samples, the audio quality for a MeetMe conference can be exceedingly poor. This is due to a unilateral application of the DENOISE function in func_speex to channels joining the conference. The denoiser function in the speex library is initialized with the number of audio samples in each sample that will be provided to it. If the number of audio samples changes, the denoiser has to be thrown away and re-initialized. While this could be worked around by removing func_speex, that doesn't help if you actually use the denoiser with other channels on the system. This patches does the following: * Checks for the presence of func_speex as opposed to codec_speex when determining if the DENOISE function is present (which is where the function is actually implemented) * Adds an option to MeetMe 'n' that causes the denoiser to not be applied to a channel when it joins. This keeps the current behavior the default, but let's users disable the denoiser if it causes problems on their system. Review: https://reviewboard.asterisk.org/r/2358 (closes issue AST-1062) Reported by: Thomas Arimont ........ Merged revisions 382227 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382230 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r--apps/app_meetme.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 9fb0e06aa..c09e3c071 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -148,6 +148,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
channel's currently set music class, or <literal>default</literal>.</para>
<argument name="class" required="true" />
</option>
+ <option name="n">
+ <para>Disable the denoiser. By default, if <literal>func_speex</literal> is loaded, Asterisk
+ will apply a denoiser to channels in the MeetMe conference. However, channel
+ drivers that present audio with a varying rate will experience degraded
+ performance with a denoiser attached. This parameter allows a channel joining
+ the conference to choose not to have a denoiser attached without having to
+ unload <literal>func_speex</literal>.</para>
+ </option>
<option name="o">
<para>Set talker optimization - treats talkers who aren't speaking as
being muted, meaning (a) No encode is done on transmission and (b)
@@ -657,6 +665,8 @@ enum {
#define CONFFLAG_INTROUSER_VMREC (1ULL << 33)
/*! If there's only one person left in a conference when someone leaves, kill the conference */
#define CONFFLAG_KILL_LAST_MAN_STANDING ((uint64_t)1 << 34)
+/*! If set, don't enable a denoiser for the channel */
+#define CONFFLAG_DONT_DENOISE (1ULL << 33)
enum {
OPT_ARG_WAITMARKED = 0,
@@ -687,6 +697,7 @@ AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS
AST_APP_OPTION('k', CONFFLAG_KILL_LAST_MAN_STANDING ),
AST_APP_OPTION_ARG('M', CONFFLAG_MOH, OPT_ARG_MOH_CLASS ),
AST_APP_OPTION('m', CONFFLAG_STARTMUTED ),
+ AST_APP_OPTION('n', CONFFLAG_DONT_DENOISE ),
AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
AST_APP_OPTION_ARG('p', CONFFLAG_KEYEXIT, OPT_ARG_EXITKEYS ),
@@ -3218,7 +3229,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
}
/* Reduce background noise from each participant */
- if ((mod_speex = ast_module_helper("", "codec_speex", 0, 0, 0, 0))) {
+ if (!ast_test_flag64(confflags, CONFFLAG_DONT_DENOISE) &&
+ (mod_speex = ast_module_helper("", "func_speex", 0, 0, 0, 0))) {
ast_free(mod_speex);
ast_func_write(chan, "DENOISE(rx)", "on");
}