Network clock synchronization

fdigiugno filippo.digiugno at powersoft.it
Wed Oct 2 04:46:58 PDT 2013


Hi all,

I want to play the same audio on more devices at the same time. 
For this purpose I'm using a pipeline with a network clock server.

Basically everything works fine but if the connection to the clock server is
lost, when the connection is restabilished I heard annoying jams in the
audio reproduced (as far as I know this should depend by the slave-method of
the alsa sink set to GST_AUDIO_BASE_SINK_SLAVE_SKEW).
According to the documentation in this case (when the connection is lost and
then restabilished) I should pause and unpause the pipeline once I receive a
CLOCK_LOST event and a NEW_CLOCK event. 
The problem is that I didn't receive those events.
For bypass this behavior I set the slave-mode to
GST_AUDIO_BASE_SINK_SLAVE_NONE, so when a drift happens no alignment have to
be done during the pipeline playing. This can be acceptable for our
application since during a song playback the drift amount could be
acceptable (in our system all the device have the same hardware).

What for us is important is that, when a new pipeline is created,  the drift
between the network clock and the local clock is reset. 
Can you confirm this? 
Are there better ways to do what we are trying to do?

Thanks in advance.

Following more details about our implementation.
The clock in the pipeline is set in the following way:

GstClock *netclientclock = gst_net_client_clock_new("net_clock", srv, 5637,
GST_SECOND);
gst_pipeline_use_clock(GST_PIPELINE(pipe->pipeline), netclientclock);
gst_object_unref(GST_OBJECT(netclientclock));
set_sample_timeout(pipe->pipeline, sample_timeout_ns);
set_drift_tolerance(pipe->sink, drift_tolerance_us);

The following are the params that I set in the alsa sink:

g_object_set(G_OBJECT(pipe->sink),
	"provide-clock", false,
	"sync", true,
	"slave-method",2,
	NULL);

When the pipeline is created is set in pause state and will be unpaused at a
defined time by using a callback based on the network clock server time.





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Network-clock-synchronization-tp4662316.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list