All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: firewire-motu: fix rx packet format at higher rate for MOTU 828 mk3 Hybrid
@ 2021-06-18  4:07 Takashi Sakamoto
  2021-06-18  7:43 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2021-06-18  4:07 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel, clemens

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>
---
 sound/firewire/motu/motu-protocol-v3.c | 15 ++++++++++++---
 sound/firewire/motu/motu.c             |  4 ++--
 sound/firewire/motu/motu.h             |  3 ++-
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/sound/firewire/motu/motu-protocol-v3.c b/sound/firewire/motu/motu-protocol-v3.c
index 4e6b0e449ee4..77e61e89770b 100644
--- a/sound/firewire/motu/motu-protocol-v3.c
+++ b/sound/firewire/motu/motu-protocol-v3.c
@@ -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,
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index 0cae670d711c..543136578c70 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -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),
 	{ }
diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h
index a3deabdf9e34..73f36d1be515 100644
--- a/sound/firewire/motu/motu.h
+++ b/sound/firewire/motu/motu.h
@@ -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;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: firewire-motu: fix rx packet format at higher rate for MOTU 828 mk3 Hybrid
  2021-06-18  4:07 [PATCH] ALSA: firewire-motu: fix rx packet format at higher rate for MOTU 828 mk3 Hybrid Takashi Sakamoto
@ 2021-06-18  7:43 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2021-06-18  7:43 UTC (permalink / raw)
  To: Takashi Sakamoto; +Cc: alsa-devel, clemens

On Fri, 18 Jun 2021 06:07:13 +0200,
Takashi Sakamoto wrote:
> 
> 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>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-18  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  4:07 [PATCH] ALSA: firewire-motu: fix rx packet format at higher rate for MOTU 828 mk3 Hybrid Takashi Sakamoto
2021-06-18  7:43 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.