[alsa-devel] [PATCH 10/39] firewire-lib: Add transfer delay to synchronized duplex streams

Clemens Ladisch clemens at ladisch.de
Sun Mar 9 22:13:30 CET 2014

Takashi Sakamoto wrote:
> Currently, in duplex streams with synchronization mode, this module just pass
> 'presentation timestamp' from in-packets to out-packets. This is enough to
> handle actual device but logically the timestamp should include
> 'transfer delay' and 'processing time'. This means the timestamp in out-packet
> should be at future.
> To be simple, this commit add only 'transfer delay'.

> +		*syt += (s->transfer_delay / TICKS_PER_CYCLE) << 12;
> +		*syt += s->transfer_delay % TICKS_PER_CYCLE;
> +		*syt &= CIP_SYT_MASK;

The transfer delay is the offset between the frame in which the packet
is transmitted and the intended presentation time.  This delay was
already added by the device when it sent the input packets, so we
don't need to send it again.

The frame in which the out-packet will be sent is QUEUE_LENGTH
frames later than that of the in-packet, so we need to adjust the
SYT by that amount.  (However, 48 % 16 == 0.)


More information about the Alsa-devel mailing list