From: <sb...@us...> - 2007-09-13 17:56:12
|
Revision: 1135 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1135&view=rev Author: sbalea Date: 2007-09-13 10:56:15 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Compile with (a slightly modified version of) speex-1.2beta2 Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-09-13 17:52:06 UTC (rev 1134) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-09-13 17:56:15 UTC (rev 1135) @@ -153,10 +153,10 @@ /* Analog AGC: Bring speex AGC gain out to mixer, with lots of hysteresis */ /* use a higher continuation threshold for AAGC than for VAD itself */ if ( !silent && - iaxci_silence_threshold != 0.0f && - (iaxci_filters & IAXC_FILTER_AGC) && - (iaxci_filters & IAXC_FILTER_AAGC) && - st->speech_prob > 0.20f ) + iaxci_silence_threshold != 0.0f && + (iaxci_filters & IAXC_FILTER_AGC) && + (iaxci_filters & IAXC_FILTER_AAGC) + ) { static int i = 0; @@ -164,8 +164,8 @@ if ( (i & 0x3f) == 0 ) { - const float loudness = st->loudness2; - + const float loudness; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_GET_LOUDNESS, &loudness); if ( loudness > 8000.0f || loudness < 4000.0f ) { const float level = iaxc_input_level_get(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-09-18 20:25:15
|
Revision: 1144 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1144&view=rev Author: sbalea Date: 2007-09-18 13:25:17 -0700 (Tue, 18 Sep 2007) Log Message: ----------- Disable VAD sensitivity tweaks, apparently the new VAD does not like that Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-09-18 19:45:19 UTC (rev 1143) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-09-18 20:25:17 UTC (rev 1144) @@ -107,7 +107,7 @@ static void set_speex_filters() { int i; - float f; + //float f; if(!st) return; @@ -122,10 +122,10 @@ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB, &i); /* make vad more sensitive */ - f = 0.30f; - speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_START, &f); - f = 0.07f; - speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &f); + //f = 0.30f; + //speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_START, &f); + //f = 0.07f; + //speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &f); } static void calculate_level(short *audio, int len, float *level) @@ -283,8 +283,10 @@ if(silent) { + fprintf(stderr, "S"); if(!call->tx_silent) { /* send a Comfort Noise Frame */ + fprintf(stderr, "C"); call->tx_silent = 1; if ( iaxci_filters & IAXC_FILTER_CN ) iax_send_cng(call->session, 10, NULL, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-09-18 20:27:10
|
Revision: 1146 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1146&view=rev Author: sbalea Date: 2007-09-18 13:27:14 -0700 (Tue, 18 Sep 2007) Log Message: ----------- Remove some debug output Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-09-18 20:25:35 UTC (rev 1145) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-09-18 20:27:14 UTC (rev 1146) @@ -283,10 +283,8 @@ if(silent) { - fprintf(stderr, "S"); if(!call->tx_silent) { /* send a Comfort Noise Frame */ - fprintf(stderr, "C"); call->tx_silent = 1; if ( iaxci_filters & IAXC_FILTER_CN ) iax_send_cng(call->session, 10, NULL, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-25 15:20:13
|
Revision: 1232 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1232&view=rev Author: sbalea Date: 2007-10-25 08:20:17 -0700 (Thu, 25 Oct 2007) Log Message: ----------- Add synchronization to ec and st setup and teardown Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-25 06:37:55 UTC (rev 1231) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-25 15:20:17 UTC (rev 1232) @@ -46,6 +46,8 @@ static int speex_state_rate = 0; int iaxci_filters = IAXC_FILTER_AGC|IAXC_FILTER_DENOISE|IAXC_FILTER_AAGC|IAXC_FILTER_CN; +static MUTEX audio_lock; + #ifdef SPEEX_EC static SpeexEchoState *ec = NULL; static rb_RingBuffer ecOutRing; @@ -149,6 +151,7 @@ float volume; int silent = 0; + MUTEXLOCK(&audio_lock); if ( !st || speex_state_size != len || speex_state_rate != rate ) { if (st) @@ -168,6 +171,7 @@ speex_state_rate = rate; set_speex_filters(); } + MUTEXUNLOCK(&audio_lock); calculate_level((short *)audio, len, &input_level); @@ -444,6 +448,7 @@ /* if ec is off, clear ec state -- this way, we start fresh if/when * it's turned back on. */ + MUTEXLOCK(&audio_lock); if ( !(iaxci_filters & IAXC_FILTER_ECHO) ) { if ( ec ) @@ -465,9 +470,6 @@ rb_InitializeRingBuffer(&ecOutRing, EC_RING_SIZE, &outRingBuf); ec = speex_echo_state_init(SAMPLES_PER_FRAME, ECHO_TAIL); - // st and ec can be created and destroyed from two separate threads - // and thus we have possible race conditions here. - // TODO: verify that this is the case and add synchronization code. if ( st ) { speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, ec); @@ -477,7 +479,8 @@ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE, &i); } } - + MUTEXUNLOCK(&audio_lock); + // Put our data in the EC ring buffer. // Echo canceller needs SAMPLES_PER_FRAME samples, so if we don't have enough // at this time, we just store what we have and return. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-11-02 16:15:39
|
Revision: 1258 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1258&view=rev Author: sbalea Date: 2007-11-02 09:15:36 -0700 (Fri, 02 Nov 2007) Log Message: ----------- Properly destroy st and ec states in audio_destroy Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-11-02 14:26:56 UTC (rev 1257) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-11-02 16:15:36 UTC (rev 1258) @@ -499,6 +499,18 @@ int audio_destroy() { + MUTEXLOCK(&audio_lock); + if ( st ) + { + speex_preprocess_state_destroy(st); + st = NULL; + } + if ( ec ) + { + speex_echo_state_destroy(ec); + ec = NULL; + } + MUTEXUNLOCK(&audio_lock); MUTEXDESTROY(&audio_lock); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-11-05 18:46:20
|
Revision: 1267 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1267&view=rev Author: sbalea Date: 2007-11-05 10:46:22 -0800 (Mon, 05 Nov 2007) Log Message: ----------- Make sure audio_lock is released when it should be. Thanks Bill. Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-11-05 15:29:12 UTC (rev 1266) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-11-05 18:46:22 UTC (rev 1267) @@ -453,7 +453,7 @@ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, NULL); } } - + MUTEXUNLOCK(&audio_lock); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-11-05 19:48:31
|
Revision: 1269 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1269&view=rev Author: sbalea Date: 2007-11-05 11:46:58 -0800 (Mon, 05 Nov 2007) Log Message: ----------- Update the VAD probability setup code. Speex changed the interface to this functionality, so our code no longer made sense. We also change the probability values: it appears that best result are obtained when using speex default values. I am leaving the code in though, so we know where and what to tweak in case we need to. Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-11-05 19:42:15 UTC (rev 1268) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-11-05 19:46:58 UTC (rev 1269) @@ -109,7 +109,6 @@ static void set_speex_filters() { int i; - //float f; if ( !st ) return; @@ -123,11 +122,15 @@ i = (iaxci_filters & IAXC_FILTER_DEREVERB) ? 1 : 0; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB, &i); - /* make vad more sensitive */ - //f = 0.30f; - //speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_START, &f); - //f = 0.07f; - //speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &f); + /* + * We can tweak these parameters to play with VAD sensitivity. + * For now, we use the default values since it seems they are a good starting point. + * However, if need be, this is the code that needs to change + */ + i = 35; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_START, &i); + i = 20; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &i); } static void calculate_level(short *audio, int len, float *level) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |