Skip to content

Commit 81720c6

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-motu: add a flag for chunks for main 1/2 out
This driver explicitly assumes that all of supported models have main data chunk separated from chunk for analog ports. However, MOTU Traveler doesn't support the separated main data chunk. This commit adds a flag for the separated main data chunk. Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 6c1549c commit 81720c6

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,15 @@ static void calculate_fixed_part(struct snd_motu_packet_format *formats,
149149
pcm_chunks[1] += 2;
150150
}
151151
} else {
152-
/*
153-
* Packets to v2 units transfer main-out-1/2 and phone-out-1/2.
154-
*/
155-
pcm_chunks[0] += 4;
156-
pcm_chunks[1] += 4;
152+
if (flags & SND_MOTU_SPEC_RX_SEPARETED_MAIN) {
153+
pcm_chunks[0] += 2;
154+
pcm_chunks[1] += 2;
155+
}
156+
157+
// Packets to v2 units include 2 chunks for phone 1/2, except
158+
// for 176.4/192.0 kHz.
159+
pcm_chunks[0] += 2;
160+
pcm_chunks[1] += 2;
157161
}
158162

159163
/*

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,15 @@ static void calculate_fixed_part(struct snd_motu_packet_format *formats,
188188
pcm_chunks[1] += 2;
189189
}
190190
} else {
191-
/*
192-
* Packets to v2 units transfer main-out-1/2 and phone-out-1/2.
193-
*/
194-
pcm_chunks[0] += 4;
195-
pcm_chunks[1] += 4;
191+
if (flags & SND_MOTU_SPEC_RX_SEPARETED_MAIN) {
192+
pcm_chunks[0] += 2;
193+
pcm_chunks[1] += 2;
194+
}
195+
196+
// Packets to v3 units include 2 chunks for phone 1/2, except
197+
// for 176.4/192.0 kHz.
198+
pcm_chunks[0] += 2;
199+
pcm_chunks[1] += 2;
196200
}
197201

198202
/*

sound/firewire/motu/motu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ static const struct snd_motu_spec motu_828mk2 = {
200200
.flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
201201
SND_MOTU_SPEC_TX_MICINST_CHUNK |
202202
SND_MOTU_SPEC_TX_RETURN_CHUNK |
203+
SND_MOTU_SPEC_RX_SEPARETED_MAIN |
203204
SND_MOTU_SPEC_HAS_OPT_IFACE_A |
204205
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
205206
SND_MOTU_SPEC_TX_MIDI_2ND_Q,
@@ -216,6 +217,7 @@ static const struct snd_motu_spec motu_828mk3 = {
216217
SND_MOTU_SPEC_TX_MICINST_CHUNK |
217218
SND_MOTU_SPEC_TX_RETURN_CHUNK |
218219
SND_MOTU_SPEC_TX_REVERB_CHUNK |
220+
SND_MOTU_SPEC_RX_SEPARETED_MAIN |
219221
SND_MOTU_SPEC_HAS_OPT_IFACE_A |
220222
SND_MOTU_SPEC_HAS_OPT_IFACE_B |
221223
SND_MOTU_SPEC_RX_MIDI_3RD_Q |
@@ -231,6 +233,7 @@ static const struct snd_motu_spec motu_audio_express = {
231233
.flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
232234
SND_MOTU_SPEC_TX_MICINST_CHUNK |
233235
SND_MOTU_SPEC_TX_RETURN_CHUNK |
236+
SND_MOTU_SPEC_RX_SEPARETED_MAIN |
234237
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
235238
SND_MOTU_SPEC_TX_MIDI_3RD_Q,
236239
.analog_in_ports = 2,

sound/firewire/motu/motu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ enum snd_motu_spec_flags {
8686
SND_MOTU_SPEC_RX_MIDI_3RD_Q = 0x0200,
8787
SND_MOTU_SPEC_TX_MIDI_2ND_Q = 0x0400,
8888
SND_MOTU_SPEC_TX_MIDI_3RD_Q = 0x0800,
89+
SND_MOTU_SPEC_RX_SEPARETED_MAIN = 0x1000,
8990
};
9091

9192
#define SND_MOTU_CLOCK_RATE_COUNT 6

0 commit comments

Comments
 (0)