ALSA: firewire-motu: fix rx packet format at higher rate for MOTU 828 mk3 Hybrid
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 18 Jun 2021 04:07:13 +0000 (13:07 +0900)
committerTakashi Iwai <tiwai@suse.de>
Fri, 18 Jun 2021 07:42:42 +0000 (09:42 +0200)
I assumed that the combination of packet formats for MOTU 828 mk3 Hybrid
is the same as MOTU 828 mk3 FireWire. However at higher sampling rate, it
is different. MOTU 828 mk3 Hybrid has additional 4 dummy data chunks for
rx packet.

This commit fixes the issue to which I address at a commit f2ac3b839540
("ALSA: firewire-motu: sequence replay for source packet header").

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210618040713.114611-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/motu/motu-protocol-v3.c
sound/firewire/motu/motu.c
sound/firewire/motu/motu.h

index 4e6b0e449ee45ecb94605c81ec312cfbd77226b0..77e61e89770b52cc9fbcb2df5200ac753f494501 100644 (file)
@@ -185,7 +185,7 @@ int snd_motu_protocol_v3_get_clock_source(struct snd_motu *motu,
                return err;
        data = be32_to_cpu(reg) & V3_CLOCK_SOURCE_MASK;
 
-       if (motu->spec == &snd_motu_spec_828mk3)
+       if (motu->spec == &snd_motu_spec_828mk3_fw || motu->spec == &snd_motu_spec_828mk3_hybrid)
                return detect_clock_source_828mk3(motu, data, src);
        else
                return v3_detect_clock_source(motu, data, src);
@@ -284,14 +284,14 @@ int snd_motu_protocol_v3_cache_packet_formats(struct snd_motu *motu)
               motu->spec->rx_fixed_pcm_chunks,
               sizeof(motu->rx_packet_formats.pcm_chunks));
 
-       if (motu->spec == &snd_motu_spec_828mk3)
+       if (motu->spec == &snd_motu_spec_828mk3_fw || motu->spec == &snd_motu_spec_828mk3_hybrid)
                return detect_packet_formats_828mk3(motu, data);
        else
                return 0;
 }
 
 
-const struct snd_motu_spec snd_motu_spec_828mk3 = {
+const struct snd_motu_spec snd_motu_spec_828mk3_fw = {
        .name = "828mk3",
        .protocol_version = SND_MOTU_PROTOCOL_V3,
        .flags = SND_MOTU_SPEC_RX_MIDI_3RD_Q |
@@ -300,6 +300,15 @@ const struct snd_motu_spec snd_motu_spec_828mk3 = {
        .rx_fixed_pcm_chunks = {14, 14, 10},
 };
 
+const struct snd_motu_spec snd_motu_spec_828mk3_hybrid = {
+       .name = "828mk3",
+       .protocol_version = SND_MOTU_PROTOCOL_V3,
+       .flags = SND_MOTU_SPEC_RX_MIDI_3RD_Q |
+                SND_MOTU_SPEC_TX_MIDI_3RD_Q,
+       .tx_fixed_pcm_chunks = {18, 18, 14},
+       .rx_fixed_pcm_chunks = {14, 14, 14},    // Additional 4 dummy chunks at higher rate.
+};
+
 const struct snd_motu_spec snd_motu_spec_ultralite_mk3 = {
        .name = "UltraLiteMk3",
        .protocol_version = SND_MOTU_PROTOCOL_V3,
index 0cae670d711ca4cbfaf0b0e6e1a5b1871f8b3587..543136578c7002cb434bf0078404d440fb73f691 100644 (file)
@@ -156,10 +156,10 @@ static const struct ieee1394_device_id motu_id_table[] = {
        SND_MOTU_DEV_ENTRY(0x000009, &snd_motu_spec_traveler),
        SND_MOTU_DEV_ENTRY(0x00000d, &snd_motu_spec_ultralite),
        SND_MOTU_DEV_ENTRY(0x00000f, &snd_motu_spec_8pre),
-       SND_MOTU_DEV_ENTRY(0x000015, &snd_motu_spec_828mk3), // FireWire only.
+       SND_MOTU_DEV_ENTRY(0x000015, &snd_motu_spec_828mk3_fw), // FireWire only.
        SND_MOTU_DEV_ENTRY(0x000019, &snd_motu_spec_ultralite_mk3), // FireWire only.
        SND_MOTU_DEV_ENTRY(0x000030, &snd_motu_spec_ultralite_mk3), // Hybrid.
-       SND_MOTU_DEV_ENTRY(0x000035, &snd_motu_spec_828mk3), // Hybrid.
+       SND_MOTU_DEV_ENTRY(0x000035, &snd_motu_spec_828mk3_hybrid), // Hybrid.
        SND_MOTU_DEV_ENTRY(0x000033, &snd_motu_spec_audio_express),
        SND_MOTU_DEV_ENTRY(0x000045, &snd_motu_spec_4pre),
        { }
index a3deabdf9e3452b02ed67b51c64def836609cdcf..73f36d1be515f275319531fa5a440a1c9dcece5a 100644 (file)
@@ -130,7 +130,8 @@ extern const struct snd_motu_spec snd_motu_spec_traveler;
 extern const struct snd_motu_spec snd_motu_spec_ultralite;
 extern const struct snd_motu_spec snd_motu_spec_8pre;
 
-extern const struct snd_motu_spec snd_motu_spec_828mk3;
+extern const struct snd_motu_spec snd_motu_spec_828mk3_fw;
+extern const struct snd_motu_spec snd_motu_spec_828mk3_hybrid;
 extern const struct snd_motu_spec snd_motu_spec_ultralite_mk3;
 extern const struct snd_motu_spec snd_motu_spec_audio_express;
 extern const struct snd_motu_spec snd_motu_spec_4pre;