Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BaseInlet setup when receiving irregular rate stream #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ThomasPrampart
Copy link

Looking at the BaseInlet class, the structures to receive data from a stream are initialized based on the sampling rate and channel count.
When receiving a stream with irregular rate ( nominalSamplingRate = 0), the data buffer array is therefore of size 0.
This prevents from reading any data from the stream.

Irregular rate is usually used for Markers streams. I am not sure of any other usages ?
Those markers don't normally have a very high sampling rate.
The fix I propose is therefore to initialize the structures with a size of 128 (as in 128 events per seconds), which should be more than enough to read such type of data.

A more flexible way to do this would be to read sample by sample until done in the pullChunk method but I thought this might not be as efficient and the fix as it is should be sufficient. What do you think about it ?

@HeftyCoder
Copy link

HeftyCoder commented Jun 6, 2024

Had this problem as well. You just saved me the trouble of searching where the issue is. I think a better approach would be to let the user initialize the buffer (size or "irregular rate") through the editor.

Other than that, I hope they see this PR sooner than later!

PS: Other usages include Eye-Gaze data which is not sampled by the device, but depends on camera frame-rate and software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants