Sanjivkumarroshan / csipsimple

Automatically exported from code.google.com/p/csipsimple
0 stars 0 forks source link

Microphone only produces screeching noises #2071

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The application works just about right on a Droid Razr MAXX GSM (Xt910) running 
CyanogenMod10 (http://forum.xda-developers.com/showthread.php?t=1801379)
Except, no matter which option is toggled, the microphone makes a horrible 
screeching noise. The same phone running the stock LATAM 4.0.2 Rom works 
correctly.

What steps will reproduce the problem?
1. Install CyanogenMod10 using Safestrap
2. Install CsipSimple and configure any account.
3. Select the ULAW codec as it is the only working codec on this device.
4. Place or receive a call via WiFi

What is the expected output? What do you see instead?
The speaker works fine. The application works fine. The sound quality on the 
speaker is really clear. The microphone however produces a horrible screeching 
noise on the other sound.

What version of the product are you using? On what operating system?
Both CSipSimple from Play store and CSipSimple from Nightlies.
CyanogenMod Spyder UMTS STOCK-cm-10-20121110-UNOFFICIAL

Please provide any additional information below.

Original issue reported on code.google.com by arturo.m...@gmail.com on 12 Nov 2012 at 7:55

GoogleCodeExporter commented 9 years ago
If it's a cyanogen unstable ROM could be interesting to test with the legacy 
audio backend.

The app supports 2 audio backend implementation. One use the efficient and new 
OpenSL-ES api. The problem is that not all ROM/manufacturer drivers supports it 
properly. So you can manually switch to the legacy "java/jni" implementation.

To do so switch to ExpertSettingMode in global settings (see the wiki page if 
needed)
Then in Media > Audio troubleshooting you should see a "Audio implementation" 
option. Change it from OpenSL-ES to Java. 

Let me know how it goes.

It could be interesting to play with audio mic source and with the audio clock 
rate. Some Motorola devices are known to have specificities with clock rate and 
different microphones. 

Original comment by r3gis...@gmail.com on 12 Nov 2012 at 9:13

GoogleCodeExporter commented 9 years ago
Hello there,
I tested both audio backends. Additionally, i played around with all of the
Microphone sources.
Nothing seemed to change the audio scritching on the other end....

Original comment by arturo.m...@gmail.com on 12 Nov 2012 at 10:01

GoogleCodeExporter commented 9 years ago
Did you try to modify the clock rate? 32kHz helped on the first motorola atrix 
buggy versions.

Also, some others interesting tests you could do :
 * test with other simple voice recoding apps -- even if it's not streaming apps, it could be interesting to see if result is similar or different.
 * go in csipsimple settings, press menu and audio test. (it's a simple loopback test)
 * Try to enable the "Use mode api". It changes the audio mode and tries to put the phone audio layer in the same state than the one of a gsm call. (in this test, revert the clock rate to 8kHz or 16kHz).

I also forgot some remark about your first report. 
Saying that uLaw is the only codec supported on the device is not true. 
Actually csipsimple should support all codecs it propose. It's software codecs 
implemented inside the app, so all are supported. What could reduce the choice 
is what is supported by your sip provider (and in case they do media gateway 
instead of direct RTP).

Original comment by r3gis...@gmail.com on 12 Nov 2012 at 10:18

GoogleCodeExporter commented 9 years ago
I tried every single clock rate. It does not work.
With the loopback test it also creates a horrible screeching noise on my
speaker.
Use mode API does not seem to help at all.

The Developers behind this cyanogen version have stated that Bluetooth
Audio does NOT yet work with the current version of Cyanogen in the phone.
Maybe it has something to do with this?

As for the codec stuff, allow me to clarify:
Yes, CSipSimple has a ton of codecs. And I run Asterisk as the SIP server
so i can control which codecs i am using.
Regularly, my VoIP network uses ALAW,ULAW,Speex or GSM. With my normal
phone clients, all of these work just fine.
However, with my phone, NONE of these codecs produces ANY audio except
ULAW.  IT seems like it is a bug in the OS. more than a bug in your
software...

But it would be easier to raise a bug with Cyanogen if i know which part to
complain about!

Original comment by arturo.m...@gmail.com on 14 Nov 2012 at 4:46

GoogleCodeExporter commented 9 years ago
Ok, thanks for the details.
Ok, you're right probably something on the audio layer rather than a problem 
with codec for the horrible noise part.
Bluetooth point could be something interesting to investigate. Is bluetooth 
enabled in settings? Even if no device is paired, the simple fact it's enabled 
can have an impact on audio layer of android. If you ask I think it's something 
to search in the audio driver integration. It's probably not something on 
Cyanogen but rather for guys that do integration of cyanogen on this device.

As the loopback test doesn't involves encoders/decoders nor network so it's 
necessarily something on the android audio layer. 
Either in csipsimple/its config or in the CM driver. As it seems an 
experimental rom and you have no improvements with all workaround settings I 
would think about something in the ROM, but I could be wrong. Unfortunately 
only guys from the rom could help to point me where I'm wrong if so. (Or having 
a device to directly test on and see if it's missing frames or have some 
advanced debug traces on audio layer).
Some setting I maybe forgot to mention that could help too : "setup audio 
before init". Normally it's now by default cyanogen roms friendly but maybe in 
this particular version for razr it should be inverted.

Some follow up about codecs issue too. It's another problem but you might be 
interested in that point too. It sounds to me something with negotiation of 
codec (and update to fix one codec not taken into account by server). I think 
that activating only one of the codec supported by the server do the trick. 
Whatever the one you choose. The important point is to get only one. Usually if 
the sip server is impacted by this not correct support of the codec selection 
update; symptoms are :
 - one way audio (server -> you) 
 - this only happens for outgoing calls (incoming calls should work fine as the app is the one that selects the codec and can choose the preferred one)
If was your symptoms about horrible noise problem, it's maybe why you had to 
enable only ULAW ;). 
But anyway, other codecs will not help with your current problem as it's only 
here at audio layer level. 

Original comment by r3gis...@gmail.com on 15 Nov 2012 at 12:05

GoogleCodeExporter commented 9 years ago
Good Morning,
I just wanted to update this bug report,
Using Cyanogen 21-11-12 from the same Spyder UMTS tree has fixed the audio
problem. The software seems to be running perfectly now.
It seems to be a problem inside Cyanogen's data stack, as this was "Fixed"
by an older patch that is now integrated into the distro's SVN repo.

Original comment by arturo.m...@gmail.com on 23 Nov 2012 at 5:46

GoogleCodeExporter commented 9 years ago
Great news.
Thanks a lot for the update.

Original comment by r3gis...@gmail.com on 23 Nov 2012 at 8:17

GoogleCodeExporter commented 9 years ago
I've done a lot of work regarding this problem.
Since the bug keeps coming up every now and then, i begun a slightly
scientific debugging process.
I have identified the file that's causing the problems as
system/frameworks/telephony-common.jar
The stock CM10 build has a "new" telephony class that works with CSip in
Spyder devices, but not with Mobile Data.
Conversely, using the "stock" telephony in the rom makes Csip work (of
course, sometimes a reboot is necessary to clear out the screeching
noises), but not mobile data.
I'm including both links, to the rom and the telephony jar, maybe you can
make heads or tails out of this.

http://goo.im/devs/Hashcode/umts_spyder/cm10/STOCK-cm-10-20121116-UNOFFICIAL-umt
s_spyder.zip
http://goo.im/devs/Hashcode/umts_spyder/cm10/JB-cm_umts_spyder-data_fix.zip

Original comment by arturo.m...@gmail.com on 28 Nov 2012 at 5:08