6
votes

Which SIP library should we look at to solve our audio delay/latency issue for Android phones running OSes 4.0 and above?

Our experiments suggest the delay is a SIP library issue. If not a library issue, what else could it be?

We built a simple VOIP app for both Android and iPhone. You simply dial the caller id of another user, press call, and start talking to them. The iPhone version works great, and we used a commercial API for the SIP functionality. But the Android version doesn't work so well because of audio delay issues which seems to depend on which Android phone you have. We used the following Android SIP library.

Our Experiments and Findings

When we are making calls between one android phone to another android phone, there is too much delay in the audio. One person will say something, and it could take up to a full 1-2 seconds before the other person hears it. At the moment, this problem appears to be particular to Samsung devices, as opposed to other hardwares (although our tests have been limited). So for example, a Galaxy Note 1 calling a GS3 experiences more delay than a Galaxy Note 1 calling Nexus 7 tablet (Asus) and Galaxy Note 1 calling a Xiaomi MI-2 phone.

We're pretty sure we've eliminated our Asterisk server as the probable cause of delay, since iphone to iphone calls are great, and iphone to android calls are reasonable.

Here is a list of device speed tests, listed in ascending order of delay

  • iphone to iphone (fastest, no noticeable delay)
  • android (Samsung) to iphone (a little delay, but still acceptable)
  • android (samsung) to android (xiaomi MI-2) (a little delay, but still acceptable)
  • android (samsung) to android (asus) (too much delay, unacceptable)
  • android (samsung) to android (samsung) (really slow, unacceptable)

Right now, my team is is leaning towards the idea that the Android SIP library we are using is not good enough. We are interested in using another SIP library to do the call.

We have noticed that other Android SIP phones like CSipSimple also experiences this problem.

Does anyone have ideas on how we can solve our audio delay/latency issues?

Additional Notes

We noticed there wasn't any audio delay when using Skype on Galaxy Note 1 to Skype on Galaxy S3. So that's why we were thinking there's probably a solution to this problem via our choice of SIP library, or codec or something...

We know we're using the G.711 Codec, incase that makes any difference.

1
Are call setup times (the SIP signaling part) also higher for Samsung phones? If it is only the audio which is facing delay then it has something to do with audio framework of Samsung phones, and in that case you cannot do much about it. Is there any way you can do some analysis on where most of the delay is getting added? If you can go native for media handling then I think it will reduce you E2E delay.Rajeev
@Rajeev thanks for suggeston on analyzing calls set up times. Let me do some analysis and see.John
@Rajeev Oh, i just added the following note to my question: "We noticed there wasn't any audio delay when using Skype on Galaxy Note 1 to Skype on Galaxy S3."John
Then that rules out the possibility of Audio Framework issue as eventually even Skype will have to use the same Mic and Speaker/Receiver resources. Now the suspicion shifts to Encoder/Decoders, or the RTP data handling inside the stack. But as you said, the same android sip stack works fine on Android phones other than Samsung, so RTP data handling should be same. So the most probable cause would be the Encoder/Decoders being used in Samsung Phones. I really should look into the SIP library if I want to be more helpful.Rajeev
@Rajeev thanks so much for your comment. It's re-assuring to us to hear you voice similar thoughtsJohn

1 Answers

2
votes

We fixed the voip latency issue by using the linphone sip library. Now there's hardly any notice-able delay when two people are talking to each other.