views:

223

answers:

1

Hi,

We're working on a SIP softphone and we get audio feedback when we call from one phone to the other. However, when we call from a normal SIP Phone (software or hardware) to our app, then it all works fine - it's only when calling from one phone using the app to another one. Here is the code we use to initialize RIL Audio:

    public static void InitRILAudio()
    {
        IntPtr res;
        RILRESULTCALLBACK result = new RILRESULTCALLBACK(f_result);
        RILNOTIFYCALLBACK notify = new RILNOTIFYCALLBACK(f_notify);

        res = RIL_Initialize(1, result, notify, (0x00010000 | 0x00020000 | 0x00080000), 0, out hRil);

        if (res != IntPtr.Zero)
            return;

        RILAUDIODEVICEINFO audioDeviceInfo = new RILAUDIODEVICEINFO();
        audioDeviceInfo.cbSize = 16;
        audioDeviceInfo.dwParams = 0x00000003;      //RIL_PARAM_ADI_ALL;
        audioDeviceInfo.dwRxDevice = 0x00000001;    //RIL_AUDIO_HANDSET;
        audioDeviceInfo.dwTxDevice = 0x00000001;    //RIL_AUDIO_HANDSET;

        res = RIL_SetAudioDevices(hRil, audioDeviceInfo);
    }

We are using SipEk (http://voipengine.googlepages.com/sipeksdk) for the SIP stack. Basically we just use a callback delegate from the SDK for the audio stuff. Has anyone else experienced problems with Audio feedback loops like this? Either with RIL Audio or SipEk? Any suggestions?

Thanks in advance!

A: 

Feedback means that you're not using echo cancellation (line and/or acoustic, depending on whether it's working as a speakerphone or not), or if you are, the delay in your system (jitter buffers, network, encode/decode, etc) is greater than the echo canceller can handle. Excessive gain/clipping in the wrong places can also defeat any echo canceller (they don't like non-linear effects).

Sounds like you're just dumping the audio off to some other layers. SipEk is just a wrapper for pjsip, but I assume you're doing audio via the Microsoft RIL/etc stuff, not via pjmedia. You need to have a good understanding of your audio paths - where stuff gets sampled, if/how it's acoustic/line echo-cancelled, what the echo tail is, how it gets encoded and packetized, how it's received, jitter-buffered, loss-concealed, and decoded and played back.

jesup