[asterisk-bugs] [Asterisk 0011968]: [patch] DSP cleanup phase 2

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Mar 26 14:01:32 CDT 2008


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=11968 
====================================================================== 
Reported By:                dimas
Assigned To:                qwell
====================================================================== 
Project:                    Asterisk
Issue ID:                   11968
Category:                   PBX/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 100974 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             02-10-2008 15:57 CST
Last Modified:              03-26-2008 14:01 CDT
====================================================================== 
Summary:                    [patch] DSP cleanup phase 2
Description: 
NOTE: these changes ara made on top of
http://bugs.digium.com/view.php?id=11796 so it must be applied first.
Publishing changes mainly for review.

1. Removed MUTECONF/MUTEMAX options support from DSP code. The idea behind
these is somewhat unclear and my analisys shows it is broken anyway -
http://lists.digium.com/pipermail/asterisk-dev/2008-January/031650.html

2. The code now generated DTMF_BEGIN frames in addition to DTMF_END ones.

3. "quelching" rewritten - now each detector (MF/DTMF/generic tone) may
mark fragment of a frame for suppression (squelching, muting) with a call
to mute_fragment. Actual muting happens only once at the very end of
ast_dsp_process where all marked fragments are zeroed. This way every
detector sees original data in the frame without any piece of a frame being
zeroed by a detector which was run before.

4. DTMF detector tries to "mute" one block before and one block after the
block where actual tone was detected. Muting of previois block is something
new for this patch. Obviously this operation is not always possible - if
current frame does not contain data for previous block - it is too late.
But at least we make our best.

Muting of next block was already done by the old code but it only affects
part of the next block which is in the frame being processed. New code
keeps this information in state structures so it will mute proper number of
samples in the next frame(s) too.

5. Removed ast_dsp_digitdetect and ast_dsp_getdigits APIs because these
are not used anyway but would made patch more complicated if kept.

====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 03-26-08 14:01  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 111022

U   trunk/channels/chan_usbradio.c
U   trunk/channels/chan_vpb.cc
U   trunk/channels/chan_zap.c
U   trunk/include/asterisk/dsp.h
U   trunk/main/dsp.c

------------------------------------------------------------------------
r111022 | qwell | 2008-03-26 14:01:26 -0500 (Wed, 26 Mar 2008) | 23 lines

Large cleanup of DSP code

Per comments from dimas:
1. The code now generates DTMF_BEGIN frames in addition to DTMF_END ones.

2. "quelching" rewritten - now each detector (MF/DTMF/generic tone) may
mark fragment of a frame for suppression (squelching, muting) with a call
to mute_fragment. Actual muting happens only once at the very end of
ast_dsp_process where all marked fragments are zeroed. This way every
detector sees original data in the frame without any piece of a frame being
zeroed by a detector which was run before.

3. DTMF detector tries to "mute" one block before and one block after the
block where actual tone was detected. Muting of previois block is something
new for this patch. Obviously this operation is not always possible - if
current frame does not contain data for previous block - it is too late.
But at least we make our best.
Muting of next block was already done by the old code but it only affects
part of the next block which is in the frame being processed. New code
keeps this information in state structures so it will mute proper number of
samples in the next frame(s) too.

4. Removed ast_dsp_digitdetect and ast_dsp_getdigits APIs because these
are not used.

5. DSP API extended a bit - ast_dsp_was_muted() function added which
returns true if DSP code was muting any fragment in the last frame.
chan_zap uses this function to decide it needs to turn on confmute on the
channel.
This is to replace AST_FRAME_DTMF 'm'/'u' (mute/unmute) functionality.


(closes issue http://bugs.digium.com/view.php?id=11968)
Reported by: dimas
Patches:
      v2-11968-dsp.patch uploaded by dimas (license 88)
      v4-11968-zap.patch uploaded by dimas (license 88)
Tested by: dimas, qwell

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=111022 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-26-08 14:01  svnbot         Note Added: 0084606                          
03-26-08 14:01  svnbot         Status                   new => assigned     
03-26-08 14:01  svnbot         Assigned To               => qwell           
======================================================================




More information about the asterisk-bugs mailing list