Skip to content

Commit 6c5e1ac

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-motu: add support for Motu Traveler
This commit adds support for MOTU Traveler, launched in 2005, discontinued quite before. As a result, transmission of PCM frame and MIDI messages is available via ALSA PCM and RawMIDI/Sequencer interfaces. This model supports sampling transmission frequency up to 192.0 kHz, and AES/EBU on XLR interface and ADAT on optical interface. Unlike Motu 828MkII, Windows driver can switch fetching mode for DSP, like mute/unmute feature. Although this commit enables high sampling transmission frequency, actual sound from this model is not good. As long as I tested, it's silence at 176.4 kHz, and it includes hissing noise at 192.0 kHz. In my opinion, as I reported at 3526ce7f9ba7 ('ALSA: firewire-motu: add MOTU specific protocol layer'), timestamping on source packet header (SPH) may not still be good for this model as well. $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04106505 bus_info_length 4, crc_length 16, crc 25861 404 31333934 bus_name "1394" 408 20001000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4) 40c 0001f200 company_id 0001f2 | 410 0001f32f device_id 000001f32f | EUI-64 0001f2000001f32f root directory ----------------------------------------------------------------- 414 0004c65c directory_length 4, crc 50780 418 030001f2 vendor 41c 0c0083c0 node capabilities per IEEE 1394 420 8d000006 --> eui-64 leaf at 438 424 d1000001 --> unit directory at 428 unit directory at 428 ----------------------------------------------------------------- 428 00035955 directory_length 3, crc 22869 42c 120001f2 specifier id 430 13000009 version 434 17107800 model eui-64 leaf at 438 ----------------------------------------------------------------- 438 000206b2 leaf_length 2, crc 1714 43c 0001f200 company_id 0001f2 | 440 0001f32f device_id 000001f32f | EUI-64 0001f2000001f32f Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 191ef57 commit 6c5e1ac

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#define V2_CLOCK_RATE_SHIFT 3
1414
#define V2_CLOCK_SRC_MASK 0x00000007
1515
#define V2_CLOCK_SRC_SHIFT 0
16+
#define V2_CLOCK_TRAVELER_FETCH_DISABLE 0x04000000
17+
#define V2_CLOCK_TRAVELER_FETCH_ENABLE 0x03000000
1618

1719
#define V2_IN_OUT_CONF_OFFSET 0x0c04
1820
#define V2_OPT_OUT_IFACE_MASK 0x00000c00
@@ -66,6 +68,11 @@ static int v2_set_clock_rate(struct snd_motu *motu, unsigned int rate)
6668
data &= ~V2_CLOCK_RATE_MASK;
6769
data |= i << V2_CLOCK_RATE_SHIFT;
6870

71+
if (motu->spec == &snd_motu_spec_traveler) {
72+
data &= ~V2_CLOCK_TRAVELER_FETCH_ENABLE;
73+
data |= V2_CLOCK_TRAVELER_FETCH_DISABLE;
74+
}
75+
6976
reg = cpu_to_be32(data);
7077
return snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, &reg,
7178
sizeof(reg));
@@ -121,8 +128,31 @@ static int v2_get_clock_source(struct snd_motu *motu,
121128

122129
static int v2_switch_fetching_mode(struct snd_motu *motu, bool enable)
123130
{
124-
/* V2 protocol doesn't have this feature. */
125-
return 0;
131+
__be32 reg;
132+
u32 data;
133+
int err = 0;
134+
135+
if (motu->spec == &snd_motu_spec_traveler) {
136+
err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET,
137+
&reg, sizeof(reg));
138+
if (err < 0)
139+
return err;
140+
data = be32_to_cpu(reg);
141+
142+
data &= ~(V2_CLOCK_TRAVELER_FETCH_DISABLE |
143+
V2_CLOCK_TRAVELER_FETCH_ENABLE);
144+
145+
if (enable)
146+
data |= V2_CLOCK_TRAVELER_FETCH_ENABLE;
147+
else
148+
data |= V2_CLOCK_TRAVELER_FETCH_DISABLE;
149+
150+
reg = cpu_to_be32(data);
151+
err = snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET,
152+
&reg, sizeof(reg));
153+
}
154+
155+
return err;
126156
}
127157

128158
static void calculate_fixed_part(struct snd_motu_packet_format *formats,

sound/firewire/motu/motu.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,21 @@ static const struct snd_motu_spec motu_828mk2 = {
209209
.analog_out_ports = 8,
210210
};
211211

212+
const struct snd_motu_spec snd_motu_spec_traveler = {
213+
.name = "Traveler",
214+
.protocol = &snd_motu_protocol_v2,
215+
.flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
216+
SND_MOTU_SPEC_SUPPORT_CLOCK_X4 |
217+
SND_MOTU_SPEC_TX_RETURN_CHUNK |
218+
SND_MOTU_SPEC_HAS_AESEBU_IFACE |
219+
SND_MOTU_SPEC_HAS_OPT_IFACE_A |
220+
SND_MOTU_SPEC_RX_MIDI_2ND_Q |
221+
SND_MOTU_SPEC_TX_MIDI_2ND_Q,
222+
223+
.analog_in_ports = 8,
224+
.analog_out_ports = 8,
225+
};
226+
212227
static const struct snd_motu_spec motu_828mk3 = {
213228
.name = "828mk3",
214229
.protocol = &snd_motu_protocol_v3,
@@ -253,6 +268,7 @@ static const struct snd_motu_spec motu_audio_express = {
253268

254269
static const struct ieee1394_device_id motu_id_table[] = {
255270
SND_MOTU_DEV_ENTRY(0x101800, &motu_828mk2),
271+
SND_MOTU_DEV_ENTRY(0x107800, &snd_motu_spec_traveler),
256272
SND_MOTU_DEV_ENTRY(0x106800, &motu_828mk3), /* FireWire only. */
257273
SND_MOTU_DEV_ENTRY(0x100800, &motu_828mk3), /* Hybrid. */
258274
SND_MOTU_DEV_ENTRY(0x104800, &motu_audio_express),

sound/firewire/motu/motu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ struct snd_motu_spec {
129129
extern const struct snd_motu_protocol snd_motu_protocol_v2;
130130
extern const struct snd_motu_protocol snd_motu_protocol_v3;
131131

132+
extern const struct snd_motu_spec snd_motu_spec_traveler;
133+
132134
int amdtp_motu_init(struct amdtp_stream *s, struct fw_unit *unit,
133135
enum amdtp_stream_direction dir,
134136
const struct snd_motu_protocol *const protocol);

0 commit comments

Comments
 (0)