ALSA: firewire-motu: add model-specific table of chunk count

In MOTU protocol, data block consists of SPH and 24-bit chunks
aligned to quadlet. The number of chunks per data block is specific
to model. For models with optical interface, the number differs
depending on I/O settings for the interface (ADAT, TOSLINK).

Currently the number is calculated from flags in model-specific
data. However this is weak in the case that the model has quirks.
Actually, for quirks of some models, flags are used against their
original meanings.

This commit adds model-specific table of chunk count. For future
integration, this table is based on the calculation.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200519111641.123211-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Sakamoto 2020-05-19 20:16:33 +09:00 committed by Takashi Iwai
parent 562f0c6700
commit dfbaa4dc11
3 changed files with 17 additions and 3 deletions

View File

@ -306,7 +306,8 @@ const struct snd_motu_spec snd_motu_spec_828mk2 = {
SND_MOTU_SPEC_HAS_OPT_IFACE_A | SND_MOTU_SPEC_HAS_OPT_IFACE_A |
SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_RX_MIDI_2ND_Q |
SND_MOTU_SPEC_TX_MIDI_2ND_Q, SND_MOTU_SPEC_TX_MIDI_2ND_Q,
.tx_fixed_pcm_chunks = {14, 14, 0},
.rx_fixed_pcm_chunks = {14, 14, 0},
.analog_in_ports = 8, .analog_in_ports = 8,
.analog_out_ports = 8, .analog_out_ports = 8,
}; };
@ -321,7 +322,8 @@ const struct snd_motu_spec snd_motu_spec_traveler = {
SND_MOTU_SPEC_HAS_OPT_IFACE_A | SND_MOTU_SPEC_HAS_OPT_IFACE_A |
SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_RX_MIDI_2ND_Q |
SND_MOTU_SPEC_TX_MIDI_2ND_Q, SND_MOTU_SPEC_TX_MIDI_2ND_Q,
.tx_fixed_pcm_chunks = {14, 14, 8},
.rx_fixed_pcm_chunks = {14, 14, 8},
.analog_in_ports = 8, .analog_in_ports = 8,
.analog_out_ports = 8, .analog_out_ports = 8,
}; };
@ -335,6 +337,8 @@ const struct snd_motu_spec snd_motu_spec_ultralite = {
SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_RX_MIDI_2ND_Q |
SND_MOTU_SPEC_TX_MIDI_2ND_Q | SND_MOTU_SPEC_TX_MIDI_2ND_Q |
SND_MOTU_SPEC_RX_SEPARATED_MAIN, SND_MOTU_SPEC_RX_SEPARATED_MAIN,
.tx_fixed_pcm_chunks = {14, 14, 0},
.rx_fixed_pcm_chunks = {14, 14, 0},
.analog_in_ports = 8, .analog_in_ports = 8,
.analog_out_ports = 8, .analog_out_ports = 8,
}; };
@ -349,6 +353,8 @@ const struct snd_motu_spec snd_motu_spec_8pre = {
SND_MOTU_SPEC_HAS_OPT_IFACE_B | SND_MOTU_SPEC_HAS_OPT_IFACE_B |
SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_RX_MIDI_2ND_Q |
SND_MOTU_SPEC_TX_MIDI_2ND_Q, SND_MOTU_SPEC_TX_MIDI_2ND_Q,
.tx_fixed_pcm_chunks = {10, 6, 0},
.rx_fixed_pcm_chunks = {10, 6, 0},
.analog_in_ports = 8, .analog_in_ports = 8,
.analog_out_ports = 2, .analog_out_ports = 2,
}; };

View File

@ -324,7 +324,8 @@ const struct snd_motu_spec snd_motu_spec_828mk3 = {
SND_MOTU_SPEC_HAS_OPT_IFACE_B | SND_MOTU_SPEC_HAS_OPT_IFACE_B |
SND_MOTU_SPEC_RX_MIDI_3RD_Q | SND_MOTU_SPEC_RX_MIDI_3RD_Q |
SND_MOTU_SPEC_TX_MIDI_3RD_Q, SND_MOTU_SPEC_TX_MIDI_3RD_Q,
.tx_fixed_pcm_chunks = {18, 18, 14},
.rx_fixed_pcm_chunks = {14, 14, 10},
.analog_in_ports = 8, .analog_in_ports = 8,
.analog_out_ports = 8, .analog_out_ports = 8,
}; };
@ -338,6 +339,8 @@ const struct snd_motu_spec snd_motu_spec_audio_express = {
SND_MOTU_SPEC_RX_SEPARATED_MAIN | SND_MOTU_SPEC_RX_SEPARATED_MAIN |
SND_MOTU_SPEC_RX_MIDI_2ND_Q | SND_MOTU_SPEC_RX_MIDI_2ND_Q |
SND_MOTU_SPEC_TX_MIDI_3RD_Q, SND_MOTU_SPEC_TX_MIDI_3RD_Q,
.tx_fixed_pcm_chunks = {10, 10, 0},
.rx_fixed_pcm_chunks = {10, 10, 0},
.analog_in_ports = 2, .analog_in_ports = 2,
.analog_out_ports = 4, .analog_out_ports = 4,
}; };
@ -349,6 +352,8 @@ const struct snd_motu_spec snd_motu_spec_4pre = {
SND_MOTU_SPEC_TX_MICINST_CHUNK | SND_MOTU_SPEC_TX_MICINST_CHUNK |
SND_MOTU_SPEC_TX_RETURN_CHUNK | SND_MOTU_SPEC_TX_RETURN_CHUNK |
SND_MOTU_SPEC_RX_SEPARATED_MAIN, SND_MOTU_SPEC_RX_SEPARATED_MAIN,
.tx_fixed_pcm_chunks = {10, 10, 0},
.rx_fixed_pcm_chunks = {10, 10, 0},
.analog_in_ports = 2, .analog_in_ports = 2,
.analog_out_ports = 2, .analog_out_ports = 2,
}; };

View File

@ -118,6 +118,9 @@ struct snd_motu_spec {
enum snd_motu_protocol_version protocol_version; enum snd_motu_protocol_version protocol_version;
enum snd_motu_spec_flags flags; enum snd_motu_spec_flags flags;
unsigned char tx_fixed_pcm_chunks[3];
unsigned char rx_fixed_pcm_chunks[3];
unsigned char analog_in_ports; unsigned char analog_in_ports;
unsigned char analog_out_ports; unsigned char analog_out_ports;
}; };