PTP component of AVB module

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
kean
Member++
Posts: 19
Joined: Tue Sep 27, 2011 11:49 am

PTP component of AVB module

Post by kean »

Hi all

I took a look at the AVB module architecture.

I straight noticed that the PTP time reference is provided by an external clock and PLL. I would like to know if it was decided to do so just because in this way it is easy to interface the AUDIO CODEC to the PLL component. Or did you adopted this solution because it was just impossible to implement PTP using one timer of the XCore as time reference?


User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

kean wrote:Hi all

I took a look at the AVB module architecture.

I straight noticed that the PTP time reference is provided by an external clock and PLL. I would like to know if it was decided to do so just because in this way it is easy to interface the AUDIO CODEC to the PLL component. Or did you adopted this solution because it was just impossible to implement PTP using one timer of the XCore as time reference?
Hi kean,

I think you're confused between the audio clock and the PTP clock. The PTP clock is not provided by the PLL - it is based on the XCore internal 100 MHz reference clock. If you look in gptp.c you'll see calls to a function named get_local_time() that returns a 32 bit value from this clock. The global PTP time is converted to and from this local time and adjusted based on the PTP Grandmaster.

The audio clock is typically recovered from and locked onto an incoming 1722 stream. The LRCLK is adjusted via a control loop that minimises the difference between the time a sample was actually played out at and the presentation time that it should have been played out at. The media clock server thread does this by receiving local timestamps taken in the I2S thread, converting these timestamps to PTP timestamps and comparing them to the 1722 presentation time.

The LRCLK is output to an audio PLL that multiplies it up to produce a low jitter master clock.
User avatar
kean
Member++
Posts: 19
Joined: Tue Sep 27, 2011 11:49 am

Post by kean »

Hi Andy

Thank you a lot! In fact I just looked at the architecture representation and I misunderstood some details. Now everything makes more sense...
User avatar
kean
Member++
Posts: 19
Joined: Tue Sep 27, 2011 11:49 am

Post by kean »

Hi Andy

could you tell me how many threads you used to implement just the PTP part?

Sorry for reopening this thread but I had to put aside this project for a while...

Cheers
Kean
ozel
Active Member
Posts: 45
Joined: Wed Sep 08, 2010 10:16 am

Post by ozel »

PTP needs just one thread, but of course you need also at least the ethernet server component.
You can find the resource usage of the whole AVB stack in the AVB Design Guide http://www.xmos.com/published/avb-refer ... gn-guide-0
User avatar
kean
Member++
Posts: 19
Joined: Tue Sep 27, 2011 11:49 am

Post by kean »

thank you ozel