Re: Correlating SOF with host system time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 5 Dec 2012 10:35:31 -0500 (EST)
Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:

> On Wed, 5 Dec 2012, Stefan Tauner wrote:
> 
> > > Running NTP over a USB-based network link would certainly be the 
> > > easiest solution, if your device can support it.  Over the long run, it 
> > > might even be more accurate on average than using SOF packets.
> > 
> > We are talking about microcontrollers with a few kB RAM at most, so
> > just cross-compiling any (S)NTP client wont cut it probably :)
> > So the SOF approach seems to be way more elegant and easy to implement
> > to me... in theory.
> 
> Your theory omits an important point: The host system generally doesn't 
> care exactly when frames start.  Forcing it to keep track of these 
> events adds overhead.

Yes, it does, but that overhead is largely negligible when you have an
overpowered x86 machine on one side and a number of tiny
microcontrollers on the other. :)

> > Another nice property is that SOF packets are sent for every frame in
> > any case (but errors) and they are broadcasted, which is both
> > advantageous regarding bandwidth usage and independent of the number of
> > devices attached.
> 
> It may not be all that advantageous after all, because you still have
> to unicast the information for relating timestamps to SOF packets.  
> Since you have to do this anyway, you might as well use those unicast
> packets for synchronization instead of the SOF packets.

Yes, but OTOH the timestamp information is not needed that often once
the clocks are in sync (and kept that way, e.g. by "good enough"
oscillators or by SOF packets). But that's also true for a scheme w/o
frame numbers; so i think that's what i will end up trying first:
averaging the latency by sending a burst of messages forth and back,
then continuing to sync via SOF packets for a while (if that's
necessary), repeat; and see how far i get with that or a variation of
it.

Thanks for the inputs and ill report back, when i have some interesting
findings. I would still like to know how one would/should implement the
frame number-based scheme in a current linux kernel if anyone wants to
elaborate on that...

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux