root/trunk/libffado/doc/motu_firewire_protocol.txt

Revision 2812, 55.1 kB (checked in by jwoithe, 3 years ago)

Cosmetic: replace inconsistent "ISO" with "iso" in some developer documents.

In these contexts, "iso" is a shortened form of "isochronous". There is no
need to use "ISO" because it is not an acronym.

Line 
1 Notes on the FireWire protocol used by MOTU audio devices
2 =========================================================
3
4 Author: Jonathan Woithe
5 Document version: 20100914-1
6
7
8 Audio/MIDI data
9 ---------------
10
11 Note: while this section focuses on the Traveler, the same basic data format
12 is utilised for the 828Mk2, 896HD, Ultralite and possibly other MOTU
13 interfaces.  The differences lie in the number of discrete audio channels
14 sent and perhaps the order of some channels within a data block.
15
16 Audio data is sent via iso packets.  With nothing else present on the
17 FireWire bus Iso channel 0 is used by the PC to send data to the MOTU while
18 iso channel 1 is used by the MOTU to send data to the PC.  The channels
19 used can be arbitarily chosen by software subject to availability as
20 indicated by the Isochronous Resource Manager (IRM).
21
22 The MOTU appears to utilise some ideas from IEC 61883-6.  For example, each
23 iso packet seems to include a CIP header (the iso packet header has the tag
24 field set to 0x01 to indicate the presence of the CIP).  However, the
25 standard is not followed completely to the finest detail.  Typical CIP
26 header values from the Traveler for audio data packets at a 44.1 kHz rate
27 with SPDIF enabled and the optical I/O ports set to ADAT mode are as
28 follows:
29
30   SID = 0x02    dependent on bus topography
31   DBS = 0x13    expressed in quadlets
32   FN  = 0       as expected from IEC 61883-6
33   QPC = 0       as expected from IEC 61883-6
34   SPH = 1       indicating a source packet header is included.  IEC 61883-6
35                 expects SPH to be 0 for A/V transport.
36   Rsv = 0
37   DBC = yyy     Data block count varies from packet to packet
38   FMT = 0x02    IEC 61883-6 expects this to be 0x10 for A/V data.  MOTU
39                 seem to be using 0x02 for their own purposes.
40   FDF = 0x22    This means the data is 32 bit floating point according to
41                 IEC 61883-6.  The data isn't 32 bit floating point, so MOTU
42                 obviously use this field to mean their own thing.
43   SYT = 0xffff  IEC 61883-6 says this field is the time the event is to be
44                 presented to the receiver.  Clearly this isn't used by MOTU.
45
46 The FDF field is interesting in that when interpreted as per IEC 61883-6, it
47 doesn't reflect the reality of the audio stream used by the Traveler (see
48 below).  One has to assume that MOTU have redefined this for their own
49 purposes.
50
51 The DBC field is incremented from packet to packet by the number of
52 data blocks contained in the packet.  At 1x rates there are nominally 8
53 data blocks per packet, so DBC increments by 8 between successive iso data
54 packets.
55
56 The DBS (Data Block Size) varies according to the sampling rate in use. On
57 the Travler at 1x rates (44.1 kHz, 48 kHz) it is 0x13.  At 2x rates it
58 reduces to 0x10 while at 4x rates it decreases again to 0x09.  Similarly the
59 iso data length differs according to the sampling rate: 0x268 at 1x rates
60 (giving 8 blocks per iso data packet), 0x408 at 2x rates (giving 16 blocks
61 per iso data packet) and 0x488 at 4x rates (giving 32 blocks per iso data
62 packet).
63
64 DBS/FDF behaves a little differently with the Ultralite interface.  At both
65 1x and 2x rates DBS is 19 (0x13) while FDF is still 0x22.  Based on
66 behaviour of earlier interfaces this would give a block size of 19*4 = 76
67 bytes.  However, in reality it is only 52 bytes: 4 bytes SPH, 6 bytes
68 MIDI/control data, 8x3 bytes analog data, 2x3 bytes SPDIF, 2x3 bytes Mix1
69 and 2x3 bytes padding (probably used as headphone send in transmit stream).
70 It's not clear how the given DBS/FDF values relate to this block size.
71 There are still 8 blocks per iso data packet at 1x rates, and 16 at 2x
72 rates, giving total packet sizes (including the 8 byte CIP) of 424 bytes at
73 1x rates and 840 at 2x rates.
74
75 The Traveler usually becomes the IRM on the FireWire bus it is plugged into;
76 when functioning as the IRM it also broadcasts "cycle start" packets on a
77 regular basis as would be expected. These appear to be as per ieee1394-1995.
78 These broadcast a quadlet in the same form as the Traveler's cycle time
79 register with a value equal to the cycle time register at the time the
80 packet was submitted for transmittsion.  The format of this register is as
81 follows:
82
83   bits 31-25 = seconds count (0-127)
84   bits 24-12 = cycle count (0-7999)
85   bits 11-0  = cycle offset (0-3071)
86
87 Each portion of the register wraps to 0 at the end of the range, causing
88 the next most significant component to be incremented by one.  When the
89 "seconds count" overflows it simply wraps to 0 without incrementing
90 anything.  The cycle offset is incremented by a 24.576 MHz clock.
91 The cycle count can be thought of as the fractional part of the current
92 second in units of 125 us.
93
94 The data portion of a typical iso packet to/from the Traveler contains a CIP
95 header and 8, 16 or 32 data blocks (depending on sampling rate) of size DBS
96 quadlets (DBS*4 bytes).  Empty packets are utilised periodically to maintain
97 the long-term average equal to the sampling interval.  For example, at 48
98 kHz, 3 packets with 8 datablocks are sent, followed by a single empty
99 packet.
100
101 The format of each data block varies according to whether a 1x, 2x or 4x
102 clock multiplier is in use.  At 44.1 kHz or 48 kHz (ie: a 1x clock), each
103 data block contains the following in this order:
104
105   32 bit Source Packet Header (SPH) (+)
106   48 bits of control/MIDI data (&)
107   24 bit audio values: headphone L&R / mix1 L&R (*)
108   24 bit audio values: analog channels 1-8
109   24 bit audio values: AES-EBU L and R
110   24 bit audio values: SPDIF L and R
111   24 bit audio values: ADAT channels 1-8
112
113 At 2x clock frequencies (88.2 kHz and 96 kHz) the ADAT channels 5-8 are
114 dropped from the datablock, leaving the following arrangement:
115
116   32 bit Source Packet Header (SPH) (+)
117   48 bits of control/MIDI data (&)
118   24 bit audio values: headphone L&R / mix1 L&R (*)
119   24 bit audio values: analog channels 1-8
120   24 bit audio values: AES-EBU L and R
121   24 bit audio values: SPDIF L and R
122   24 bit audio values: ADAT channels 1-4
123
124 At 4x clock frequencies (176.4 k kHz and 192 kHz) all digital I/O is disabled
125 along with the separate headphone / mix1 bus.  The resulting datablock
126 is formatted as follows.
127
128   32 bit Source Packet Header (SPH) (+)
129   48 bits of control/MIDI, MSB first (&)
130   24 bit audio values: analog channels 1-8
131   16 bits of padding (%)
132
133 Notes:
134  (+) The SPH is defined in IEC 61883-6:
135        Bits 31-25 = reserved
136        Bits 24-12 = cycle count (0-7999)
137        Bits 11-0  = cycle offset (0-3071)
138  (&) These values have been observed to be almost always 0 in packets sent
139      by the PC except when MIDI is sent, but for packets sent by the MOTU
140      they are generally non-zero.  See below for more details on these
141      bytes.
142  (*) Packets from the traveler send mix1 data here; packets from the PC
143      send data for the headphone channel here.
144  (%) It appears the Motu pads data in a cycle using values of either 0x0000
145      or 0xffff.  It appears to use a regular pattern, although the pattern
146      itself appears variable.  Two patterns have been observed so far:
147        * two blocks of 0xffff followed by two blocks of 0x0000.
148        * a block of 0xffff followed by three blocks of 0xffff.
149     The PC driver always appears to send pad values of 0x0000.
150
151 If the optical ports have been set to TOSLINK rather than ADAT, the data
152 sent in the iso datablocks is adjusted accordingly - the 8 (or 4) ADAT
153 channels and 2 coax SPDIF channels are omitted and the 2 optical TOSLINK
154 channels are sent in their place.
155
156 For packets from the PC to the MOTU, the timestamp given in the SPH probably
157 represents the cycle time at which the data given should be output by the
158 interface.  For packets coming from the MOTU to the PC this timestamp is
159 most likely the cycle time at which the data was sampled by the interface.
160
161 The cycle offset increment used for each successive datablock varies
162 according to the sampling frequency as one would expect.  While the
163 increment value is "mostly constant" it does vary by +/-1 at times.  This
164 would be to keep the data in sync with the audio sampling frequency in use,
165 as some audio sampling frequencies - those which are multiples of 44.1 kHz -
166 are not integral factors of the cycle offset frequency (and even those which
167 are sometimes deviate from the theoretical increment by 1).  The increments
168 seen in data coming from the Motu are generally a lot more consistent than
169 those coming from the PC.  It is clear from this that the audio clock is not
170 locked to the firefire cycle clock in any way.
171
172 The 48 bits Control/MIDI data appears to play a part in MIDI data
173 transmission.  When the PC is transmitting a MIDI stream to the Motu it does
174 so byte by byte.  A byte of midi data is sent using the first and third bytes
175 following a data block's SPH, forming a midi subpacket for want of a better
176 description.  The format of the midi subpacket appears to be
177
178   0x0100nn
179
180 where nn is the MIDI byte being sent.  Having more than one MIDI subpacket
181 in a single transmitted iso data packet has never been observed; it seems
182 therefore that on this interface the timing of the MIDI subpackets is to
183 match exactly their transmission onto the wire.  Furthermore, sending data
184 to the MOTU at a rate faster then the hardware midi rate of 3125 bytes per
185 second (31250 baud with 8 bit data, 1 start bit and 1 stop bit) will cause
186 MIDI bytes to be dropped or corrupted in interesting ways.
187
188 For data coming from the Motu it appears that these 48 Control/MIDI bits are
189 used for a number of purposes, although some of the details are yet to be
190 worked out.  However, it appears that MIDI data is intermingled with this.
191 At this stage it seems that when bit 40 is set then bits 24-31 contain a
192 MIDI byte.  The contents of bits 41-47 and 32-39 do not appear to be
193 affected by having bit 40 set, so at this stage one concludes that their
194 function (mostly related to Cuemix setting updates) continues even when MIDI
195 data is sent.  Obviously any other function of bits 24-31 is interrupted when
196 these bits are required for a MIDI byte.
197
198 Putting all this together, bit 40 appears to be a "MIDI byte present" bit;
199 if set, bits 24-31 contain a MIDI byte.  All other bits of the Control/MIDI
200 fields continue to function even when bit 40 is set.  If this definition is
201 adopted it applies equally well to both incoming and outgoing MIDI data.
202
203 It should be noted that the Traveler has never been observed to send more
204 than one MIDI data byte per iso packet.  Presumedly therefore the timing of
205 the bytes delivered by the Traveler is very close to the timing on the MIDI
206 wire.  However, other MOTU devices (the 828Mk2 for example) do transmit more
207 than one MIDI byte in a single packet.  On these devices MIDI messages must
208 be buffered in the device and sent in a burst once a complete message has
209 been received.
210
211
212 Audio channel locations in a frame
213 ----------------------------------
214
215 Not surprisingly the different MOTU interfaces place channels at different
216 offsets within a frame.  This section attempts to document what we know
217 about the channel locations for various devices.
218
219 828 Mk 1:
220   Analog 1-8: 10, 13, 16, 19, 22, 25, 28, 31
221   SPDIF 1-2: 34, 37
222   ADAT 1-4: 40, 43, 46, 49
223   ADAT 5-8 (1x rates only): 52, 55, 58, 61
224
225 896HD:
226   Mix L-R (in, not at 4x): 10, 13
227   Phones L-R (out, not at 4x): 10, 13
228   Analog 1-8 (1x/2x rate): 16, 19, 22, 25, 28, 31, 34, 37
229   Analog 1-8 (4x rate): 10, 13, 16, 19, 22, 25, 28, 31
230   MainOut L-R (out, 1x/2x only): 40, 43
231   Unknown 1-2 (in, 1x/2x only): 40, 43
232   ADAT 1-4 (1x/2x only): 46, 49, 52, 55
233   ADAT 5-8 (1x only): 58, 61, 64, 67
234   AES/EBU 1-2 (1x with ADAT active): 70, 73
235   AES/EBU 1-2 (2x with ADAT active): 58, 61
236   AES/EBU 1-2 (1x/2x with ADAT off): 46, 49
237
238 828 Mk 2:
239   Mix L-R (in): 10, 13
240   Phones L-R (out): 10, 13
241   Analog 1-8: 16, 19, 22, 25, 28, 31, 34, 37
242   Mic 1-2 (in): 40, 43
243   Main L-R (out): 40, 43
244   SPDIF 1-2: 46, 49
245   ADAT 1-4: 52, 55, 58, 61
246   ADAT 5-8 (1x rates only): 64, 67, 70, 73
247
248 Traveler:
249   Mix L-R (in, 1x/2x rates only): 10, 13
250   Phones L-R (out, 1x/2x rates only): 10, 13
251   Analog 1-8 (1x/2x rate): 16, 19, 22, 25, 28, 31, 34, 37
252   Analog 1-8 (4x rate): 10, 13, 16, 19, 22, 25, 28, 31
253   AES/EBU 1-2 (1x/2x rate): 40, 43
254   SPDIF/Toslink 1-2 (1x/2x rate): 46, 49
255   ADAT 1-4 (1x/2x rate): 52, 55, 58, 61
256   ADAT 5-8 (1x rate): 64, 67, 70, 73
257
258 Ultralite:
259   Mix L-R (in): 10, 13
260   Phones L-R (out): 10, 13
261   Mic 1-2 (in): 16, 19
262   Analog 1-2 (out): 16, 19
263   Analog 3-8: 22, 25, 28, 31, 34, 37
264   SPDIF 1-2 (in): 40, 43
265   Main L-R (out): 40, 43
266   Padding (in): 46, 49
267   SPDIF 1-2 (out): 46, 49
268
269 8Pre:
270   Mix L-R (in): 10, 13
271   Phones L-R (out): 10, 13
272   Analog 1-8 (in): 16, 19, 22, 25, 28, 31, 34, 37
273   Main L-R (out): 16, 19
274   Padding (out): 22, 25
275   ADAT 1-8 (in): 40, 43, 46, 49, 52, 55, 58, 61
276   ADAT 1-8 (out): 22, 25, 28, 31, 34, 37, 40, 43
277
278 828 Mk 3:
279   Mic 1-2 (in, 1x/2x rates): 10, 13
280   Phones L-R (out, 1x/2x rates): 10, 13
281   Unknown 1-2 (out, 4x rates): 10, 13
282   Analog 1-8: 16, 19, 22, 25, 28, 31, 34, 37
283   Return 1-2 (in): 40, 43
284   Main L-R (out): 40, 43
285   SPDIF 1-2 (1x/2x rates): 46, 49
286   Unknown (out, 4x rates): 46, 49
287   Reverb 1-2 (in, 1x/2x rates): 52, 55
288   [ Optical ports follow according to optical mode: first Optical-A
289   channels, then optical-B channels.  Out channels start at 52, in channels
290   start at 58.  At 1x rates 58/61 are "unknown" ahead of the optical
291   channels, with inputs at 76/79 being unknown at 2x rates. ]
292
293 Ultralite Mk 3:
294   Mix L-R (in): 10, 13
295   Phones L-R (out): 10, 13
296   Mic 1-2 (in): 16, 19
297   Analog 1-2 (out): 16, 19
298   Analog 3-8: 22, 25, 28, 31, 34, 37
299   SPDIF 1-2 (in, 1x/2x rates): 40, 43
300   Padding (out, 1x/2x rates): 40, 43
301   SPDIF 1-2 (out, 1x/2x rates): 46, 49
302
303 Ultralite Mk 3 hybrid:
304   Mix L-R (in): 10, 13
305   Phones L-R (out): 10, 13
306   Mic 1-2 (in): 16, 19
307   Analog 1-2 (out): 16, 19
308   Analog 3-8: 22, 25, 28, 31, 34, 37
309   SPDIF 1-2 (in, 1x/2x rates): 40, 43
310   Main L-R (out): 40, 43
311   Reverb 1-2 (in, 1x/2x rates): 46, 49
312   SPDIF 1-2 (out, 1x/2x rates): 46, 49
313   Unknown 1-4 (in, 1x/2x rates): 52, 55, 58, 61
314
315 Traveler Mk 3:
316   Mix L-R (in): 10, 13
317   Phones L-R (out): 10, 13
318   Analog 1-8: 16, 19, 22, 25, 28, 31, 34, 37
319   AES/EBU 1-2 (1x/2x rates): 40, 43
320   SPDIF 1-2 (1x/2x rates): 46, 49
321   Reverb 1-2 (in, 1x rates): 52, 55
322   Unknown 1-2 (in, 1x rates): 58, 61
323   [ Optical port channels follow in a similar was as for the 828 Mk 3.
324   The precise locations are yet to be confirmed as of 14 Sept 2010. ]
325
326
327 SMPTE timecode
328 --------------
329 It appears that the traveler itself has no way to generate SMPTE timecode
330 internally.  The SMTPE console application allows one to generate timecode,
331 but the timecode stops as soon as this application is exitted.
332
333 In addition, changing any of the settings in the SMPTE console does not
334 appear to change any hardware settings in the MOTU with the exception of the
335 "clock/address" control - this changes the source in a similar way to that
336 in the main MOTU setup program.  The obvious conclusion here is that SMTPE
337 generation appears to be a feature implemented in the host software.
338
339
340 Talkback/listenback
341 -------------------
342 These features of the Cuemix console appear to be implemented in the host
343 software.  Enabling either of these appears to simply set the mixer
344 registers to suit talkback/listenback, with the "normal" settings
345 restored when talkback/listenback is disengaged.  The motu itself does not
346 appear to have any explicit on-board support of these modes.
347
348
349 Bus renaming in Cuemix console
350 ------------------------------
351 The naming of the 4 mix buses provided by the Cuemix console seems to be
352 internal to the Cuemix console application.  Changing the mix names results
353 in no traffic being sent to/from the motu.
354
355
356 MIDI in/out
357 -----------
358 MIDI data is sent within the first 48 bytes of the data blocks within an
359 iso data packet.  This is described in detail in the "Audio/MIDI data"
360 section.
361
362
363 Controlling Cuemix in pre-Mark3 models
364 --------------------------------------
365 It has been noted that some mixer settings (particularly registers 0x4yyy)
366 have been found to utilise "write enable" bits which when set allow their
367 associated part of the control register to be acted upon.  There is no
368 reason to think that the 0x4yyy registers are unique here; it's likely that
369 other control registers implement a similar idea.  It is thought that
370 whenever bits are seemingly set to 1 by the Cuemix console there is a stong
371 possibility they form some kind of enable mask.  When such values are noted
372 in the register description it is likely that they must be supplied as noted
373 if the desired register change is to be successful.  In time it is hoped that
374 the function of these magic settings can be deduced.
375
376 Finally, when manually changing Cuemix settings on the Motu's front panel,
377 the Cuemix console is observed to update its display accordingly.  The data
378 for these updates comes via a byte stream transmitted by the Motu using a
379 key/value system in the first two bytes of each data block in the iso
380 stream.  Within a given data block, bits 7-1 of the first byte is the key
381 while the second byte gives the respective value.  Recall that bit 0 of the
382 first byte is a "MIDI byte present" flag, indicating that the third byte in
383 the data block contains a MIDI data byte - refer to the "Audio/MIDI data"
384 section for more details.
385
386 The following describes all keys observed so far from the Traveler.  Note
387 that the key values reported here are for bits 7-0 of the first byte with
388 bit 0 (the MIDI present bit) masked to zero.
389
390   0x04 = Some kind of timer/counter.  Details not yet identified.
391   0x0c = Mix bus sync key.  The mix bus to which the next mix bus
392          parameter(s) apply to is given by bits 7-5 in the data byte.
393   0x14 = channel gain value (0x00-0x80)
394   0x1c = channel pan value (0x00-0x80, 0x40=centre)
395   0x24 = channel control: 0x01=mute, 0x02=solo, 0x08=paired
396   0x2c = mix bus gain (0x00-0x80)
397   0x34 = mix bus destination/mute.  Bits 3-0 are as per "output destination"
398          in register 0x0c20; bit 4 is the mute bit.
399   0x3c = main out volume (0x00-0x80)
400   0x44 = phones volume (0x00-0x80)
401   0x4c = phones assign (values as per "output destination" in register 0x0c20)
402   0x54 = at 48 kHz remains fixed at 0x00.  Purpose unknown.
403   0x64 = at 48 kHz remains fixed at 0x00.  Purpose unknown.
404   0x6c = +6 dB boost (analog channels 5-8 only).  Bits 4-7 = channels 5-8.
405   0x74 = ref level.  Bits 4-7 = channels 5-8.  Bit set/clear = +4/-10.
406   0xfc = Some kind of timer/counter.  Details not yet identified.
407
408 For many of these keys there are multiple values to communicate; for
409 example, for key 0x14 (channel gain) there are up to 20 values for each of 4
410 mix buses, corresponding to the 20 input channels available (analog 1-8,
411 SPDIF, AES/EDU, ADAT 1-8).  In such situations the multiple values for a
412 given mix bus are transmitted sequentially (each having the same key)
413 following a mix bus sync key which gives the mix bus to which the values
414 apply.
415
416 In the case of the Traveler the following sequence of keys is used.
417 Timing/counter events have been omitted from this sequence.  N is the number
418 of channels active.
419
420   Mix bus sync key
421   N channel gain keys
422   Mix bus sync key
423   N channel pan keys
424   Mix bus sync key
425   N channel control keys
426   Mix bus sync key
427   Mix bus gain key
428   Mix bus destination key
429   Main out volume key
430   Phones volume key
431   Phones destination key
432   Input 6dB boost key
433   Input reference level key
434
435 The device-wide keys are therefore seen 4 times as often as the per-mixbus
436 keys.
437
438 Curiously enough, the gain trim and pad settings for analog channels 1-4
439 use a different method to communicate their changed status; for these
440 settings the Motu writes to a specific address on the PC and in
441 response the PC reads a register from the Motu.  When a channel's gain trim
442 or pad setting is altered:
443  * Motu sends 0x20ffffff to address offset 0x100000000 on the PC
444  * In response the PC reads register 0x0c1c from the Motu to obtain the new
445    gain trim value and pad setting.
446
447
448 Controlling Cuemix in Mark3 models
449 ----------------------------------
450 With the introduction of the "Mark3" interface models (Ultralite, Traveler,
451 828) MOTU completely changed the method used to control the Cuemix features
452 of the interface.  This was partly out of necessity - with the additional
453 Cuemix features being added to the "Mark3" models MOTU otherwise faced an
454 unbounded expansion in the number of device registers needed.
455
456 Protocol analysis of an Ultralite-mk3 was provided by MG and GQ.
457
458 The Mark3 interfaces use a variation of a key-value protocol involving block
459 writes to register device register 0x10000 (bus address ffc0-ffff-0001-0000
460 nominally.  Either 2 or 3 quadlets are written depending on the message
461 being sent.  For this documentation we will refer to the bytes within a
462 message as b00 .. b11, with b00 being the first byte sent.
463
464 Byte b00 and b01 form a heartbeat word.  Precisely how this is constructed
465 is not currently known, but it seems it might just be a monotomically
466 increasing number probably used by the device to detect missing data or
467 something.
468
469 Byte b02 seems to be some kind of class identifier.  Currently identified
470 classes are:
471   0x66: Faders (including bus master), pan, input trim
472   0x69: Mute/Solo, Routing selection
473
474 Specific message formats are described below.
475
476 Trim: 3 quadlet message
477   b00-b01 - heartbeat
478   b02     - 0x66
479   b03     - channel select (0x00-0x09)
480   b04     - 0x02 (select trim control)
481   b05-b06 - unknown, TBA
482   b07-b10 - data (big endian float, 0.0 - 24.0)
483   b11     - 0x00
484
485 Reverb send: TBA
486
487 Channel faders: 3 quadlet message
488   b00-b01 - heartbeat
489   b02     - 0x66
490   b03     - bus select (0x00-0x09)
491   b04     - 0x03 (select fader control)
492   b05     - channel select (0x02-0x09)
493   b06     - 0x02
494   b07-b10 - data (big endian float, 0.0 - 1.0)
495   b11     - 0x00
496
497 Pan: 3 quadlet message
498   b00-b01 - heartbeat
499   b02     - 0x66
500   b03     - bus select (0x00-0x09)
501   b04     - 0x02 (select pan control)
502   b05     - channel select (0x02-0x09)
503   b06     - 0x02
504   b07-b10 - data (big endian float, -1.0 - 1.0)
505   b11     - 0x00
506  
507 Bus master fader: 3 quadlet message
508   b00-b01 - heartbeat
509   b02     - 0x66
510   b03     - bus select (0x00-0x09)
511   b04-b05 - 0x02-0x00 (select bus master control)
512   b06     - 0x02
513   b07-b10 - data (big endian float, 0.0 - 1.0)
514   b11     - 0x00
515  
516 Bus routing: 2 quadlet message
517   b00-b01 - heartbeat
518   b02     - 0x69
519   b03     - output select (0x00-0x06, 0xff=disabled)
520   b04     - bus select (0x00-0x07)
521   b05-b07 - 0x00-0x00-0x02
522
523 Mute: 2 quadlet message
524   b00-b01 - heartbeat
525   b02     - 0x69
526   b03     - state (0x00=disable, 0x01=enable)
527   b04     - bus select (0x00-0x07)
528   b05     - 0x00 (select mute control)
529   b06     - channel select (0x01=bus master, 0x02-0x0b)
530   b07     - 0x02
531
532 Channel solo: 2 quadlet message
533   b00-b01 - heartbeat         
534   b02     - 0x69
535   b03     - state (0x00=disable, 0x01=enable)
536   b04     - bus select (0x00-0x07)
537   b05     - 0x01 (select solo control)
538   b06     - channel select (0x01=bus master, 0x02-0x0b)
539   b07     - 0x02
540
541
542 Controlling sample rate
543 -----------------------
544
545 Sample rate is mainly controlled by the clock control register (0x0b14)
546 although other registers do play a part.  It seems that the front panel
547 sample rate control is locked out by any write to the clock control
548 register; once locked it is only unlockable by power cycling the MOTU or by
549 unplugging it from the computer.
550
551
552 Device identification
553 ---------------------
554
555 The ieee1394 vendor ID field currently seems to be set to 0x000001f2 to
556 signify MOTU.
557
558 The ieee1394 model ID is a little more interesting.  Originally it was
559 thought that 0x00101800 represented the 828MkII while 0x00104800 was the
560 Traveler.  However, following an update to Traveler firmware 1.07 the model
561 ID field changed to 0x00107800.  From this it appears that the model ID
562 field probably does not identify the MOTU model but rather communicates the
563 firmware version along with other information.  It appears that bits 19-12
564 of the model ID are a binary-coded decimal representation of the minor
565 firmware version number while at least bits 23-20 (and possibly 27-20) give
566 the major firmware version number.  Further datapoints will be needed to
567 verify these details, particularly the span of the major version number.
568 The meaning of bits 11-0 are currently unknown; they seem to equal 0x800
569 in all 828MkIIs and Travelers.
570
571 The ieee1394 GUID (globally unique ID) is preserved for a given unit
572 across firmware updates, but is unique to each particular unit.  Therefore
573 it cannot be used to unambiguously differentiate between different MOTU
574 interfaces.  However, the unit directory version entry does appear to be set
575 for particular models across firmware upgrades (0x00000003 for 828MkII,
576 0x00000009 for Traveler).  Therefore the best bet at this stage appears to be
577 a probe for a vendor ID of 0x000001f2 with one of the above version values
578 in the unit directory of the config ROM.  Unit directory versions for MOTU
579 hardware are as follows:
580
581   0x00000001 = The original 828
582   0x00000003 = 828 Mk 2
583   0x00000005 = 896HD
584   0x00000009 = Traveler
585   0x0000000d = Ultralite
586   0x0000000f = 8pre
587   0x00000015 = 828 Mk 3
588   0x00000019 = Ultralite Mk 3
589   0x0000001b = Traveler Mk 3
590   0x00000030 = Ultralite Mk 3 hybrid
591
592 Alternatively one could probe for registers known to exist on only one of
593 the interfaces.  The trim gain / 20 dB pad status register (0x0c1c) for
594 example can be used to differentiate a Traveler from an 828Mk2 since these
595 features are only present on the Traveler.  At this stage however the unit
596 version number is probably sufficient and far less complicated in the long
597 run.
598
599
600 Firmware updates
601 ----------------
602
603 A firmware update is initiated by powering the unit up in "update" mode by
604 turning on while the "cursor" button is held.  After verifying "update"
605 mode, registers 0x010000, 0x010004, 0x010008 and 0x01000c are read; with
606 firmware 1.04 loaded the values returned were 0x23ba58f, 0x86e5aa30,
607 0xe7fb2202 and 0x4b85130d.  These match exactly the first 16 data bytes of
608 firmware 1.07 as downloaded to the device, so it's thought that these first
609 4 quadlets contain some kind of magic number signature designed to confirm
610 that the device really is a MOTU, or (somewhat less likely) to perhaps
611 confirm that the MOTU is in update mode.
612
613 Next 0x4d4f5455 ("MOTU") is written to register 0x0c00; the new firmware is
614 then loaded by writing to sequential registers 0x010000 - 0x019ffc and
615 0x01c000 - 0x02fffc. At the end of writing, 0x00 is written to register
616 0x0c00.
617
618 Verification is by way of reading back the firmware registers from the
619 device.
620
621 The process of confirming that the device is in update mode is not yet fully
622 understood.  In terms of the startup sequence it appears that the only
623 difference between normal and update modes is that register 0x0400 is set to
624 0x410df42 in normal mode and 0x410f3a8 when in update mode.
625
626 The Travimage.bin firmware file provided by MOTU seems to comprise some kind
627 of header in bytes 0x00 - 0x17, with the actual firmware data starting at
628 byte 0x18.  The firmware is stored in network byte order (ie: big endian)
629 quadlets - precisely the same format used to send them to the MOTU device.
630 The file also appears to include bytes 0x01a000 - 0x01bfff even though the
631 traveler updater doesn't appear to send this range to the MOTU device.
632 The firmware file for 1.07 seems to contain 0x020000 bytes of firmware data;
633 given that the firmware updater writes up to register 0x02fffc the updater
634 must infer data values of 0xff once the file ends.
635
636
637 Register map
638 ------------
639
640 MOTU registers currently known.  The base address is 0xfffff0000000.
641
642 0x0b00 - Iso streaming control
643 0x0b04 - Device initialisation/discovery?
644 0x0b08 - Device initialisation/discovery?
645 0x0b10 - Optical port control?
646 0x0b14 - clock control register
647 0x0b1c - 896HD register possibly related to programmable meters
648 0x0b24 - 896HD programmable meter register (always probed during discovery/init)
649 0x0b28 - copy of model_id unit directory
650 0x0b2c - something related to selections in mixer application
651 0x0c00 - firmware programming control
652 0x0c04 - routing / port configuration
653 0x0c08 - input level (for analog channels 5-8 only)
654 0x0c0c - "Main out" volume control
655 0x0c10 - Phones volume control
656 0x0c14 - boost controls (for analog channels 5-8 only)
657 0x0c18 - something related to selections in mixer application
658 0x0c1c - gain trim / 20 dB pad controls (for analog channels 1-4 only)
659 0x0c20 - mix1 routing control
660 0x0c24 - mix2 routing control
661 0x0c28 - mix3 routing control
662 0x0c2c - mix4 routing control
663 0x0c60 - ASCII name of current clock source (characters 0-3)
664 0x0c64 - ASCII name of current clock source (characters 4-7)
665 0x0c68 - ASCII name of current clock source (characters 8-11)
666 0x0c6c - ASCII name of current clock source (characters 12-15)
667 0x0c70 - gain trim / phase invert (Ultralite only, analog channels 1-4)
668 0x0c74 - gain trim / phase invert (Ultralite only, analog channels 5-8)
669 0x0c78 - gain trim / phase invert (Ultralite only, SPDIF 1 and 2)
670 0x4000 - mix1 gain/pan/solo/mute, analog channel 1
671 0x4004 - mix1 gain/pan/solo/mute, analog channel 2
672 0x4008 - mix1 gain/pan/solo/mute, analog channel 3
673 0x400c - mix1 gain/pan/solo/mute, analog channel 4
674 0x4010 - mix1 gain/pan/solo/mute, analog channel 5
675 0x4014 - mix1 gain/pan/solo/mute, analog channel 6
676 0x4018 - mix1 gain/pan/solo/mute, analog channel 7
677 0x401c - mix1 gain/pan/solo/mute, analog channel 8
678 0x4020 - mix1 gain/pan/solo/mute, AES-EBU 1/L
679 0x4024 - mix1 gain/pan/solo/mute, AES-EBU 2/R
680 0x4028 - mix1 gain/pan/solo/mute, SPDIF 1/L
681 0x402c - mix1 gain/pan/solo/mute, SPDIF 2/R
682 0x4030 - mix1 gain/pan/solo/mute, ADAT channel 1
683 0x4034 - mix1 gain/pan/solo/mute, ADAT channel 2
684 0x4038 - mix1 gain/pan/solo/mute, ADAT channel 3
685 0x403c - mix1 gain/pan/solo/mute, ADAT channel 4
686 0x4040 - mix1 gain/pan/solo/mute, ADAT channel 5
687 0x4044 - mix1 gain/pan/solo/mute, ADAT channel 6
688 0x4048 - mix1 gain/pan/solo/mute, ADAT channel 7
689 0x404c - mix1 gain/pan/solo/mute, ADAT channel 8
690 0x4100
691  :     - mix2 gain/pan/solo/mute, order as for mix1
692 0x414c
693 0x4200
694  :     - mix3 gain/pan/solo/mute, order as for mix1
695 0x424c
696 0x4300
697  :     - mix4 gain/pan/solo/mute, order as for mix1
698 0x434c
699
700 0x010000
701  :     - firmware, block 1
702 0x019ffc
703
704 0x01c000
705  :     - firmware, block 2
706 0x02fffc
707
708
709 Register details
710 ----------------
711
712 0x0b00 - Iso streaming control
713
714 This register is primarily for the control of iso streaming.  It has been
715 observed to be set to one of two values: 0x80810000 or 0xc0c10000.  The
716 latter value appears to activate iso streaming while the former turns it
717 off.  On readback bits 31 and 23 are zero no matter whether the previously
718 written value was 0x80810000 or 0xc0c10000.  This suggests that these two
719 bits are effectively "write enable" for iso receive/send configuration on
720 the Motu, with bits 30/22 being "iso receive/send enable" (again as viewed
721 by the Motu).
722
723 Experiments indicate that bits 29-24 give the iso channel number the Motu
724 should expect data on (ie: the PC->Motu iso channel number) while bits 21-16
725 specify the iso channel the Motu should send its data on (ie: the Motu->PC
726 iso channel number).  This makes sense since there are 64 iso channels
727 available on the FireWire bus requiring 6 bits to specify.  If it is then
728 assumed that bits 15-0 are reserved we have the following layout for
729 this register.
730
731   bit 31 = enable configuration change of PC->Motu iso streaming
732   bit 30 = PC->Motu iso streaming enable
733   bits 29-24 = PC->Motu iso channel
734   bit 23 = enable configuration change of Motu->PC iso streaming
735   bit 22 = Motu->PC iso streaming enable
736   bits 21-16 = Motu->PC iso channel
737   bits 15-0 = reserved, always 0
738
739
740 0x0b04 - Device initialisation/discovery?
741
742 This register seems to come into play only during device
743 discovery/initialisation.  The driver writes 0xffc20001 to this register
744 which is accepted by the MOTU.  The purpose of this is not known.
745
746
747 0x0b08 - Device initialisation/discovery?
748
749 This is another register which shows up only during device
750 discovery/initialisation.  A value of 0x00 is written to this register which
751 is accepted by the MOTU.  The purpose of this is not currently understood.
752
753
754 0x0b10 - Optical port control?
755
756 It is not yet clear what this register does.  It plays some part in
757 setting the mode of the optical ports (see also register c04).
758
759 Bit 7 is set to 1 by Cuemix console whenever the optical input port is set
760 to "off" or "TOSLink" and is 0 if set to "ADAT".
761
762 Bit 6 is set to 1 by Cuemix console whenever the optical output port is set
763 to "off" or "TOSLink" and is 0 if set to "ADAT".
764
765 Bit 1 seems to be set most if not all of the time in values written by
766 the Cuemix console.
767
768 Originally it was thought that bit 7 might control the availability of
769 the 8 ADAT inputs while bit 6 controlled the ADAT outputs.  However,
770 subsequent tests seemed to indicate that this was not the case - setting
771 these bits in isolation did not affect the hardware cuemix display in
772 any way.
773
774 When this register is read back its value appears to be 0x00001800 no matter
775 what the optical inputs are set up as.
776
777
778 0x0b14 - clock control register
779
780 This register is used in conjunction with others (like 0x0c0-0x0c6) to
781 control the sample clock.  Not all bits have been identified yet.  Any write
782 to this register seems to lock out the front panel sample rate control until
783 the MOTU is turned off or the MOTU is unplugged from the computer.
784
785 The details of the clock control register are summarised below.
786
787   bits 31-29: unknown at present.  Seem to always be set to 0.
788
789   bit 28: unknown at present.  For 896HD this seems to be set to 1 whenever
790     the sample rate, sample rate conversion or clock mode is changed.  For other
791     interfaces it appears to always be set to 0.
792
793   bit 27: in 2x or 4x clock mode, this bit indicates whether word clock out
794     should follow the system clock (bit 27 set to 1) or should be forced to
795     the base rate (bit 27 set to 0).
796
797   bits 26: purpose unknown at present.  Bit 26 appears to be set in every
798     write to this register for the Traveler while for the Ultralite it is
799     always 0.  Behaviour on other interfaces are unknown at present.
800     On the Traveler, if bit 26 is set then bits 25-24 seem to control device
801     muting in some way.
802
803     Based on other systems we currently take bit 26 to be an "enable" bit
804     for bits 25-24 on the Traveler.  For other interfaces we take it to
805     always be zero.
806
807   bits 25-24: related to device muting, although behaviour differs between
808     devices and is dependent in some ways on bit 26.  Bits 26-24 are toggled
809     at various staged of rate changes.  On the Traveler if bit 26 is set
810     then the device is muted if both bits 25 and 24 are off.  Having either
811     bit set seems enough to unmute the device, but other systems seem to set
812     both on.  On the Ultralite the device is muted if both bits are off
813     irrespective of the setting of bit 26.  The nature of the behaviour on
814     other interfaces is yet to be determined.
815
816     Based on other systems we'll assume bits 25-24 together control device
817     muting: both off means device muted, both on means device unmuted, and
818     other combinations (which seem to still unmute the device in practice)
819     are unknown.
820
821   bits 23-6: unknown at present.  All bits appear to always be set to zero.
822
823   bit 9-8: Sample rate conversion setting (896HD only, always 0 on other
824     interfaces):
825       0 = off
826       1 = AES/EBU in
827       2 = AES/EBU out slave
828       3 = AES/EBU out 2x
829
830   bits 7-6: unknown at present.  Always observered to be 0.
831
832   bit 5: 4x rate multiplier selector
833     Enables the 4x clock multiplier (giving access to 176000 Hz and 192000 Hz
834     rates)
835
836   bit 4: 2x rate multiplier selector
837     Enables the 2x clock multiplier (giving access to 88200 Hz and 96000 Hz
838     rates)
839
840   bit 3: Base rate selector:
841            0 = 44100 Hz
842            1 = 48000 Hz
843
844   bits 2-0: clock source:
845               0 = internal (and SMTPE if in the Audio console)
846               1 = ADAT optical
847               2 = (coaxial) SPDIF or (optical) TOSLink
848               3 = SMTPE (set only by SMTPE console)
849               4 = Word clock in
850               5 = ADAT 9 pin
851               6 = [ reserved? ]
852               7 = AES-EBU
853
854 Note: when changing the rate multipliers additional work needs to be done
855 involving bits 11-8 of register 0x0c04 (routing/port configuration
856 register), bits 6 and 7 of 0x0b10 (optical control register) and other as
857 yet unidentified bits of 0x0b14.  While 0x0b10 and 0x0c04 are always
858 written, they only seem to change value only when moving to a 4x multiplier.
859 to ensure the ADAT/SPDIF optical port is disabled at 4x sample rates.
860
861 The rest of the details associated with these other registers are yet to be
862 deduced.  Note for instance that the 0x0b10 changes only appear to affect
863 ADAT controls - verified by observing that the same changes to 0x0b10 are
864 made when the optical ports are turned off in the Audio console program.
865
866 When the clock source is changed via this register, the textual name of the
867 source is always sent immediately afterward to 0x0c60-0x06c.  This is used
868 to report the current clock as selected by the PC on the LCD via the setup
869 menu.  See the description of these registers for more details.
870
871 SMTPE is interesting: its distinct value (3) is configured only if one
872 requests SMTPE as the clock source under the SMTPE console.  Selecting SMTPE
873 as the source in the Audio console appears to use the "internal" setting for
874 bits 0-3.
875
876
877 0x0b1c - 896HD register associated with programmable meters
878
879 The role of this register is currently unknown.  Whenever the programmable
880 meters are configured via register 0x0b24, 0x0400 is written to this register
881 after the write to register 0x0b24.
882
883
884 0x0b24 - 896HD programmable meter register
885
886 Register 0x0b24 doesn't exist in the MOTU Traveler/828Mk2 hardware, but a
887 read request is always sent to it twice during device
888 discovery/initialisation.  In response these interfaces return "type_error"
889 with data equal to 0x40000.  The precise purpose of this is not known but it
890 could be part of the device probing sequence.
891
892 Register 0xb24 does however exist on the 896HD and appears to control the
893 programmable meters:
894
895   bits 31-14: Unknown at present.  Always observed to be set to 0.
896
897   bits 13-11: Peak hold time:
898                 000 = off
899                 001 = 2 sec
900                 010 = 4 sec
901                 011 = 10 sec
902                 100 = 1 minute
903                 101 = 5 minutes
904                 110 = 8 minutes
905                 111 = infinite
906
907   bits 10-8: Clip hold time:
908                 000 = off
909                 001 = 2 sec
910                 010 = 4 sec
911                 011 = 10 sec
912                 100 = 1 minute
913                 101 = 5 minutes
914                 110 = 8 minutes
915                 111 = infinite
916
917   bits 7-3: Unknown at present.  Always observed to be set to 0.
918
919   bit 2: AES/EBU meter source:
920           0 = AES/EBU out
921           1 = AES/EBU in
922
923   bits 1-0: Programmable meter source:
924               0 = Analog out
925               1 = ADAT in
926               2 = ADAT out
927
928
929 0x0b28 - copy of model_id unit directory
930
931 This register appears to be a copy of the model_id unit directory, normally
932 found in config ROM register 0x0434.  The presence and contents of this
933 register have only been verified on the 828MkII - the driver reads this
934 register when a 828MkII is connected but the Traveler initialisation
935 sequence does not appear to read it.
936
937
938 0x0b2c - something related to selections in mixer application
939
940 This register has something to do with destination of the selected mix bus
941 in the mixer application.  When a mix bus is selected, 0xbXX is written to
942 this register where XX is the output destination of the selected mix bus.
943 The interpretation of XX is the same as for the 0x0c20 register - see below.
944
945 The point of this is not currently known.
946
947 If "Cuemix input includes computer output" is selected in cuemix console:
948   0xc01 is written to register 0x0b2c
949   0x001 is written to register 0x0c18
950
951 When "Cuemix input includes computer output" is turned off in cuemix console:
952   0xc00 is written to register 0x0b2c
953   0x000 is written to register 0x0c18
954
955 When Cuemix console is started, 0xb00 is written to register 0x0b2c after
956 the rest of the startup sequence is complete; some time later a value
957 of 0x0b02 is written.  This sequence is possibly related to the mix
958 inherently selected when cuemix is started; as noted above, when a mix
959 is selected it does cause 0xb00 to be written to.
960
961 Register 0x0b2c appears to be read-only.
962
963
964 0x0c00 - firmware programming control
965
966 It appears that when the MOTU is in "update" mode this register is used
967 to enable writing to the device's firmware area (registers 0x010000 -
968 0x019ffc and 0x01c000 - 0x02fffc).  Writing 0x4d4f5455 ("MOTU") seems
969 to enable writes to the firmware while writing 0x00 is written when the
970 firmware update is complete.
971
972
973 0x0c04 - routing / port configuration
974
975 This register appears to have something to do with routing and port
976 configuration.  On some devices (the Ultralite for example) this register
977 must be initialised to something sensible before the device will accept
978 streaming enable commands via the streaming control register.
979
980 Bits 7-0 control the source for the phones output.  The numbers used are
981 the same as for the output destination of the mix routing control (0x0c20
982 etc) - see below for details.
983
984 Bits 9-8 specify the mode of the optical input port:
985   00 = off, 01 = ADAT, 10 = TOSLink (numbers given are in binary)
986 The "TOSLink" option is not available on the 896HD.  Register 0xb10 also
987 plays a role in setting the optical input port mode.
988
989 Bits 11-10 specify the mode of the optical output port in the same way
990 as for the optical input port.  Again, register 0b10 seems to play a role
991 in setting the optical output port mode.
992
993 Bit 24 enables the setting of the phones source.  Bit 25 probably allows the
994 optical modes to be set.
995
996 Bits 31-26, 23-12 are unknown at present.  They seem to always be zero.
997
998
999 0x0c08 - input level (for analog channels 5-8 only)
1000
1001 This sets the input level for analog channels 5 to 8.  The default is
1002 +4 dBU, but this register can be used to select -10 dBU if desired.
1003
1004 Only bits 4-7 appear to be significant in this register when setting input
1005 level; all other bits are set to zero.
1006
1007   bit 4: analog channel 5 input level
1008   bit 5: analog channel 6 input level
1009   bit 6: analog channel 7 input level
1010   bit 7: analog channel 8 input level
1011
1012 It seems likely that bits 0-3 are reserved for analog channels 1-4
1013 respectively.
1014
1015 When a channel's bit is set (the default condition) an input level of +4 dBU
1016 is assumed.  If the bit is zero it selects an input level of -10 dBU for
1017 the respective channel.
1018
1019 A write to this register sets the input level for all channels.
1020
1021 The MOTU mixer application ties analog channels 5/6 and 7/8 together
1022 (presumedly as a stereo pair) and activates the input level for the pair
1023 whenever one channel is selected (even when the channels are not "paired").
1024 However, it has been verified that the input level of channels can be
1025 individually controlled though this register.
1026
1027
1028 0x0c14 - boost controls (for analog channels 5-8 only)
1029
1030 Bits 4-7 of this register controls the activation of an additional 6dB of
1031 gain for analog channels 5-8.  All other bits are set to zero.
1032
1033   bit 4: analog channel 5 boost
1034   bit 5: analog channel 6 boost
1035   bit 6: analog channel 7 boost
1036   bit 7: analog channel 8 boost
1037
1038 Once again, bits 0-3 are probably reserved for analog channels 1-4 if they
1039 were ever to acquire this functionality.
1040
1041 When a bit is zero (the default condition) the additional 6 dB boost is not
1042 active.  When set to 1, the boost becomes active for the respective channel.
1043
1044 The boost status of all 4 channels is always updated by a write to this
1045 register.
1046
1047
1048 0x0c18 - something related to selections in mixer application
1049
1050 If "Cuemix input includes computer output" is selected:
1051   0xc01 is written to register 0x0b2c
1052   0x001 is written to register 0x0c18
1053
1054 When "Cuemix input includes computer output" is turned off:
1055   0xc00 is written to register 0x0b2c
1056   0x000 is written to register 0x0c18
1057
1058
1059 0x0c0c - "Main out" volume control
1060
1061 Bits 7-0 of this register control the device's "main out" volume (0x80 = 0 dB,
1062 0x00 = -inf).  Bits 31-8 appear unused at present.
1063
1064
1065 0x0c10 - phones volume control
1066
1067 Bits 7-0 of this register control the device's phones volume (0x80 = 0 dB,
1068 0x00 = -inf).  Bits 31-8 appear unused at present.
1069
1070
1071 0x0c1c - gain trim / 20 dB pad controls (for analog channels 1-4 only)
1072
1073 This register controls the trim gain and 20 dB pad available on analog
1074 channels 1-4.  Byte 0 (the least significant byte) controls analog channel
1075 1.  Bytes 1-3 are for analog channels 2-4 respectively.
1076
1077 Bit 7 in each byte appears to always be set to 1.  The effect of setting
1078 bit 7 to 0 is currently unknown.  On write, bit 7 may be a write-enable
1079 control.
1080
1081 Bit 6 of a byte controls the 20 dB pad for the channel.  When bit 6 is set
1082 (ie: equal to 1) the pad is engaged.  When bit 6 is zero the pad is switched
1083 out.
1084
1085 Bits 0-5 set the gain trim value; 0 sets a gain of 0dB (the default) while
1086 a value of 0x35 (53) sets the maximum gain of 53 dB.  The trim gain acts
1087 in steps of 1 dB.
1088
1089 It seems the gain trim and pad settings of all channels can be set with a
1090 single write to this register.  However, if a channel's byte is written as
1091 zero its settings remain unchanged.
1092
1093
1094 0x0c20, 0x0c24, 0x0c28, 0x0c2c - mix1, mix2, mix3 and mix4 routing controls
1095
1096 These registers control routing for the mix buses.  The format used by the
1097 four mix buses is the same, so only 0x0c20 (mix1 routing control) is
1098 explicitly discussed.
1099
1100   bits 31-26: function currently unknown.  All bits seem to be set to 0.
1101   bit 25:     enable setting of mute status and destination.
1102   bit 24:     enable setting of fader.
1103   bits 23-16: function currently unknown.  All bits seem to be set to 0.
1104   bits 15-13: purpose unknown.  Seems to be set to 0.
1105   bit 12:     mute control.  0=unmute, 1=mute.
1106   bits 11-8:  output destination (see below).
1107   bits 7-0:   mix output fader.  0x80 = 0 dB, 0x00 = -inf
1108
1109 The output destination is defined as follows:
1110
1111   0x0 = disabled
1112   0x1 = headphone output
1113   0x2 = analog 1-2
1114   0x3 = analog 3-4
1115   0x4 = analog 5-6
1116   0x5 = analog 7-8
1117   0x6 = AES-EBU (Main-out on 896HD)
1118   0x7 = SPDIF (AES-EBU on 896HD)
1119   0x8 = ADAT 1-2
1120   0x9 = ADAT 3-4
1121   0xa = ADAT 5-6
1122   0xb = ADAT 7-8
1123
1124 Note that it is not possible to set the mute and destination status
1125 separately - they are both set when bit 25 is set.
1126
1127
1128 0x0c60, 0x0c64, 0x0c68, 0x0c6c - ASCII name of current clock source
1129
1130 These registers appear to hold the ASCII name of the current clock source.
1131 If the source name is less than 16 characters it is padded with spaces
1132 (0x20).  The most significant byte of each register holds the leftmost
1133 character of the group of 4 characters held by a that register.  For
1134 example, if a register needs to hold the string "ABCD", the most significant
1135 byte will be 65 ("A").
1136
1137 Currently defined strings are as follows.
1138
1139   "Internal        " - internal clock source
1140   "SMPTE           " - SMPTE syncing
1141   "AES-EBU         " - use clock from AES-EBU
1142   "SPDIF           " - clock from (coaxial) SPDIF
1143   "TOSLink         " - clock from (optical) TOSLink
1144   "Word Clock In   " - use the word clock input
1145   "ADAT 9-pin      " - use the 9-pin ADAT interface for the clock
1146   "ADAT Optical    " - sync from ADAT optical interface
1147
1148 When a computer is connected to the MOTU the only way to set the clock
1149 source is from the computer - the front panel controls for this are
1150 disabled.  The string sent via these registers is used to display the name
1151 of the clock source as selected by the computer.  If the clock source is
1152 changed (via register 0x0b14) but nothing is downloaded using these
1153 registers, the "current clock source" display on the LCD via the setup menu
1154 will be blank.
1155
1156 One would have thought the Motu would be smart enough to provide the display
1157 string by itself given that it seems to manage to set the string fine by
1158 itself when there's no PC connected and the front panel is used to change
1159 the clock source.
1160
1161
1162 0x0c70 - gain trim / phase invert (Ultralite only, analog channels 1-4)
1163
1164 On the Ultralite, gain trim is controlled using a different register than
1165 with the other MOTU devices.  This register controls gain trim and phase
1166 inversion for analog channels 1-4.  Byte 0 (the least significant byte)
1167 controls analog channel 1.  Bytes 1-3 are for analog channels 2-4
1168 respectively.
1169
1170 Bit 7 in each byte appears to always be set to 1 when changing the
1171 corresponding channel's setting.  It therefore seems that bit 7 is a
1172 write-enable bit for the channel's setting.
1173
1174 Bit 6 of a byte controls the phase inversion setting.  When set (ie: equal
1175 to 1) phase inversion is active.  When bit 6 is zero phase inversion is not
1176 enagaged.
1177
1178 Bits 0-5 set the gain trim value; 0 sets a gain of 0dB (the default).  The
1179 maximum gain available is determined by the type of channel.  For analog
1180 channels 1-2 (the mic inputs), the maximum effective setting is 0x18 (24).
1181 For analog channels 3-8 the maximum is 0x12 (18) while for SPDIF channels
1182 the maximum is 0x0c (12).  The value written is in dB - thus each gain trim
1183 control operates in steps of 1 dB.
1184
1185 Setting a channel's byte to zero causes its settings to remain unchanged.
1186 This allows any combination of the 4 channels to be changed without
1187 interference to those not being changed.
1188
1189
1190 0x0c74 - gain trim / phase invert (Ultralite only, analog channels 5-8)
1191
1192 This register operates as described for 0x0c70 except it controls analog
1193 channes 5 to 8.  The least significant byte corresponds to analog channel 5.
1194
1195
1196 0x0c78 - gain trim / phase invert (Ultralite only, SPDIF 1 and 2)
1197
1198 This register operates as described for 0x0c70 except it controls SPDIF 1
1199 and SPDIF 2.  The least significant byte corresponds to SPDIF 1.  Bytes 2
1200 and 3 are currently unused and should always be set to zero when writing to
1201 this register.
1202
1203
1204 0x4y00-0x4y4c (y=0-3) - gain/pan/solo/mute registers
1205
1206 These registers control the fader, pan, mute and solo settings for a given
1207 input channel in each of the 4 mix buses.  y=0 is mix1, y=1 is mix2, y=2 is
1208 mix3 and y=3 is mix4.
1209
1210   Bit 31:     enable setting of pan
1211   Bit 30:     enable setting of gain
1212   Bit 29:     enable setting of bit 21
1213   Bit 28:     enable setting of bit 20
1214   Bit 27:     enable setting of pairing
1215   Bit 26:     enable setting of bit 18
1216   Bit 25:     enable setting of solo
1217   Bit 24:     enable setting of mute
1218   Bit 23:     seems to be unsettable; set to zero
1219   Bit 22:     seems to be unsettable; set to zero
1220   Bit 21:     can be set to 1 but no effect apparent
1221   Bit 20:     can be set to 1 but no effect apparent
1222   Bit 19:     activate pairing
1223   Bit 18:     can be set to 1 but no effect apparent
1224   Bit 17:     channel solo.  0=solo off, 1=solo on.
1225   Bit 16:     channel mute.  0=unmuted, 1=muted.
1226   Bits 15-8:  pan.  0x40=0 (centre), 0x80=+64 (right), 0x00=-64 (left)
1227   Bits 7-0:   gain.  0x00 = -inf, 0x80 = 0 dB.
1228
1229 When reading these registers in normal operation, bits 31-27 and bits 23-18
1230 seem to be all zero while bits 26-24 are all 1.  The Cuemix console however
1231 appears to set bits 31-30 and zero bits 29-18.  In other words, a typical
1232 read-back value might be 0x0700406a while to actually set the mixer to this
1233 one would need to use a value of 0xc300406a.  It seems likely that at least
1234 some of the bits have different meanings when read and written; for instance
1235 there doesn't seem to be much point in bits 24-26 being set on readback
1236 given the above definitions, but they are.
1237
1238 If channel pairing is to be activated it must be set in both channels which
1239 form a stereo pair.  However, paired channels are still controlled
1240 individually by the mixer registers - for example, if channels 1 and 2 are
1241 paired it is still possible to raise channel 1's volume in mix1 by writing
1242 only to register 0x4000.  In other words, the device does not enforce linked
1243 controls when channels are paired.  The "paired" flag is really just a hint
1244 to the mixer at the end of the day.
1245
1246
1247 Gain and pan value-dB mappings for the Traveler
1248 ===============================================
1249
1250 The following gain map runs from 0x00 (-inf) to 0x80 (0 dB).  The dB values
1251 were taken directly off the Cuemix console application.
1252
1253 Gain steps (dB): -inf, -84, -72, -65, -60, -56, -53, -50, -48, -46, -44,
1254   -43, -41, -39.7, -38.4, -37.2, -36.1, -35.1, -34.1, -33.1, -32.2, -31.4,
1255   -30.6, -29.8, -29.1, -28.4, -27.7, -27.0, -26.4, -25.8, -25.2, -24.6,
1256   -24.1, -23.5, -23.0, -22.5, -22.0, -21.5, -21.1, -20.6, -20.2, -19.8,
1257   -19.4, -19.0, -18.6, -18.2, -17.8, -17.4, -17.0, -16.7, -16.3, -16.0,
1258   -15.6, -15.3, -15.0, -14.7, -14.4, -14.1, -13.8, -13.5, -13.2, -12.9,
1259   -12.6, -12.3, -12.0, -11.8, -11.5, -11.2, -11.0, -10.7, -10.5, -10.2,
1260   -10.0, -9.8, -9.6, -9.3, -9.1, -8.8, -8.6, -8.4, -8.2, -7.9, -7.7, -7.5,
1261   -7.3, -7.1, -6.9, -6.7, -6.5, -6.3, -6.1, -5.9, -5.7, -5.5, -5.4, -5.2,
1262   -5.0, -4.8, -4.6, -4.5, -4.3, -4.1, -3.9, -3.7, -3.6, -3.4, -3.3, -3.1,
1263   -3.0, -2.8, -2,6, -2.5, -2.3, -2.2, -2.0, -1.9, -1.7, -1.6, -1.4, -1.3,
1264   -1.1, -1.0, -0.8, -0.7, -0.6, -0.4, -0.3, -0.1, 0.0
1265
1266 Pan: (approximate findings)
1267   full pan on: +3 dB gain
1268   0: 0 dB
1269   20/64 pan off: -3 dB
1270   40/64 pan off: -6 dB
1271   55/64 pan off: -15 dB
1272   59/64 pan off: -24 dB
1273   full pan off: -inf gain
1274
1275 Pan dB map.  This table runs from value 0 (pan full left) to 0x80 (pan
1276 full right).  The gain values are for a left channel signal.
1277   2.505, 2.505, 2.505, 2.499, 2.499, 2.492, 2.486, 2.479, 2.473, 2.460,
1278   2.453, 2.440, 2.427, 2.414, 2.400, 2.387, 2.367, 2.347, 2.331, 2.308,
1279   2.288, 2.267, 2.241, 2.220, 2.194, 2.166, 2.139, 2.105, 2.078, 2.044,
1280   2.016, 1.982, 1.940, 1.905, 1.870, 1.828, 1.786, 1.743, 1.700, 1.657,
1281   1.607, 1.563, 1.512, 1.461, 1.409, 1.358, 1.298, 1.245, 1.185, 1.124,
1282   1.063, 1.001, 0.931, 0.868, 0.797, 0.725, 0.653, 0.580, 0.507, 0.424,
1283   0.341, 0.265, 0.257, 0.087, 0.000,
1284   -0.087, -0.176, -0.274, -0.373, -0.473, -0.584, -0.687, -0.801, -0.916,
1285   -1.033, -1.151, -1.271, -1.403, -1.526, -1.662, -1.800, -1.940, -2.083,
1286   -2.239, -2.386, -2.548, -2.713, -2.881, -3.058, -3.240, -3.437, -3.614,
1287   -3.814, -4.018, -4.228, -4.457, -4.678, -4.920, -5.168, -5.489, -5.688,
1288   -5.969, -6.259, -6.568, -6.889, -7.222, -7.568, -7.928, -8.327, -8.722,
1289   -9.160, -9.621, -10.108, -10.624, -11.205, -11.810, -12.460, -13.182,
1290   -13.971, -14.886, -15.855, -16.976, -18.264, -19.819, -21.715, -24.143,
1291   -27.526, -33.143, -inf
1292
1293 dB factors for values of 0, 1 and 2 are all 2.505 dB while those for pan
1294 values of 3 and 4 are both 0.499.  This is because the voltage variation
1295 across each of these groups of values was below the resolution of the meter
1296 used to measure the voltages (0.001 Vrms).  One can probably safely assume
1297 that the actual variation across these groups is approximately linear, so
1298 "corrected" dB values for the first 5 pan values can probably be taken to be
1299   2.508, 2.505, 2.504, 2.501, 2.499
1300
1301 The pan map was measured by injecting a 0.992 Vrms sine wave at 308 Hz into
1302 analog1 input channel of the Motu.  Channel 1's -20 dB pad was switched in
1303 to avoid overloading the preamp and a gain trim of +11 dB was used. This
1304 combination resulted in a signal of 0.999 Vrms being emitted from analog1
1305 output with the analog1's fader set to 0 dB.
1306
1307 The output RMS voltage was then measured for each setting of the pan
1308 control.  Resolution of these measurements was 0.001 Vrms.  The dB gain
1309 value was calculated relative to the centre pan position using
1310
1311   dB = 20log10(V/ref)
1312
1313 where ref was the voltage measured with the pan control set to the centre
1314 (ie: a pan value of 0x40).
1315
1316 A frequency of approximately 300 Hz was chosen since this was firmly within
1317 the flat response region of the multimeter used for measuring the voltage.
1318 If the frequency drifted slightly the frequency response of the meter would
1319 therefore not artificially change the voltage measurement.
1320
1321 The input signal was generated using a precision audio signal generator.
1322 The amplitude is tightly regulated and did not change for the duration of
1323 these tests.
1324
1325 The meter used was not able to measure voltages below 0.004 Vrms.  This was
1326 a limitation of the meter - it was not an additive offset which affected
1327 voltage measurements.
1328
1329 Putting all this together it is expected that the dB values for the pan map
1330 are accurate to at least 1 decimal place.
Note: See TracBrowser for help on using the browser.