[ previous ] [ next ] [ threads ]
 To :  Yate mailing list <yate@v...>
 From :  Paul Chitescu <paulc@v...>
 Subject :  Re: [yate] Bug in conference smart mixing
 Date :  Mon, 28 Aug 2006 15:25:14 +0300 (EEST)
Thanks, Andrew, fixed it.

Paul Chitescu

On Mon, 28 Aug 2006, Andrew McDonald wrote:
> Hi, 
> 
> While testing the 1.0 version of the conference module I set up a call to a conference room that had smart=yes, with no other attendees. This meant the return audio should be golden silence. After about 13 seconds of call time, bursts of noise (inbound audio) could be heard. 
> 
> This was caused by a slight bug in the current implementation. 
> 
> Basically ConfRoom::mix() checks hasSignal() before mixing in audio from a channel, however ConfConsumer::dataForward() does not make such a check before subtracting out the individual channel's audio. This means in cases where hasSignal() is false, the inbound channel noise is effectively added (inverted) into the outbound audio mix. 
> 
> The inward audio was typically (non-golden) silence or comfort noise.
> 
> The timeline is explained by the fact that it takes the m_noise2 value about 13 seconds to converge to the average energy m_energy2 of the noise of the inbound call and thereafter it varies slightly above and below the average energy value. Thus for a call with comfort noise at the level set in our inbound all,  hasSignal() returns true for the first 13 seconds and then returns true or false in a semi-random pattern thereafter. 
> 
> As a quick fix I added an equivalent hasSignal() check to the audio subtraction of ConfConsumer::dataForward().
> 
> 559,560c559,562
> <         if (i < n)
> <             val -= d[i];
> ---
> >         if (hasSignal() && (i < n))
> >         {
> >             val -= d[i];
> >         }
> 
> 
> regards, 
> 
> Andrew
> [...]