<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear all,</div><div dir="ltr"><br></div><div dir="ltr">I am trying to synchronize two audio streams sent over RTP and am not getting the results i hoped for.<br><div><br></div><div>I have three devices where the system time is synchronized using PTP. Two of these devices are are running an RTP server streaming sampled audio to a RTP client running on the third device. On the RTP server devices i have synchronized the sampling clock to PTP. I have measured the sampling time and system clock to be synchronized with an accuracy better than 100 ns.</div><div><br></div><div>If i connect the same signal generator output to both servers and listen to the received streams on the RTP client device, there are phase differences in the ms range. The phase difference is changing with each RTCP packet.</div><div><br></div><div>Below is my RTP server and client setup. It is based on information found on this list. I would like to know if any of you can see some obvious mistakes.</div><div><br></div><div>The RTP servers are an C implementation of the pipelines</div><div><br></div><div><div>gst-launch-1.0 -v rtpbin name=rtpbin alsasrc !  audio/x-raw,format=S32LE,rate=48000,width=32,depth=32,channels=2 ! audioconvert ! rtpL24pay ! rtpbin.send_rtp_sink_0    rtpbin.send_rtp_src_0 ! udpsink host=192.168.0.1 port=5002 rtpbin.send_rtcp_src_0 ! udpsink host=192.168.0.1 port=5003 sync=false async=false udpsrc port=5007 ! rtpbin.recv_rtcp_sink_0</div><div><br></div><div>gst-launch-1.0 -v rtpbin name=rtpbin alsasrc !  audio/x-raw,format=S32LE,rate=48000,width=32,depth=32,channels=2 ! audioconvert ! rtpL24pay ! rtpbin.send_rtp_sink_0    rtpbin.send_rtp_src_0 ! udpsink host=192.168.0.1 port=5008 rtpbin.send_rtcp_src_0 ! udpsink host=192.168.0.1 port=5009 sync=false async=false udpsrc port=5013 ! rtpbin.recv_rtcp_sink_0</div></div><div><br></div><div>The RTP client is a C implementation of the pipeline</div><div><br></div><div><div>gst-launch-1.0 -v rtpbin name=rtpbin udpsrc caps="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)L24,encoding-params=(string)2,channels=(int)2, payload=(int)96" port=5002 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtpL24depay ! audioconvert ! alsasink udpsrc port=5003 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink host=192.168.0.2 port=5007 sync=false async=false udpsrc caps="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)L24,encoding-params=(string)2,channels=(int)2, payload=(int)96" port=5008 ! rtpbin.recv_rtp_sink_1 rtpbin. ! rtpL24depay ! audioconvert ! alsasink udpsrc port=5009 ! rtpbin.recv_rtcp_sink_1 rtpbin.send_rtcp_src_1 ! udpsink host=192.168.0.3 port=5013 sync=false async=false</div></div><div><br></div><div>In order to achive synchronization i add the following properties to the RTP server rtpbin</div><div><br></div><div>g_object_set(rtpbin, "ntp-time-source", 0, "rtcp-sync-send-time", FALSE,  NULL);<br></div><div><br></div><div>and the following properties to the RTP client rtpbin</div><div><br></div><div>g_object_set(rtpbin, "ntp-time-source", 0, "buffer-mode", 4, "ntp-sync", TRUE, NULL);</div><div><br></div><div>All the best,</div><div>Mikkel Pihl</div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div></div>