Skip to content

Commit

Permalink
ALSA: firewire-lib: fix initial value of data block count for IR cont…
Browse files Browse the repository at this point in the history
…ext without CIP_DBC_IS_END_EVENT

For IR context, ALSA IEC 61883-1/6 engine uses initial value of data
block counter as UINT_MAX, to detect first isochronous packet in the
middle of packet streaming.

At present, when CIP_DBC_IS_END_EVENT is not used (i.e. for drivers except
for ALSA fireworks driver), the initial value is used as is for
tracepoints event. However, the engine can detect the value of dbc field
in the payload of first isochronous packet and the value should be assigned
to the event.

This commit fixes the bug.

Fixes: 7686486 ("ALSA: firewire-lib: cache next data_block_counter after probing tracepoints event for IR context")
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
takaswie authored and tiwai committed Jul 8, 2019
1 parent 7fbf909 commit 4ece7f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/firewire/amdtp-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ static int parse_ir_ctx_header(struct amdtp_stream *s, unsigned int cycle,
*dbc = 0;
}

if (err >= 0 && s->flags & CIP_DBC_IS_END_EVENT)
s->data_block_counter = *dbc;
if (err < 0)
return err;

s->data_block_counter = *dbc;

trace_amdtp_packet(s, cycle, cip_header, *payload_length, *data_blocks,
index);
Expand Down

0 comments on commit 4ece7f6

Please sign in to comment.