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

Ensure block size is set just before context start #73

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions OpenEphys.Onix/OpenEphys.Onix/ContextTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ void ConfigureResources(StackDisposable disposable, Func<ContextTask, IDisposabl
}
}

internal void Start()
internal void Start(int blockReadSize, int blockWriteSize)
{
lock (regLock)
{
if (running) return;

// NB: Configure context before starting acquisition
ContextConfiguration = ConfigureContext();
ctx.BlockReadSize = blockReadSize;
ctx.BlockWriteSize = blockWriteSize;

// NB: Stuff related to sync mode is 100% ONIX, not ONI, so long term another place
// to do this separation might be needed
Expand Down Expand Up @@ -289,10 +291,6 @@ public int BlockReadSize
{
return ctx.BlockReadSize;
}
set
{
ctx.BlockReadSize = value;
}
}

public int BlockWriteSize
Expand All @@ -301,10 +299,6 @@ public int BlockWriteSize
{
return ctx.BlockWriteSize;
}
set
{
ctx.BlockWriteSize = value;
}
}

public PassthroughState HubState
Expand Down
4 changes: 1 addition & 3 deletions OpenEphys.Onix/OpenEphys.Onix/StartAcquisition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public class StartAcquisition : Combinator<ContextTask, oni.Frame>
var disposable = context.FrameReceived.SubscribeSafe(observer);
try
{
context.BlockReadSize = ReadSize;
context.BlockWriteSize = WriteSize;
context.Start();
context.Start(ReadSize, WriteSize);
}
catch
{
Expand Down