diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-04-25 09:45:27 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-26 08:32:33 -0400 |
commit | 9d59124cacf5d0a1e89aee83de6233bdf97afdb1 (patch) | |
tree | c2d5db4b7b360f6d59562f05c5ec2ccc4d88b668 /sound/firewire | |
parent | 3149ac489ff8dea0c305c7f97ac2a1b4ad54f5be (diff) |
ALSA: bebob/firewire-lib: Add a quirk of wrong dbc in empty packet for M-Audio special Firewire series
M-Audio Firewire 1814 has a quirk, ProjectMix I/O also has. They transmit
empty packet with wrong value of dbc incremented by 8 at high sampling rate.
According to IEC 61883-1, this value should be the same as the one in
previous packet.
This commit adds a flag named as CIP_EMPTY_HAS_WRONG_DBC. With flag, the value
of dbc in empty packet is overwittern by an expected value.
This is an example of this quirk:
CIP Header 0 CIP Header 1 Payload size
010D0000 9004F759 210
010D0010 90040B59 210
010D0020 90042359 210
01020028 9004FFFF 2 <-
010D0030 90043759 210
010D0040 90044B59 210
010D0050 90046359 210
01020058 9004FFFF 2 <-
010D0060 90047759 210
010D0070 90048B59 210
010D0080 9004A359 210
01020088 9004FFFF 2 <-
010D0090 9004B759 210
010D00A0 9004CB59 210
010D00B0 9004E359 210
010200B8 9004FFFF 2 <-
010D00C0 9004F759 210
010D00D0 90040B59 210
010D00E0 90042359 210
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r-- | sound/firewire/amdtp.c | 4 | ||||
-rw-r--r-- | sound/firewire/amdtp.h | 3 | ||||
-rw-r--r-- | sound/firewire/bebob/bebob_stream.c | 7 |
3 files changed, 14 insertions, 0 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index 690c60828872..e573f253e39d 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c | |||
@@ -665,6 +665,10 @@ static void handle_in_packet(struct amdtp_stream *s, | |||
665 | 665 | ||
666 | /* Check data block counter continuity */ | 666 | /* Check data block counter continuity */ |
667 | data_block_counter = cip_header[0] & AMDTP_DBC_MASK; | 667 | data_block_counter = cip_header[0] & AMDTP_DBC_MASK; |
668 | if (data_blocks == 0 && (s->flags & CIP_EMPTY_HAS_WRONG_DBC) && | ||
669 | s->data_block_counter != UINT_MAX) | ||
670 | data_block_counter = s->data_block_counter; | ||
671 | |||
668 | if (((s->flags & CIP_SKIP_DBC_ZERO_CHECK) && data_block_counter == 0) || | 672 | if (((s->flags & CIP_SKIP_DBC_ZERO_CHECK) && data_block_counter == 0) || |
669 | (s->data_block_counter == UINT_MAX)) { | 673 | (s->data_block_counter == UINT_MAX)) { |
670 | lost = false; | 674 | lost = false; |
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h index c79f058f1621..d8ee7b0e9386 100644 --- a/sound/firewire/amdtp.h +++ b/sound/firewire/amdtp.h | |||
@@ -27,6 +27,8 @@ | |||
27 | * skipped for detecting discontinuity. | 27 | * skipped for detecting discontinuity. |
28 | * @CIP_SKIP_INIT_DBC_CHECK: Only for in-stream. The value of dbc in first | 28 | * @CIP_SKIP_INIT_DBC_CHECK: Only for in-stream. The value of dbc in first |
29 | * packet is not continuous from an initial value. | 29 | * packet is not continuous from an initial value. |
30 | * @CIP_EMPTY_HAS_WRONG_DBC: Only for in-stream. The value of dbc in empty | ||
31 | * packet is wrong but the others are correct. | ||
30 | */ | 32 | */ |
31 | enum cip_flags { | 33 | enum cip_flags { |
32 | CIP_NONBLOCKING = 0x00, | 34 | CIP_NONBLOCKING = 0x00, |
@@ -37,6 +39,7 @@ enum cip_flags { | |||
37 | CIP_WRONG_DBS = 0x10, | 39 | CIP_WRONG_DBS = 0x10, |
38 | CIP_SKIP_DBC_ZERO_CHECK = 0x20, | 40 | CIP_SKIP_DBC_ZERO_CHECK = 0x20, |
39 | CIP_SKIP_INIT_DBC_CHECK = 0x40, | 41 | CIP_SKIP_INIT_DBC_CHECK = 0x40, |
42 | CIP_EMPTY_HAS_WRONG_DBC = 0x80, | ||
40 | }; | 43 | }; |
41 | 44 | ||
42 | /** | 45 | /** |
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 2695b7899410..3e74d9b1e357 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c | |||
@@ -457,6 +457,13 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) | |||
457 | /* See comments in next function */ | 457 | /* See comments in next function */ |
458 | init_completion(&bebob->bus_reset); | 458 | init_completion(&bebob->bus_reset); |
459 | bebob->tx_stream.flags |= CIP_SKIP_INIT_DBC_CHECK; | 459 | bebob->tx_stream.flags |= CIP_SKIP_INIT_DBC_CHECK; |
460 | /* | ||
461 | * At high sampling rate, M-Audio special firmware transmits empty | ||
462 | * packet with the value of dbc incremented by 8 but the others are | ||
463 | * valid to IEC 61883-1. | ||
464 | */ | ||
465 | if (bebob->maudio_special_quirk) | ||
466 | bebob->tx_stream.flags |= CIP_EMPTY_HAS_WRONG_DBC; | ||
460 | 467 | ||
461 | err = amdtp_stream_init(&bebob->rx_stream, bebob->unit, | 468 | err = amdtp_stream_init(&bebob->rx_stream, bebob->unit, |
462 | AMDTP_OUT_STREAM, CIP_BLOCKING); | 469 | AMDTP_OUT_STREAM, CIP_BLOCKING); |