> -----Original Message-----
> From: Juergen Werner <pogoj...@gmx.net>
> Sent: Friday, January 15, 2021 9:33 AM
> To: linuxptp-users@lists.sourceforge.net
> Subject: [Linuxptp-users] Sync arbitrary clock to PHC
> 
> Hi all,
> 
> in my media streaming application I need to synchronize the stream
> output to a PTP GM. To do so, I have used ptp4l + phc2sys and then read
> CLOCK_REALTIME or CLOCK_TAI. This works well, but my problem is that the
> GM *might* be at randomized time and date, which is bad for the system
> time keeping.
> 

It's not possible to get the GM at least in some sync? NTP or something would 
get it close enough to nominal time for your purpose I  would think?

> I thought about using the PHC directly, but as I understand the time
> retrieval is contraint by bus speed and jitter, which is bad for low
> latency media streaming synchronization. Using phc2sys mitigates these
> constraints through algorithms I cannot even begin to understand and the
> clock retrieval from CLOCK_REALTIME is incredibly fast.
> 
> So my question would be: Is there a way to use the synchronization
> algorithms of phc2sys for a "virtual" clock either in shared memory
> through a daemon process (maybe even phc2sys itself) or inside my
> application. So I can have fast, stable read outs of the PTP clock,
> while keeping the system clock PTP independent?
> 

You could skip phc2sys, but the readouts for most PHC devices are not fast, so 
that's not great. I think you'd have to have a platform that has multiple 
clocks internally in order to do this... I think it would be much better to 
just get your GM to not have a randomized time. You could fix it periodically 
by hand, or you could use NTP. That would be significantly easier. GM clocks 
*should* be fairly stable, so I don't see why setting it manually would be 
problematic. Additionally, most GMs should have *some* mechanism you could 
setup to get the device in sync automatically such as GPS, NTP, etc...

> Thanks,
> jotz
> 
> 
> _______________________________________________
> Linuxptp-users mailing list
> Linuxptp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxptp-users


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to