[PD] packOSC TimeTag realtime vs. logicaltime
Martin Peach
martin.peach at sympatico.ca
Fri Oct 9 05:54:25 CEST 2009
Wolfgang Jäger wrote:
> Hello,
>
> I'm using a combination of [pack~] [packOSC] -> transmission(UDP) ->
> [unpackOSC] and a modified version of [unpack~] to send Audio over OSC.
> The OSC packages are sent as Bundles so a TimeTag is generated at the
> sender's side. I extended the [unpackOSC] object with another outlet
> where I'm getting the particular TimeTag of each Bundle.
> In the modified version of [unpack~] I evaluate these TimeTags with
> regards to dropouts in the transmission.
> My problem is that the TimeTags are not accurate, what I ascribe to the
> fact, that the TimeTag in [packOSC] is generated as "real time" instead
> of "logical time". Using "real time" the TimeTag-"Output" is a function
> of the audiobuffersize (depending on the cpu load), so in my case, as
> the CPU-load is quite big, the values of the TimeTags are not useable
> for sequencing the datastream (as there are jumps in the TimeTag I
> always assume some packages got lost).
> As a workaround I established a sequence number, which is additionally
> transmitted in each Bundle. This is an appropiate solution, but it
> wouldn't be necessary if the TimeTag would be generated properly.
> Are my considerations conclusive?
>
At the moment the timetag is calculated when the bundle is opened with
the [ message. If the ] message doesn't occur at the same time the
timetag will be wrong as the message doesn't start to get sent until the
bundle is closed. Then there is the delay in the OS as it schedules the
packet for the network and the network card deals with possible
collisions with other packets, etc...
As well, anything [packOSC] does occurs between audio blocks (and may be
postponed if there is too much going on), so the timing will be jittery
unless your packets are being composed and sent in precise sync with the
audio. And if they are being sent to another machine with another clock
of course this is never going to happen unless you can sync their sound
cards via SPDIF or word clock. But that's real time.
Because there is no way to know what the 'logical time' is outside of
your logical frame, just use the sequential block number as your logical
time. Pack a sequence number followed by a blob, possibly resetting the
sequence numbers when they get too big. No need for bundle or timetag.
Martin
More information about the Pd-list
mailing list