Sound quality using G.711

Erik Eliasson eliasson at it.kth.se
Fri Mar 16 13:16:19 CET 2007


Thanks, Philippe for fixing this bug.



A bit off topic, here are some other things that are not bugs, but
can/should be considered when improving the media handling:

 - The SoundSource API should allow audio in any frequency.
   We don't have any CODEC that needs it, but we should 
   support such plugins.

 - The buffer should contain audio with the same frequency
   as the output device. The audio should be resampled
   to that frequency _before_ it is put into the buffer.
   Today we resample after the buffer, and then we are 
   more sensitive from jitter generated by the operating
   systems scheduler. Also, it's better to do calculations
   in threads before the jitter buffer to make the kernel
   scheduler see the thread taking audio from the buffer
   as a very interactive one (i.e. mainly waiting for I/O).

 - Ideally, we should support using hardware buffers on the 
   sound device instead of using our software ones (this 
   is probably not possible when using out spatial audio 
   mixing)

--Erik

On Thu, 2007-03-15 at 20:17 +0100, Philippe Torrelli wrote:
> Hello, 
> 
> This in on windows with the latest autobuilds, on a lan.
> 
> Trying to talk from minisip and an Oxo here, I notice the audio sent from
> the Oxo restituted in minisip is very metallic and saturated.  The audio
> sent by minisip was very clear actually .
> However the quality for minisip-to-minisip conversations is OK, as are
> minisip to snom ..  This is with G.711 PCMA codec.. 
> 
> I replay the capture with ethereal, the quality is OK, so it's a problem of
> restitution. Trying to investigate this, I noticed the Oxo sends bigger
> packets than minisip does ( 240  byte payload versus 160 for minisip ).
> 
> I think I found something wrong in BasicSoundSource::pushSound in 
> 
> for( int32_t nSamples = nMonoSamples; nSamples > 0; ){
> 			int32_t cur = nSamples;
> 
> 			if( cur > (int32_t)iFrames )
> 				cur = iFrames;
> 			memset( temp, 0, iFrames * oNChannels ); 
> 			for( int32_t i = 0; i<cur; i++ ) {
> 				tempVal = i*oNChannels;
> 				temp[ tempVal ] = samples[i];
> 				tempVal ++;
> 				temp[ tempVal ] = samples[i];
> 			}
> 			writeRet = cbuff->write( temp, cur * 2, true );
> samples += cur ; // PTI
> 			nSamples -= cur;
> 
> }
> 
> as only the only part of samples that is used is the first interval modulo
> iFrame  [0.. iFrames [  is added to the circular buffer ( and more than once
> )...  Fixing it to use every sample makes the sound much better...  
> 
> 
> Philippe Torrelli
> 
> _______________________________________________
> Minisip-devel mailing list
> Minisip-devel at minisip.org
> http://lists.minisip.org/mailman/listinfo/minisip-devel
-- 
Erik Eliasson <eliasson at it.kth.se>



More information about the Minisip-devel mailing list