From: Daniel W. <wa...@mo...> - 2010-12-15 07:25:12
|
Hi Pieter On Tue, Dec 14, 2010 at 08:02:08PM +0100, Pieter Palmers wrote: > >>>>I've more formally summarized the AMDTP timestamp calculation strategies > >>>>as I see them in: > >>>>http://www.ffado.org/download/amdtp_timestamp_notes.pdf > >>>> > >>>>In it I conclude that the pseudo-code is only valid if queue_length % 16 > >>>>== 0. > >>> > >>>>"TPF represents the number of ticks per audio frame, and is not > >>>> independent from the bus configuration." > >>> > >>>But the ticks are based on the bus clock, which runs at a constant > >>>speed, and the audio frames are based on some internal or external > >>>clock, which also runs at a constant speed. So how does this depend > >>>on the bus configuration? > >> > >>Suppose that the audio clock is generated externally by e.g. a dedicated > >>wordclock generator that is set to 48000 frames/sec. Let's define time > >>in function of this external clock, i.o.w. there are exactly 48000 > >>frames in one 'wordclock second' (wc_sec). > >> > >>This audio clock is then connected to the firewire audio device that > >>syncs on this external clock. It will therefore sample exactly 48000 > >>frames/wc_sec. => frames/wc_sec = 48000 > >> > >>The firewire audio device (FAD) is connected to the PC through the > >>firewire bus. One way or the other a bus master election mechanism chose > >>a cycle master. This will generate the 1394 clock to be 24576000 ticks > >>per 'firewire second'. => ticks / fw_sec = 24576000. > >> > >>Therefore the number of ticks per frame is: > >>TPF = 2457600 ticks/fw_sec / (48000 frames/wc_sec) > >> = 512 ticks/frame * wc_sec/fw_sec > > > >I might have missed it, but where do you address the problem, that the > >external word clock and firewire clock are not in sync? > > Through the wc_sec/fw_sec ratio, which represents the ratio between > one 'word clock second' and one 'firewire second'. Thanks for the clarification. I thought that TPF is a value calculated only once. But if I understood you correctly this is something one has to calculate on regular basis, because the clocks can drift. cheers, daniel |