Now that ALSA output drain works correctly, start accumulating the input
authorbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 25 Apr 2014 22:02:31 +0000 (22:02 +0000)
committerbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 25 Apr 2014 22:02:31 +0000 (22:02 +0000)
audio samples for the first frame before keying the transmitter.

git-svn-id: https://svn.code.sf.net/p/freetel/code@1571 01035d8c-6547-0410-b346-abe4f91aad63

freedv-server/source/run.cpp

index 9ebf636aaae3d66265d44c9145fa059f9481285a..b9b4a9c48f64350280651f7ea9b6193e50549f0c 100644 (file)
@@ -422,13 +422,12 @@ namespace FreeDV {
          // Flush all of the FIFO data.
          reset();
 
+         // Start accumulating the audio samples for the first codec frame
+         // before we've finished keying the transmitter.
+          i->microphone->start();
+
           i->keying_output->key(1);
 
-         // We could really start the microphone before we finish keying the
-         // transmitter, but at this writing ALSA snd_pcm_wait() doesn't
-         // really wait until the end of playback, and thus we hear the echo
-         // of the receiver if we start the microphone too early.
-          i->microphone->start();
 
           if ( ptt_digital )
             state = TransmitDigital;