2009-11-09 07:25:28     internal audio delay and echo cancellation (Linphone app/AD73311)

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-11-09 07:25:28     internal audio delay and echo cancellation (Linphone app/AD73311)

Rob Maris (GERMANY)

Message: 82208   


Since I'm going to establish a capability to store speex' echo canceller state into a file after having performed a sort of reference AEC tuning, I need a stable timing between subsequent audio stream starts. I mean stable delay time between reference signal to speaker and captured microphone stream. When this prerequisite is fulfilled, any subsequent new audio connection can be started with the "tuned" echo canceller state, which would not necessarily be a good basic state for cancelling indirect echoes, but indeed cancel out direct speaker-microphone coupling effectively right from the start - a good starting point for connections with speakerphones on both sides (minimizes feedback susceptibility).


I performed time measurements using two constellations:


1. $ arecord|aplay


2. Linphone's echo test program (@ ...user/linphone/build-linphone-3.x.x/mediastreamer2/tests


With arecord|aplay I get a record->playback delay of approx. 200 ms, while the echo test program, which performs basically the same record->playback function, exhibits a delay of approx. 120 ms.


Upon a running connection, delay is stable (which is expected, of course), but in both cases, the delay can vary approx. up to 2 ms. I don't understand why this occurs.


The AD73311 is recognized as an ALSA device.


If there is nothing which can be tweaked in Linux to get the delay stable, I'd consider the implementation of an AD73311 "direct drive". Prior to doing any action, I' recommend any hints and other considerations about this delay deviation stuff.


As an alternative, I could try to establish a stereo arrangement, channel L for microphone, and channel R for speaker feedback (which would - of course - require changes to the driver).






2009-11-10 22:53:41     Re: internal audio delay and echo cancellation (Linphone app/AD73311)

Cliff Cai (CHINA)

Message: 82261   


Hi Rob,


There are several aspects that can affect the delay,the driver,alsa-lib,and the application involved


Would you have a try of  running vrec -w|vplay and see the dalay? vrec/vplay will bypass alsa-lib.