430 | | // standard. This gives approximately 0.5 us of overheads per |
---|
431 | | // packet - around 25 bandwidth allocation units (from the ieee1394 |
---|
432 | | // standard 1 bandwidth allocation unit is 125/6144 us). We further |
---|
433 | | // assume the MOTU is running at S400 (which it should be) so one |
---|
434 | | // allocation unit is equivalent to 1 transmitted byte; thus the |
---|
435 | | // bandwidth allocation required for the packets themselves is just |
---|
436 | | // the size of the packet. We allocate based on the maximum packet |
---|
437 | | // size (1160 bytes at 192 kHz) so the sampling frequency can be |
---|
438 | | // changed dynamically if this ends up being useful in future. |
---|
439 | | // Therefore we get a *per stream* bandwidth figure of 25+1160. |
---|
440 | | m_bandwidth = 25 + 1160; |
---|
| 431 | // standard. This gives approximately 0.5 us of overheads per packet - |
---|
| 432 | // around 25 bandwidth allocation units (from the ieee1394 standard 1 |
---|
| 433 | // bandwidth allocation unit is 125/6144 us). We further assume the |
---|
| 434 | // MOTU is running at S400 (which it should be) so one allocation unit |
---|
| 435 | // is equivalent to 1 transmitted byte; thus the bandwidth allocation |
---|
| 436 | // required for the packets themselves is just the size of the packet. |
---|
| 437 | // We used to allocate based on the maximum packet size (1160 bytes at |
---|
| 438 | // 192 kHz for the traveler) but now do this based on the actual device |
---|
| 439 | // state by utilising the result from getEventSize() and remembering |
---|
| 440 | // that each packet has an 8 byte CIP header. Note that m_bandwidth is |
---|
| 441 | // a *per stream* bandwidth - it must be allocated for both the transmit |
---|
| 442 | // and receive streams. |
---|
| 443 | signed int max_event_size = event_size_out>event_size_in?event_size_out:event_size_in; |
---|
| 444 | signed int n_events_per_packet = samp_freq<=48000?8:(samp_freq<=96000?16:32); |
---|
| 445 | m_bandwidth = 25 + (n_events_per_packet*max_event_size); |
---|