[Nexus 4 General] osi13:
Most of those settings are good, but I've spoken to the CSipSimple developer personally and raising the Clock Rate to anything higher than what the codec offers is counterproductive. If you're using a 8kHz codec -- PCMU which is also known as G711.u, G729, Speex, GSM, etc. then make sure the Clock Rate is set to 8kHz. Increasing that setting will actually degrade the audio quality. If you're using G722, which is 16kHz, then change it to 16kHz. Also, the MAIN thing for quality is to run an echo test and adjust the mic gain and earpiece volume while performing this echo test.

You can access these settings in call by clicking the wrench in the lower right corner. I've had to lower the mic gain considerably, from my experience, and you can do this every easily while in call. Asterisk based VoIP systems use *43 for the echo test application. I'm not sure if this holds true for pbxes.com, but it is Asterisk based, so give it a try. If *43 doesn't work, call this number: 909-390-0003 -- you won't hear anything but once you're connected you will be able to hear your own voice repeated back to you.

My settings are as follows:

Network:

- Lock WiFi

- High Perfs Lock (this will help with missed calls and doesn't seem to affect battery life)

- UDP

- TCP (my Astrisk server is set up to only use UDP, so I have this unchecked) I honestly do not think there is a real world difference between using TCP over UDP transport. Especially in regards to battery life.

- Disable TCP Switch

- Enable QoC

- Use Compact SIP (May consume an abnormal amount of battery)

Media (Checkmarks/Settings):

- Echo Cancellation

- Echo Cancellation Tail: 200 (Default)

- Echo Mode: WebRTC

- Voice Audio Detection (I haven't tried this, but I'm going to test this over the next few days)

- Noise Reduction (Honestly, this seemed to make calls sound worse, but it could just be placebo)

- Media Quality: 4 (Default)

- Clock Rate: 8 KHz (See above)

- Audio Frame PTime: 20 (Default)

- Codec priority list per bandwidth: Checked

- Codecs: If you can use G729, this is the best option, especially when you're calling over 4g/3g. It's still a better codec than iLBC in terms of latency and transcoding time. On my Asterisk server translation time from G711u (Google Voice) to iLBC is more than double G729, and Speex 8kHz is almost triple. We're talking about microseconds here, but I'll take the one that transcodes faster. I personally use G722 ("HD" codec, but it does sound slightly better than G711u and G729) on WiFi at home, and G729 over T-Mobile. There is a reason why G729 is not free, it's because it's a phenomenal codec. Also, a word to those who are rolling their own Asterisk server. If you're using the codecs from "http://asterisk.hosting.lv/" try the G729 codec compiled with GCC4, and the codec complied with ICC (intel's compiler), and then compare the translation times while in the asterisk CLI. Input "core show translations" to view this data. I noticed better translation times with the ICC version. The difference was very small, but I've been told to use the codec with better timings.

- Micro Amp: 1 (Leave these settings at their default, and change them while you're doing an echo test by clicking the wrench on the bottom right) Honestly, this is the best way to beat echo.

- Speaker Amp: 1

- BT Amp’s: 1

- Initial Stream Level: 6 (Default)

- Thread Count: 0 (Default)

- DTMF Mode: Auto

∷:Audio Troubleshooting∷:

- Auto Close Time: 1 (Default)

- Use WebRTC Implementation

- Focus Audio

- Mic Source: Voice_Communication (Some people have been saying that using the Camcorder mic is an improvement over "Voice_Communication" test this with an echo test, and change the value accordingly.

- Audio Mode for SIP: IN_Communication (I was told by the dev that In_Communication mode for Android offers the lowest audio latency. This is the correct setting.)

- Restart stream when change…

- Audio Implementation: The OP put "Java", but the dev recommends using OpenSL-ES. Try both of them, and see what's better for you.

This is meant to be a guide. It's not set in stone, and some settings may work better for you. However, if you want calls to sound right, you need to take the 10 minutes and play with the mic gain, and earpiece volume while in call. I NEVER have people complain about my calls while using the G729 codec, unless I'm driving and I'm in a poor service area. I've been using my personal Asterisk server for almost 8 months now, and it has been great.

Another edit: I've noticed that enabling "Use Compact SIP" has caused CSipSimple to use an abnormal amount of battery. Give it a try, but you may experience the same thing.

I've also noticed that I had "Keep awake in call" enabled under "User Interface." So I disabled this setting, and when I'm calling over WiFi I can hear popping noises. I downloaded "WiFi High Performance" from the Play store, and set it to initiate when an incoming or outgoing SIP call is detected. It seems to help the sound quality when the screen is off. I'm assuming most people want the screen off while in call, and this seems to alleviate the problem.