From 4f6c39836ca5eb2c594f065070bec0cd55b79769 Mon Sep 17 00:00:00 2001 From: bparks13 Date: Wed, 24 Sep 2025 12:16:32 -0400 Subject: [PATCH 1/2] Round ReadSize property up to next multiple of 4 --- OpenEphys.Onix1/StartAcquisition.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/OpenEphys.Onix1/StartAcquisition.cs b/OpenEphys.Onix1/StartAcquisition.cs index 88a90d25..f14c0acd 100644 --- a/OpenEphys.Onix1/StartAcquisition.cs +++ b/OpenEphys.Onix1/StartAcquisition.cs @@ -41,11 +41,14 @@ namespace OpenEphys.Onix1 [Description("Starts data acquisition and frame distribution on a ContextTask.")] public class StartAcquisition : Combinator> { + int readSize = 2048; + /// /// Gets or sets the number of bytes read per cycle of the 's acquisition /// thread. /// /// + /// /// This option allows control over a fundamental trade-off between closed-loop response time and /// available bandwidth. A minimal value, which is determined by , will provide the lowest response latency, so long as data @@ -55,10 +58,18 @@ public class StartAcquisition : Combinator). + /// + /// + /// The number of bytes set will be rounded up to the next multiple of four. + /// /// [Description("Number of bytes read per cycle of the acquisition thread.")] [Category(DeviceFactory.ConfigurationCategory)] - public int ReadSize { get; set; } = 2048; + public int ReadSize + { + get => readSize; + set => readSize = (value + 3) & ~3; // NB: Round up to the next multiple of four to align with word boundaries in liboni + } /// /// Gets or sets the number of bytes that are pre-allocated for writing data to hardware. From f5f62aa526c5180228443dd9851819f19d47448d Mon Sep 17 00:00:00 2001 From: bparks13 Date: Mon, 29 Sep 2025 17:37:05 -0400 Subject: [PATCH 2/2] Update ReadSize documentation --- OpenEphys.Onix1/StartAcquisition.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenEphys.Onix1/StartAcquisition.cs b/OpenEphys.Onix1/StartAcquisition.cs index f14c0acd..86c0d556 100644 --- a/OpenEphys.Onix1/StartAcquisition.cs +++ b/OpenEphys.Onix1/StartAcquisition.cs @@ -60,7 +60,8 @@ public class StartAcquisition : Combinator). /// /// - /// The number of bytes set will be rounded up to the next multiple of four. + /// If a value is set that is not aligned to a 32-bit word boundary, it will be rounded up + /// to the next 32-bit aligned value. /// /// [Description("Number of bytes read per cycle of the acquisition thread.")]