Skip to content

Commit

Permalink
ALSA: firewire-lib: use no-info SYT for packets without SYT sample
Browse files Browse the repository at this point in the history
In non-blocking mode, the SYT_INTERVAL is larger than the number of
audio frames in each packet, so there are packets that do not contain
any frame to which the SYT could be applied.  For these packets, the
SYT must not be the timestamp of the next valid SYT frame, but the
special no-info SYT value.

This fixes broken playback on the FireWave at 44.1 kHz.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Mar 15, 2011
1 parent 31ef913 commit be45436
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sound/firewire/amdtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,15 @@ static unsigned int calculate_syt(struct amdtp_out_stream *s,
syt_offset = s->last_syt_offset - TICKS_PER_CYCLE;
s->last_syt_offset = syt_offset;

syt_offset += TRANSFER_DELAY_TICKS - TICKS_PER_CYCLE;
syt = (cycle + syt_offset / TICKS_PER_CYCLE) << 12;
syt += syt_offset % TICKS_PER_CYCLE;
if (syt_offset < TICKS_PER_CYCLE) {
syt_offset += TRANSFER_DELAY_TICKS - TICKS_PER_CYCLE;
syt = (cycle + syt_offset / TICKS_PER_CYCLE) << 12;
syt += syt_offset % TICKS_PER_CYCLE;

return syt & 0xffff;
return syt & 0xffff;
} else {
return 0xffff; /* no info */
}
}

static void amdtp_write_s32(struct amdtp_out_stream *s,
Expand Down

0 comments on commit be45436

Please sign in to comment.