Re: Word synchronization of multiple PowerMACs audio outputs
Re: Word synchronization of multiple PowerMACs audio outputs
- Subject: Re: Word synchronization of multiple PowerMACs audio outputs
- From: Jeff Moore <email@hidden>
- Date: Thu, 24 Jul 2008 12:03:47 -0700
On Jul 23, 2008, at 8:13 PM, David Norman wrote:
I have spent a day trying to track down the answer to this, and I
think I have learned a lot, but not quite enough...
I have a multi-machine setup. If I start QT player on all machines
as good as simultaneously, after a long time they drift out of sync.
They are playing a long ambient track, so there is plenty of time
for this to happen. I know that this is because 44.1kHZ on one
machine isn't the same as on another. I have verified this by
monitoring the analogue waveforms on a multi-channel scope.
This is true. Pretty much every device runs at a rate that is close,
but not quite, the nominal sample rate.
So, I have been looking at the Aggregate Devices to see if I can
synchronize the machines word clocks. I have created an aggregate
device which has Digital In, Digital Out and Line out, and has the
Digital In as the clock source.
I presume that you mean that you are checking the "Clock" radio button
next to the digital input's name in the aggregate device editor in
Audio MIDI Setup, right?
My expectation was that the clock for the outputs would be derived
from the digital input, and this will keep the outputs in sync (some
sort of switch would occur in the h/w that would use the input word
clock instead of the internal one).
It does not seem to be working, there is drift, the same drift as
with decoupled machines.
Setting the master device for the aggregate device doesn't change the
hardware clock the underlying device is using.
At any rate, my understanding of the built-in digital ins and digital
outs on our devices is that the inputs will always lock to the
incoming clock. Generally, the digital outs are self clocked, but
there may be specific models where they are able to be driven by the
clock on the input. I can't remember any off the top of my head, but
I'd have to ask to be sure.
I have seen that there is a property of sound devices called
kAudioDevicePropertyClockDomain. The documentation suggests that
different domains cannot be synchronized. I have read this property
out for the different devices, and the Digital In has a different
domain than the others. This seems obvious, since the digital In is
clocked from the input source, but the rest of the hardware has no
such self-clocking input to sync to.
There is a clock domain for the aggregate device, and this is '0'.
The documentation describes this as 'unknown'.
Devices whose clock domains are non-zero and the same are synchronized
in hardware. Generally, our built-in hardware is good about making
sure the value of this property is valid. So, if they are different,
it generally means that they aren't synchronized.
I have read answers that suggest that my problem can be solved in s/
w by reading the time in the device's units
(AudioDeviceGetCurrentTime) for both the output and the input,
converting them to a common timebase, and performing some sort of
resampling on the output.
This is true. It is basically what aggregate devices do when enable
the drift correction. However, it is my understanding that you are
trying to synchronize applications running on separate machines. This
is an order of magnitude harder due to needing to get the synch info
across the various machines.
I can also imagine a situation where using MTC or SMPTE would do
this for me. Or, using an external device with a word clock in and a
master clock source.
Yup. If you want the best possible synchronization, you should use
some kind of word clock or digital synch. That allows the hardware to
do the drift correction.
The immediate problem, though, is whether I can achieve word-sync
(simply and easily) by chaining the digital IO, and not writing a
line of source code?
It seems from your description that this isn't going to work for the
hardware you have.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden