open-ephys / liboni

API for controlling ONI-compliant hardware
https://open-ephys.github.io/onix-docs/API%20Reference/index.html
0 stars 5 forks source link

Minimum frame size is not the minimum BLOCKREADSIZE #11

Open jonnew opened 1 year ago

jonnew commented 1 year ago

The frame_size result of

oni_get_opt(ctx, ONI_OPT_MAXREADFRAMESIZE, &frame_size, &frame_size_sz);

cannot be used to set the minimal ONI_OPT_BLOCKREADSIZE via

    oni_size_t block_read_size = frame_size;
    size_t block_size_sz = sizeof(block_read_size);
    rc = oni_set_opt(ctx,
                    ONI_OPT_BLOCKREADSIZE,
                    &block_read_size,
                    block_size_sz);

due to some required overhead. This is not a bug, but something that needs to a least be documented and perhaps requires a utility function to get the correct minimal ONI_OPT_BLOCKREADSIZE.