[Linuxptp-users] Dynamically sync clocks with phc2sys depending on master/slave
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Peter B. <pe...@be...> - 2021-10-12 20:03:56
|
Hi, I'm currently working on a network product using gPTP configuration for PTP sync. The device shall be a AVB endpoint handling audio and according to Avnu specifications all endpoint shall be capable of being master on the network. Some plugins for AVB (such as gstreamer and alsa-plugins) require that system time (CLOCK_REALTIME) is in sync with PHC to get correct timing. I see different cases depending on if the device is master or slave. If the device is slave I would like to sync PHC to CLOCK_REALTIME. The other way around, if device is master I would like to sync CLOCK_REALTIME to PHC. To the question; is there a way to use phc2sys and handle this automatically? What I currently do manually is (linuxptp version 3.1): $ ptp4l -i eth1 -f /etc/linuxptp/gPTP.cfg On the device becoming master: $ phc2sys -c eth1 -s CLOCK_REALTIME --step_threshold=1 --transportSpecific=1 -w On the device becoming slave: $ phc2sys -c CLOCK_REALTIME -s eth1 --step_threshold=1 --transportSpecific=1 -w It would be good if the above could be dynamic. Starting everything as services and let the system sync itself. /Peter |