G729 low volume audio from android

mbedial

Member
Hi friends.
we have a comercial android app using SIP stack for voice. We want to migrate that technology to webRTC and WCS and in fact we have prepared a testbed with this characteristics:
- Android app using flashphoner android SDK
- WCS as webrtc to SIP gateway
- Asterisk
- External SBC (acting as SIP to TDM gateway)

When we make a call from the android app to public telephone number the flow sequence is as follow:

Android app with wifi 300mbs symmetric calls webrtc to WCS. In the same machine the WCS sends via SIP the call to local asterisk, an the asterisk sends the call to the SBC that deliver the call to a fix phone. The problem is that the audio level in the fix side is very very low. We are using G729 and I don't know if we can configure that level in the WCS or in the android SDK

Thanks in advance.
Mario
 

Max

Administrator
Staff member
We will check this on our end.
I will inform you through this thread once we have any news.
 

mbedial

Member
Great Max,
I can send you an apk to install and try by your self or get any traces or logs if you need.

BR
Mario
 

Max

Administrator
Staff member
Could you check our default application?
https://play.google.com/store/apps/details?id=com.flashphoner.wcsexample.phone_min
We have tested this Android app with Bria 4 softphone and G.729 audio codec.
Volume is not low on our tests.

Could you provide SSH access to server and SIP details for G.729 call?
Then we will able to test a call through your server.

>I can send you an apk to install and try by your self or get any traces or logs if you need.
We would prefer to test on our Phone samples.
We can also test your sample too. Please send source code and building instructions for Android Studio.

You can send details to: logs@flashphoner.com
 

Max

Administrator
Staff member
Could you please provide SSH access to your server or please zip and send WCS_HOME/conf folder to logs@flashphoner.com
Your WCS codecs configuration looks wrong.
Try this in flashphoner.properties:
Code:
codecs=opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip=mpeg4-generic,flv,mpv,opus,g722,speex16
codecs_exclude_streaming=flv,telephone-event
codecs_exclude_sip_rtmp=opus,g729,g722,mpeg4-generic,vp8,mpv
Here we exclude codecs: opus,g722,speex16 just to check if G.711 will work better than Opus.
 

Max

Administrator
Staff member
Could you please describe your codec flow: App (codec1) -> WCS (codec2) -> asterisk (codec3) -> SBC (codec4) ->TDM. Is it possible that your SBC do transcoding g729 to g711?
 

mbedial

Member
Hi Max again,
I've sent the WCS/conf via email.
Regarding your question, the flow should be G279 from our app to the SBC without transcoding. I ignore if the SBC does any transcoding, although I think so. Anyway it has never been a problem form our SIP g729 calls.
Finally, since the last update of WCS there is no audio in the handset (app). We have this error:

19:20:15,886 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:15,906 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:15,926 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:15,946 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:15,966 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:15,986 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,006 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,026 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,046 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,066 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,086 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,106 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,126 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,146 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,166 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,186 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,206 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,226 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,246 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,266 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
19:20:16,286 ERROR AudioTranscoder - RTP-pool-24-thread-11 com.flashphoner.media.codec.M
 

Max

Administrator
Staff member
Hello
We have received your configuration.
It looks incorrect in flashphoner.properties
You have:
Code:
codecs=g729,opus,alaw,ulaw,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
Try configuration as described above:
Code:
codecs=opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip=mpeg4-generic,flv,mpv,opus,g722,speex16
codecs_exclude_streaming=flv,telephone-event
codecs_exclude_sip_rtmp=opus,g729,g722,mpeg4-generic,vp8,mpv
I ignore if the SBC does any transcoding, although I think so. Anyway it has never been a problem form our SIP g729 calls.
Anyway, the transcoding will be done on WCS end.
WebRTC does not support G.729 natively, so WCS will have to transcode either G.711-G.729 or Opus-G.729.
 

mbedial

Member
Thanks Max,
We've made those changes and tested it with our customer. In fact we have tested 2 configurations with different result. Here you have the comments of our customer:

1) I've tried firstly with G711U:
codecs =alaw,ulaw
codecs_exclude_sip =mpeg4-generic,flv,mpv,opus,g722,speex16
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp =opus,g729,g722,mpeg4-generic,vp8,mpv
In this case, does WCS transcode ?
Our client has tested it, and even when you can have a normal conversation he complains about:
- A brief delay (latency) from the app android to the mobile (TDM) phone
- The destination party (mobile TDM) listens a brief echo (the customer describes it like to be in a cave)
- The volume in the mobile is a bit low.

