| 142 | Waiting for device flash |
---|
| 143 | ------------------------ |
---|
| 144 | |
---|
| 145 | To preserve the device's settings across power cycles the settings are |
---|
| 146 | stored in a flash memory on the device. This is read during driver |
---|
| 147 | initialisation to ensure the driver's status agrees with that of the device. |
---|
| 148 | |
---|
| 149 | When interacting with the device's flash memory one must wait for the |
---|
| 150 | completion of an operation before attempting another. The location of the |
---|
| 151 | "device busy" flag differs between the FF400 and FF800. |
---|
| 152 | |
---|
| 153 | On the FF800 is part of the quadlet register at 0x801c0004 (part of the |
---|
| 154 | read-only status register block beginning at 0x801c0000). The device is |
---|
| 155 | ready to accept another command when bit 30 is set. |
---|
| 156 | |
---|
| 157 | On the FF400 the wait state is found by reading a quadlet from CBR+8*4. |
---|
| 158 | If this quadlet is zero the FF400 is ready to accept another command. |
---|
| 159 | |
---|
| 160 | Most device flash operations have a minimum time to complete. There's no |
---|
| 161 | point in polling the device busy flag until at least this much time has |
---|
| 162 | elapsed. |
---|
| 163 | |
---|
| 164 | |
---|
204 | | configured by the driver. It seems the data is sent with one channel per |
---|
205 | | quadlet. The audio data is a 24 bit integer stored in the most-significant |
---|
206 | | 3 bytes of a quadlet. The LSB (low byte) of certain channels in the stream |
---|
207 | | sent by the Fireface is used to send synchronising information: |
---|
| 231 | configured by the driver. On a dedicated bus with nothing else present, the |
---|
| 232 | stream to the fireface is sent on iso channel 0 while data from the fireface |
---|
| 233 | is sent on iso channel 1. |
---|
| 234 | |
---|
| 235 | No CIP header is included in the iso data packet. Fireface data follows |
---|
| 236 | immediately after the standard 2-quadlet firewire iso packet header. |
---|
| 237 | |
---|
| 238 | Each iso packet contains a number of samples across all 28 device channels. |
---|
| 239 | For 1x rates, 7 samples per channel seem to be sent. Thus the size of |
---|
| 240 | the data portion of a 1x iso packet is 28*4*7 = 784, with a total packet |
---|
| 241 | size being 784 + 8 = 792. |
---|
| 242 | |
---|
| 243 | The data is sent with one audio channel per quadlet. The audio data is a 24 |
---|
| 244 | bit integer stored in the most-significant 3 bytes of a quadlet. The LSB |
---|
| 245 | (low byte) of certain channels in the stream sent by the Fireface is used to |
---|
| 246 | send synchronising information: |
---|
| 254 | Low byte of channel 2 & 3 = unknown (midi?) |
---|
| 255 | |
---|
| 256 | The low byte data from channels 0-7 is repeated in channels 8-15 and 16-23 |
---|
| 257 | respectively, with channels 24-27 containing the low byte data from channels |
---|
| 258 | 0-3. This repetition holds for the low bytes of channels 2-3 in all data |
---|
| 259 | seen so far, it might not necessarily be the case in general - it depends |
---|
| 260 | what the low byte data from channels 2 and 3 are used for. |
---|
| 261 | |
---|
| 262 | The rx sample counter appears to be used to detect missed samples. The |
---|
| 263 | current frame and phase from a received packet is used in conjunction with |
---|
| 264 | the stored values of these from the previous frame to track the phase of |
---|
| 265 | the audio clock. |
---|
| 266 | |
---|
| 267 | A "frame" consists of a fixed number of samples across all channels of the |
---|
| 268 | device. At 1x rates this appears to be 7, but it might not be fixed. Even |
---|
| 269 | though this is the same as the number of samples per channel per packet, a |
---|
| 270 | given packet can experience a change in the "current frame" part way |
---|
| 271 | through. In other words, the "current frame" is not necessarily constant |
---|
| 272 | for all samples in a packet. |
---|