[Qt Extended 4.4.2] [PATCH] Added echo suppression fixes for the OpenMoko Neo phone.

Chris Samuel chris at csamuel.org
Thu Jan 8 06:11:15 CET 2009

Hi all,

My previous patch for echo suppression was completely bogus, once I'd figured 
out I could get the logging program to record all AT commands to the modem it 
was obvious that it wasn't sending the intended command asides from when an 
outgoing call occured (which is what the original QtE did).  Turns out I'd 
misunderstood the QtE build system and it was never looking at the code and 
when I fixed that it was painfully obvious that my lack of C++ knowledge meant 
I'd never get it to work in that state.

So I went back to the drawing board and changed it to use the AT%N0187 command 
to enable both noise reduction and echo suppression in one hit as I worry that 
the original method of using a command for each would result in the previous 
command being undone.  I also added them to a couple of other places where 
they looked like they'd be important such as on initialisation and on wake 
from suspend.

I'm using a slightly earlier version of the following patch (only removed two 
comments and inserted some blank lines) on my Neo at the moment and it seems 
to be working fine - on a test call from a train I was told there was no echo 
(with the volume at max and mic gain right up) but that I "sounded like I was 
in a bathroom", i.e. there was a bit of reverb. :-)

I'm not convinced that it's completely foolproof as I don't know if it'll 
remain enabled if I get two incoming calls without a suspend in between.

But it's still a lot better than what I've been having to put up with since I 
got this going!

I hope it's of use to others too..


 -------------------------8< snip snip 8<------------------------

The original Qt Extended 4.4.2 initially set both echo
suppression and noise reduction in separate AT commands
which might result in the second command negating the
first one.  It also only set them for outgoing calls.

This new version uses the AT command to set both
echo suppression and noise reduction at the same
time as well as setting them on initialisation and
after a wake up.

Signed-off-by: Chris Samuel <chris at csamuel.org>
 .../src/plugins/phonevendors/neo/vendor_neo.cpp    |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/devices/neo/src/plugins/phonevendors/neo/vendor_neo.cpp 
index 014d98a..63b27f8 100644
--- a/devices/neo/src/plugins/phonevendors/neo/vendor_neo.cpp
+++ b/devices/neo/src/plugins/phonevendors/neo/vendor_neo.cpp
@@ -153,8 +153,7 @@ QString NeoCallProvider::dialVoiceCommand(const 
QDialOptions& options) const
 // do undocumented echo cancellation and noise reduction
     modemService->primaryAtChat()->chat( "AT at ST=\"-26\"" );
-    modemService->primaryAtChat()->chat( "AT%N028B" );
-    modemService->primaryAtChat()->chat( "AT%N0125" );
+    modemService->primaryAtChat()->chat( "AT%N0187" );
     return QModemCallProvider::dialVoiceCommand(options);
@@ -551,11 +550,14 @@ NeoModemService::NeoModemService
     //  chat("AT%CMGRS=1"); //message transmission to get any failed sms 
during suspend
-   chat("AT%SLEEP=2"); //makes my Moko8 not respond to calls during sosuend
+   chat("AT%SLEEP=2"); //makes my Moko8 not respond to calls during suspend
     // Turn cell id information back on.
     chat( "AT+CREG=2" );
     chat( "AT+CGREG=2" );
+    // Turn on echo suppression and noise reduction.
+    chat( "AT%N0187" );
     QTimer::singleShot(200, this, SLOT(sendRego()));
@@ -572,6 +574,9 @@ void NeoModemService::sendRego()
     if( !cfg.value("PlaneMode",false).toBool()) {
         //       chat("AT%NRG=0,0"); //force auto operations
         chat("AT+COPS=0"); //force auto operations
+        // Turn on echo suppression and noise reduction.
+        chat( "AT%N0187" );
@@ -679,6 +684,9 @@ void NeoModemService::reset()
+    // Turn on echo suppression and noise reduction.
+    chat( "AT%N0187" );
     // Turn on "%CNAP" notifications, which supply the caller's
     // name on an call.  Only supported on some networks.
     chat( "AT%CNAP=1" );
@@ -738,6 +746,9 @@ void NeoModemService::wake()
     // Re-enable signal quality notifications when the system wakes up again.
     chat( "AT%CSQ=1", this, SLOT(mcsqOn()) );
+    // Turn on echo suppression and noise reduction.
+    chat( "AT%N0187" );
 void NeoModemService::mcsqOff()

 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC

This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part.
Url : http://lists.openmoko.org/pipermail/community/attachments/20090108/975239f1/attachment.pgp 

More information about the community mailing list