2) We've tried with opus too (according to your recommendation):
codecs =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip =mpeg4-generic,flv,mpv,opus,g722,speex16
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp =opus,g729,g722,mpeg4-generic,vp8,mpv
In this case the customer complains about:
- Better delay than
- Very very low volume in the destination.
- The audio colume is so low that we don't now if we have echo or noise in the call.

Thanks in advance.
Mario
 

Max

Administrator
Staff member
In this case, does WCS transcode?
WCS performs transcoding anyway because Android SDK is based on WebRTC and does not support g.729 out of the box.
Very very low volume in the destination
Only option we can try is server-side AGC (automatic-gain-control) to adjust gain.
Or perhaps we have to tweak WebRTC lib for Android to disable AGC completely.
Did you test with other Android devices? Maybe this issue is related to this particular Android device / OS version only.
We could not reproduce similar issue on Android 5.1.1 with our default Phone app. Sound is good. Does not look 'Very very low'.
 

mbedial

Member
Hi again,
we've just tested the same scenario with your phone app of gplay with this results:
Galaxy J5 . Android 6.0.1 Good volume and quality. A brief latency
LG-D320n, Android 4.4.2. Very low volume. A brief latency
Alcatel PoP 5051x . Android 6.0.1 . Low volume. A brief latency --> In this case , suddenly it started to work better without any change in the config.
LG Leon (LG-H340m), Android 5.0.1 Good volume and quality. A brief latency
This test has been made with this conf:

codecs =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip =mpeg4-generic,flv,mpv,opus,g722,speex16
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp =opus,g729,g722,mpeg4-generic,vp8,mpv

As you can see, the behaviour is a bit random and it seems not to depend on the android release. Anyway, we are going to send a new apk to our customer in order to check with more handsets.

Thanks again.
M
 

Max

Administrator
Staff member
We are going to re-check AGC and Noise suppression settings, and if it is applicable, make these settings available via application UI.
I will keep you informed about our progress through this thread.
 

mbedial

Member
Hi Max and thanks a lot for your quick answers.
The customer has reported the first feedback.
With the same handset (Alcatel PoP 5051x . Android 6.0.1) , if we use app1 we have good volume level (phoneeduch.log) and with the second low level (logbbb1ch.log). In theory they use exactly the same sdk and the same flashphoner conf. See the attached log , it may help.
BR
M
 

Attachments

Max

Administrator
Staff member
Checkboxes for enabling audio constraints, which can be used to improve audio quality, have been added in the last version of Phone-min. Recommendation on which constraints should be enabled would depend on the Android device being used.

Calls to Bria 4.8.1, G.729 have been checked with the following devices
- Moto G, Android 5.1: audio is more clear when googNoiseSupression is enabled
- Nexus 7, Android 6.0.1: no noticeable effect from the constraints
- Nexus 10, Android 5.1.1: audio is more clear when googEchoCancellation is enabled
- Asus ZenFone 2, Android 5.0: no noticeable effect from the constraints

The latest Android SDK download link: https://flashphoner.com/downloads/b...dc542d08fec08734492fbc96e5572e829ac2ae.tar.gz
Phone-min apk is available in samples folder.
 

Attachments

abhinav

New Member
hello team,

When i tried to change the flashphoner.properties to
codecs =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip =mpeg4-generic,flv,mpv,opus,g722,speex16
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp =opus,g729,g722,mpeg4-generic,vp8,mpv

it said it is read only file you cant overwrite it.

please suggest me how can i change it.
 

Max

Administrator
Staff member
Good day, abhinav.
First, we strongly recommend you to create a new topic for a new question.
it said it is read only file you cant overwrite it.
You probably have not enough rights to edit this file in its location. You should log in to you server as root or, if you have AWS instance, do the following:
1. Log in to your server through SSH.
2. Copy flashphoner.properties file to your home directory:
Code:
cd ~
cp /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties .
3. Edit the file in your home directory
Code:
vi flashphoner.properties
4. Copy the file back to WCS_HOME/conf using sudo
Code:
sudo cp flashphoner.properties /usr/local/FlashphonerWebCallServer/conf
 

abhinav

New Member
Hello Team,
I am able to change the file in my conf folder but i still facing low volume issue in some iOS devices.
Please suggest for same.
 

Max

Administrator
Staff member
In this topic, Android devices issue is discussed.
Please create a new topic and clarify your case in it.
 

GwynEaves

New Member
Hi..on a different note, are you sure that the quality problem is on the part of the call between 3CX and the phone? Do you know for a fact that the audio quality is not getting distorted between the the Provider and 3CX?
Most providers that offer G729 by default usually offer other codecs as well. I would also try removing G729 from the SIP Trunk settings in 3CX and try making a call, maybe you could force them to use their second choice which usually is G711.

assembly circuit
 
Last edited:
Top