Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: firewire-motu: add support for MOTU 896 mk3 FireWire and Hybrid

Mark of the Unicorn released 896 mk3 FireWire in 2008 as part of the third
generation of its FireWire series. In 2011, 896 mk3 hybrid was released to
support USB protocol.

It supports sampling transfer frequency up to 192.0 kHz. The packet
format differs depending on both of current sampling transfer frequency
and the type of signal in optical interfaces. The model supports
transmission of PCM frames as well as MIDI messages.

The 896 mk3 FireWire consists of below ICs:

* Texas Instruments TSB41AB2
* Xilinx Spartan-3A FPGA, XC3S500E
* Texas Instruments TMS320C6722
* Microchip (Atmel) AT91SAM SAM7S256

It supports sampling transfer frequency up to 192.0 kHz. The packet
format differs depending on both of current sampling transfer frequency
and the type of signal in two pairs of optical interfaces. The model
supports transmission of PCM frames, while has no port for MIDi messages.

The model supports command mechanism to configure internal DSP. Hardware
meter information is available in the first 2 chunks of each data block
of tx packet.

This commit adds support for it. The 896 mk3 FireWire is just tested, but
the 896 mk3 Hybrid is not yet.

$ config-rom-pretty-printer < motu-896mk3fw.img
ROM header and bus information block
-----------------------------------------------------------------
1024 04100ce1 bus_info_length 4, crc_length 16, crc 3297
1028 31333934 bus_name "1394"
1032 20ff7000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 7 (256)
1036 0001f200 company_id 0001f2 |
1040 00093add device_id 0000604893 | EUI-64 0547556791237341

root directory
-----------------------------------------------------------------
1044 0004ef04 directory_length 4, crc 61188
1048 030001f2 vendor
1052 0c0083c0 node capabilities: per IEEE 1394
1056 d1000002 --> unit directory at 1064
1060 8d000005 --> eui-64 leaf at 1080

unit directory at 1064
-----------------------------------------------------------------
1064 0003998d directory_length 3, crc 39309
1068 120001f2 specifier id
1072 13000017 version
1076 17101800 model

eui-64 leaf at 1080
-----------------------------------------------------------------
1080 0002cc82 leaf_length 2, crc 52354
1084 0001f200 company_id 0001f2 |
1088 00093add device_id 0000604893 | EUI-64 0547556791237341

$ config-rom-pretty-printer < motu-896mk3hybrid.img
ROM header and bus information block
-----------------------------------------------------------------
1024 04103cbe bus_info_length 4, crc_length 16, crc 15550
1028 31333934 bus_name "1394"
1032 20ff7000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 7 (256)
1036 0001f200 company_id 0001f2 |
1040 000ae601 device_id 0000714241 | EUI-64 0547556791346689

root directory
-----------------------------------------------------------------
1044 0004ef04 directory_length 4, crc 61188
1048 030001f2 vendor
1052 0c0083c0 node capabilities: per IEEE 1394
1056 d1000002 --> unit directory at 1064
1060 8d000005 --> eui-64 leaf at 1080

unit directory at 1064
-----------------------------------------------------------------
1064 000394ac directory_length 3, crc 38060
1068 120001f2 specifier id
1072 13000037 version
1076 17102800 model

eui-64 leaf at 1080
-----------------------------------------------------------------
1080 0002cf69 leaf_length 2, crc 53097
1084 0001f200 company_id 0001f2 |
1088 000ae601 device_id 0000714241 | EUI-64 0547556791346689

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20240129022711.254383-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
6d5a2dda aa8e3ef4

+14
+2
sound/firewire/Kconfig
··· 175 175 * 8pre 176 176 * 828mk3 (FireWire only) 177 177 * 828mk3 (Hybrid) 178 + * 896mk3 (FireWire only) 179 + * 896mk3 (Hybrid) 178 180 * Ultralite mk3 (FireWire only) 179 181 * Ultralite mk3 (Hybrid) 180 182 * Traveler mk3
+9
sound/firewire/motu/motu-protocol-v3.c
··· 261 261 262 262 if (motu->spec == &snd_motu_spec_828mk3_fw || 263 263 motu->spec == &snd_motu_spec_828mk3_hybrid || 264 + motu->spec == &snd_motu_spec_896mk3 || 264 265 motu->spec == &snd_motu_spec_traveler_mk3 || 265 266 motu->spec == &snd_motu_spec_track16) 266 267 return detect_packet_formats_with_opt_ifaces(motu, data); ··· 287 286 SND_MOTU_SPEC_COMMAND_DSP, 288 287 .tx_fixed_pcm_chunks = {18, 18, 14}, 289 288 .rx_fixed_pcm_chunks = {14, 14, 14}, // Additional 4 dummy chunks at higher rate. 289 + }; 290 + 291 + const struct snd_motu_spec snd_motu_spec_896mk3 = { 292 + .name = "896mk3", 293 + .protocol_version = SND_MOTU_PROTOCOL_V3, 294 + .flags = SND_MOTU_SPEC_COMMAND_DSP, 295 + .tx_fixed_pcm_chunks = {18, 14, 10}, 296 + .rx_fixed_pcm_chunks = {18, 14, 10}, 290 297 }; 291 298 292 299 const struct snd_motu_spec snd_motu_spec_traveler_mk3 = {
+2
sound/firewire/motu/motu.c
··· 168 168 SND_MOTU_DEV_ENTRY(0x00000d, &snd_motu_spec_ultralite), 169 169 SND_MOTU_DEV_ENTRY(0x00000f, &snd_motu_spec_8pre), 170 170 SND_MOTU_DEV_ENTRY(0x000015, &snd_motu_spec_828mk3_fw), // FireWire only. 171 + SND_MOTU_DEV_ENTRY(0x000017, &snd_motu_spec_896mk3), // FireWire only. 171 172 SND_MOTU_DEV_ENTRY(0x000019, &snd_motu_spec_ultralite_mk3), // FireWire only. 172 173 SND_MOTU_DEV_ENTRY(0x00001b, &snd_motu_spec_traveler_mk3), 173 174 SND_MOTU_DEV_ENTRY(0x000030, &snd_motu_spec_ultralite_mk3), // Hybrid. 174 175 SND_MOTU_DEV_ENTRY(0x000035, &snd_motu_spec_828mk3_hybrid), // Hybrid. 176 + SND_MOTU_DEV_ENTRY(0x000037, &snd_motu_spec_896mk3), // Hybrid. 175 177 SND_MOTU_DEV_ENTRY(0x000033, &snd_motu_spec_audio_express), 176 178 SND_MOTU_DEV_ENTRY(0x000039, &snd_motu_spec_track16), 177 179 SND_MOTU_DEV_ENTRY(0x000045, &snd_motu_spec_4pre),
+1
sound/firewire/motu/motu.h
··· 138 138 139 139 extern const struct snd_motu_spec snd_motu_spec_828mk3_fw; 140 140 extern const struct snd_motu_spec snd_motu_spec_828mk3_hybrid; 141 + extern const struct snd_motu_spec snd_motu_spec_896mk3; 141 142 extern const struct snd_motu_spec snd_motu_spec_traveler_mk3; 142 143 extern const struct snd_motu_spec snd_motu_spec_ultralite_mk3; 143 144 extern const struct snd_motu_spec snd_motu_spec_audio_express;