Skip to content

Commit

Permalink
ALSA: firewire-lib: fix wrong value for FDF field as an empty packet
Browse files Browse the repository at this point in the history
This commit fix out of specification about the value of FDF field in out packet
with 'no data'. This affects blocking mode.

According to IEC 61883-6, there is two way to generate AMDTP packets include no
data in blocking mode.

Way 1. an empty packet defined in IEC 61883-1
 - Size of packet is 2 quadlets.
 - The value of FDF is sfc.
 - The packet includes only CIP headers

Way 2. a special non-empty packet defined in IEC 61883-6
 - Size of packet is following to blocking mode
 - The value of FDF is 0xff. This value is 'NO-DATA'. This means 'The receiver'
   must ignore all the data in a CIP with this FDF code'.
 - The packet includes dummy data.

But current implementation is a combination of them.
 - Size of packet is 2 (way 1)
 - FDF = 0xff (way 2)
This causes BeBoB chipset cannot sound.

This patch applies Way 1.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Sakamoto authored and Takashi Iwai committed Nov 22, 2013
1 parent 5db4d34 commit 82755ab
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions sound/firewire/amdtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,14 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle)
return;
index = s->packet_index;

/* this module generate empty packet for 'no data' */
syt = calculate_syt(s, cycle);
if (!(s->flags & CIP_BLOCKING)) {
if (!(s->flags & CIP_BLOCKING))
data_blocks = calculate_data_blocks(s);
} else {
if (syt != 0xffff) {
data_blocks = s->syt_interval;
} else {
data_blocks = 0;
syt = 0xffffff;
}
}
else if (syt != 0xffff)
data_blocks = s->syt_interval;
else
data_blocks = 0;

buffer = s->buffer.packets[index].buffer;
buffer[0] = cpu_to_be32(ACCESS_ONCE(s->source_node_id_field) |
Expand Down

0 comments on commit 82755ab

Please sign in to comment.