Audio data format - btsimonh/Behringer-BCA-2000-ASIO-driver GitHub Wiki
Both data in and data out is send as isochronous transfers. There does seem to be different modes available, but i will initially concentrate on 8 channel I/O, 24 bit. When set to this mode, the BCA2000 seems to generate/accept 32 bit intel ordered samples, in groups of eight.
Input data: Data is read from endpoint 2. The buffers supplied must be 512 bytes per microframe, but the BCA-2000 will fill them with the data it has available at that time. The data supplied is NOT sample or channel aligned, so we must gather it up for onward presentation in sample aligned blocks.
Output data: output data seems to be sent by default sample aligned (i.e. we observe outgoing data with is always a multiple of 32 bytes for 8 channel/32 bit data).
The input data seems to flow in quite easily. The output data is more complex, as if the fifo in the unit underflows, it stops outputting audio, and if the fifo overflows, there is a pop. The key to the output regulation is to start up the RX, wait for the number of bytes coming in to be correct for the sample rate, then to enable the TX, ensuring that the number of bytes sent per frame equals the number of bytes received on average. When sending, packets are filled to whole numbers of samples, but when receiving, the data is word aligned, so we keep a running total, and track this.