+ Reply to Thread
Results 1 to 2 of 2

Thread: VoIP delay in speech

  1. #1
    guest is offline Senior Member
    Join Date
    Aug 2006
    Posts
    112

    Default VoIP delay in speech

    Hi,
    Actually we are working for a soft IP Phone suitable for windows. It is implemented using H.323 for our proprietary PBX. It supports G.711,G723.1,G729a and G.729ab codecs.

    So when we are using G.711 codec, we get RTP packets of 240bytes each continuously at regular intervals, when we decode 240bytes we will get 480 bytes, these 480 bytes we are writing on to speakers using WaveInterface() i.e waveOutWrite() API,

    Actually there is a delay in processing the wave buffers by system.

    Here are the details:

    1. we have logged in the Information like when Application is receiving the RTP data, when it is inserting into system wavebuffer(i.e. WaveOutWrite() ) and when it is actually processed by the system( i.e. played back to the speaker)

    2. On an average Application inserting 2000 blocks of data to the system queue in 1 min. of time, but system is able to process only 1994 blocks of data in that time, so there are still 6 blocks of data that has to be processed.

    3. This delay go on accumulating and after 10 min, Application is inserting 20263 blocks of data, out which system has processed only 20230 blocks of data, so there are still 33 blocks of data pending to get processed by system. So like wise delay keeps on increasing and at any point of time we can not recover the delay as we receive RTP packets continuously at regular intervals.

    4. So work around what we have done is that for every 64 blocks of data, we are calling WaveOutReset(), which actually empties the system buffers and all the pending buffers in system queue are marked as done. So that means for 64 blocks of data, if system has processed only 60 or 62, the remaining 2 or 4 blocks of data will get lost, then there is absolutely no delay. but this is not the proper solution as we are losing 2 packets of Info. and also there is a possibilty for choppiness in speech.


    Here are our implementation details

    1)Our application consists of 64 buffers of each 480 bytes, allocated from heap.
    2)when we receive RTP packet(e.g. if G.711 codec used we will get 240 bytes of RAW data), we will first decode it, when we decode we will get 480 bytes of data.
    3) then we are preparing Header using WaveOutPrepareHeader(), and Inserting into system queue by using WaveOutWrite()
    4) we have Implemented a callback funtion, So whenever system is done with one buffer it will call that callback function and we are freeing the resources using WaveOutUnprepareHeader() in that callback function.
    5) Initially we dont get any delay but as the time proceeds delay increases.


    So Is there any way to avoid this delay by system? is there any other interface is available on windows for the same?
    Please let us know.

    Somesh

  2. #2
    andyf is offline Administrator
    Join Date
    Aug 2006
    Posts
    93

    Default

    Hi.

    This sounds like a good question for our friends at Microsoft :-)

    However, it is surprising to me that you are struggling with the throughput for the G711 codec - many other softphone providers care handling this so I'm guessing there is something in your code that is accounting for the extra latency. What hardware platform are you using for your test setup?

    Certainly dropping 3% of your buffers is noticable to the ear and not recommended so glad you are taking this seriously.

    Sorry I can't be of more help.

    Andy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may edit your posts
  •