Skip to content

Commit dfbaa4d

Browse files
takaswietiwai
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 562f0c6 commit dfbaa4d

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

sound/firewire/motu/motu-protocol-v2.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ const struct snd_motu_spec snd_motu_spec_828mk2 = {
306306
SND_MOTU_SPEC_HAS_OPT_IFACE_A |
307307
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
308308
SND_MOTU_SPEC_TX_MIDI_2ND_Q,
309-
309+
.tx_fixed_pcm_chunks = {14, 14, 0},
310+
.rx_fixed_pcm_chunks = {14, 14, 0},
310311
.analog_in_ports = 8,
311312
.analog_out_ports = 8,
312313
};
@@ -321,7 +322,8 @@ const struct snd_motu_spec snd_motu_spec_traveler = {
321322
SND_MOTU_SPEC_HAS_OPT_IFACE_A |
322323
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
323324
SND_MOTU_SPEC_TX_MIDI_2ND_Q,
324-
325+
.tx_fixed_pcm_chunks = {14, 14, 8},
326+
.rx_fixed_pcm_chunks = {14, 14, 8},
325327
.analog_in_ports = 8,
326328
.analog_out_ports = 8,
327329
};
@@ -335,6 +337,8 @@ const struct snd_motu_spec snd_motu_spec_ultralite = {
335337
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
336338
SND_MOTU_SPEC_TX_MIDI_2ND_Q |
337339
SND_MOTU_SPEC_RX_SEPARATED_MAIN,
340+
.tx_fixed_pcm_chunks = {14, 14, 0},
341+
.rx_fixed_pcm_chunks = {14, 14, 0},
338342
.analog_in_ports = 8,
339343
.analog_out_ports = 8,
340344
};
@@ -349,6 +353,8 @@ const struct snd_motu_spec snd_motu_spec_8pre = {
349353
SND_MOTU_SPEC_HAS_OPT_IFACE_B |
350354
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
351355
SND_MOTU_SPEC_TX_MIDI_2ND_Q,
356+
.tx_fixed_pcm_chunks = {10, 6, 0},
357+
.rx_fixed_pcm_chunks = {10, 6, 0},
352358
.analog_in_ports = 8,
353359
.analog_out_ports = 2,
354360
};

sound/firewire/motu/motu-protocol-v3.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ const struct snd_motu_spec snd_motu_spec_828mk3 = {
324324
SND_MOTU_SPEC_HAS_OPT_IFACE_B |
325325
SND_MOTU_SPEC_RX_MIDI_3RD_Q |
326326
SND_MOTU_SPEC_TX_MIDI_3RD_Q,
327-
327+
.tx_fixed_pcm_chunks = {18, 18, 14},
328+
.rx_fixed_pcm_chunks = {14, 14, 10},
328329
.analog_in_ports = 8,
329330
.analog_out_ports = 8,
330331
};
@@ -338,6 +339,8 @@ const struct snd_motu_spec snd_motu_spec_audio_express = {
338339
SND_MOTU_SPEC_RX_SEPARATED_MAIN |
339340
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
340341
SND_MOTU_SPEC_TX_MIDI_3RD_Q,
342+
.tx_fixed_pcm_chunks = {10, 10, 0},
343+
.rx_fixed_pcm_chunks = {10, 10, 0},
341344
.analog_in_ports = 2,
342345
.analog_out_ports = 4,
343346
};
@@ -349,6 +352,8 @@ const struct snd_motu_spec snd_motu_spec_4pre = {
349352
SND_MOTU_SPEC_TX_MICINST_CHUNK |
350353
SND_MOTU_SPEC_TX_RETURN_CHUNK |
351354
SND_MOTU_SPEC_RX_SEPARATED_MAIN,
355+
.tx_fixed_pcm_chunks = {10, 10, 0},
356+
.rx_fixed_pcm_chunks = {10, 10, 0},
352357
.analog_in_ports = 2,
353358
.analog_out_ports = 2,
354359
};

sound/firewire/motu/motu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ struct snd_motu_spec {
118118
enum snd_motu_protocol_version protocol_version;
119119
enum snd_motu_spec_flags flags;
120120

121+
unsigned char tx_fixed_pcm_chunks[3];
122+
unsigned char rx_fixed_pcm_chunks[3];
123+
121124
unsigned char analog_in_ports;
122125
unsigned char analog_out_ports;
123126
};

0 commit comments

Comments
 (0)