open-ephys / ONI

Open Neuro Interface Hardware Specification and API Documentation
https://open-ephys.github.io/ONI/
Creative Commons Attribution Share Alike 4.0 International
1 stars 2 forks source link

Clarify high-bandwidth stream data alignment requirements #3

Open jonnew opened 9 months ago

jonnew commented 9 months ago

This proposed specification enhancement stems from open-ephys/liboni#16. After an internal discussion, we are proposing the following enhancements to the spec to balance performance, implementability, and separation of API responsibilities from hardware.

The hardware must:

  1. have the ability to inform the API what the width its will use will be. We the space below is a good place to discuss how this should occur and what it will mean to the spec
  2. Ensure that device read and write sizes, as reported in the device table and without modification by the API, fall on natural boundaries of the width specified in (1). This ensures the API does not have to do padding on top of the reported read and write sizes in order to prevent data corruption. A corollary of this requirement is that, since devices can report data read and write sizes at byte resolution, the read and write sizes that appear on a device datasheet should not be considered lower bounds that can be rounded to fit the read and write stream bus width. However, this will be transparently presented in the device table which will contain the real read and write sizes of each device, including the padding required to meet the data boundary requirements.

The API must:

  1. Use the read and write boundary information reported by the hardware to modify requested block read and write sizes to fall on these boundaries. Again, this modification will be made transparent as the real block read and write sizes will be reported via oni_get_opt().