Hi, Incrementing the timestamp by the value returned by rtp_session_recv_with_ts() is a bad idea. Increment it by 10 or 20 ms, converted into samples unit, so 80 or 160 using a 8000Hz clockrate.
Simon Le Thursday 10 January 2008 02:23:49 god lu, vous avez écrit : > Hi all, > I am using ortp to send and receive audio packets bwtween my pc and > developing board. I have made oRTP work in schedule mode not in blocking > mode, the code is: > > *mysession = rtp_session_new(RTP_SESSION_SENDRECV);* > * rtp_session_set_scheduling_mode(mysession, 1); * > * rtp_session_set_blocking_mode(mysession, 0);* > > * rtp_session_enable_adaptive_jitter_compensation(mysession, TRUE); > rtp_session_set_recv_buf_size(mysession,1024); > rtp_session_set_local_addr(mysession, _localip, 10500); > rtp_session_set_remote_addr(mysession, remote_sdp_audio_ip, > remote_sdp_audio_port); > > rtp_session_set_payload_type(mysession, payload);* > > when receiving packets i use : > * SessionSet *recv_session_set; > recv_session_set = session_set_new(); > session_set_set(recv_session_set, mysession);* > * * > * while(1)* > * {* > * ret = session_set_select(recv_session_set, NULL, NULL); > if((ret != -1) && session_set_is_set(recv_session_set, mysession)) > { > i = rtp_session_recv_with_ts(mysession, data_in, length, > timestamp, &have_more); * > * if (i > 0)* > { > * // then i save the data_in to a file and do other > things.* > *timestamp += i;* > } > * * > * }* > * // do other thins* > * }* > when I send the packets I use *rtp_session_send_with_ts( ) *to send > packets directly. Both my board and pc work in the same way. > > And the problem is, when I speak about 10s on the board side (i save my > voice to a file), and the pc side receive about 8s of my voice ( i also > save the packets received to a file). > According to reading the source code, I know in schedule mode (the > blocking mode is off), we can use *session_set_select* to block the thread > until the packet arrives, then we can use *rtp_session_recv_with_ts *to > receive packets. > But now, obviously there are some packets lost. In my program the packet > size is 320, and the timestamp is incresed by 320. > > Would anyone please give me some advice to solve this problem? > Any other care needs to be taken.? > * * > By the way, when I set both blocking mode and schedule mode on, there are > more packets lost. > > Thank you in advance! _______________________________________________ Linphone-users mailing list Linphone-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/linphone-users