linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] oRTP scheduler too fast??


From: Simon MORLAT
Subject: Re: [Linphone-developers] oRTP scheduler too fast??
Date: Fri, 14 Nov 2003 18:24:47 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031105 Thunderbird/0.3

Hello,

Can you precise host type, distribution, and oRTP version you are using ? Did you compile with or without glib ?
Your test program seems correct to me.
There's a known bug when compiling without glib on lastest (said stable) release.
Lastest unstable fixes it:
http://www.linphone.org/ortp/sources/unstable/ortp-0.6.3pre4.tar.gz
Tell me if it improves something.
Simon

Tomas Lundqvist wrote:

Hello!

I am trying to do a simple SIP UA that can reply to calls from Linphone. The 
SIP part is oSIP and the RTP part oRTP.

The SIP part is working as it should (thanks Aymeric!) but when Linphone starts 
sending RTP packets my app tries to get them faster than they are received 
although I use scheduling and blocking!

Terminal output:

rtp_getq(): Timestamp 697211237 wanted.rtp_getq: Seeing packet with ts=697211237
rtp_getq: Found packet with ts=697211237Returning mp with ts=697211237mlen=160 w
len=160 rlen=0
have more: 0
RTP status: 160
RTP packet: 55

rtp_getq(): Timestamp 697211397 wanted.No mp for timestamp queried
have more: 0
RTP status: 160
RTP packet: 56

rtp_getq(): Timestamp 697211557 wanted.No mp for timestamp queriedrtp_parse: sil
ently discarding very old packet (ts=697211397)rtp_parse: silently discarding ve
ry old packet (ts=697211557)rtp_putq(): Enqueuing packet with ts=697211717
have more: 0
RTP status: 160
RTP packet: 57

rtp_getq(): Timestamp 697211717 wanted.rtp_getq: Seeing packet with ts=697211717
rtp_getq: Found packet with ts=697211717Returning mp with ts=697211717we must ca
tchup 1 ticks.mlen=160 wlen=160 rlen=0
have more: 0
RTP status: 160
RTP packet: 58

rtp_getq(): Timestamp 697211877 wanted.No mp for timestamp queried
have more: 0
RTP status: 160
RTP packet: 59

rtp_getq(): Timestamp 697212037 wanted.No mp for timestamp queriedrtp_parse: sil
ently discarding very old packet (ts=697211877)
have more: 0
RTP status: 160
RTP packet: 60

rtp_getq(): Timestamp 697212197 wanted.No mp for timestamp queriedrtp_parse: sil
ently discarding very old packet (ts=697212037)rtp_parse: silently discarding ve
ry old packet (ts=697212197)
have more: 0
RTP status: 160
RTP packet: 61

End Terminal output.

As you can see it works for a while (until the buffer is empty?) but then I get "no mp" 
and "discarding very old packet". I really don't understand why the scheduling is'n 
syncronized with Linphones sendintervals!

Anyway, here is an extract from my testcode (I have looked at rtprecv.c):

/* Initiate the oRTP library. */

 ortp_init();

 ortp_scheduler_init();



 /* Create new RTP session that only receives*/

 rtpSes = rtp_session_new(RTP_SESSION_RECVONLY);



 /* Set RTP session in no scheduling mode (send with recv/send)*/

 rtp_session_set_scheduling_mode(rtpSes, 1);



 /* Set RTP session in no blocking mode (return immediately)*/

 rtp_session_set_blocking_mode(rtpSes, 1);



  /* Set the local RTP address */

 i = rtp_session_set_local_addr(rtpSes, myIP, 10500);

 printf("\nRTP local adr = %i", i);

 /* Receive data and write it to the soundcard */

 j=0;

 timeStamp = 0;

 while(j < 100)

   {

      /* gint rtp_session_recv_with_ts(RtpSession *session,

          gchar *buffer,

          gint len,

          guint32 time,

          gint *have_more); */

     i = rtp_session_recv_with_ts(rtpSes, recvBuf, 160, timeStamp, &have_more);

     printf("\nhave more: %i", have_more);

     printf("\nRTP status: %i", i);

     printf("\nRTP packet: %i\n\n", j);



       if(i > 0)

        {

          i=0;

          while(i < 160)

            {

              acode = (unsigned char)recvBuf[i];

              pcm_val = alaw2linear(acode);

              audioBuf[i] = pcm_val;

              i++;

            }



          if((len = write(soundDev_fd, audioBuf, 160)) == -1)

            {

              perror("\naudio write fault");

              exit(1);

            }

}


      timeStamp += 160;

      j++;

   }

 /* Stop the RTP session and uninitialize the RTP library */

 rtp_session_destroy(rtpSes);

 ortp_exit();



I guess I must have done something wrong! I really appreciate any help on this!

THANK YOU!




--
*****************************
TOMAS LUNDQVIST
www.tomaslundqvist.com
address@hidden
*****************************

--


_______________________________________________
Linphone-developers mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/linphone-developers








reply via email to

[Prev in Thread] Current Thread [Next in Thread]