All streams support a few basic configuration options that allow control over things like the sample rate and buffer size. The command stream-config is used to set such options. Option values are treated as 32 bit integers, so beware of overflows. Configuration options supported by all streams are listed in the table below. In most cases the default configuration values are perfectly fine, however for those brave souls looking to push the limits, these configuration options are provided1. Additionally, certain streams support extra configuration options unique to a particular stream. Refer to a stream's documentation section for more information.
|Output Buffer Size||0||Number of samples buffered before passed to outputs.|
|File Buffer Size||1||Size in bytes of file buffer used when outputing to file.|
|Sample Rate||2||The stream's sample rate.|
|Sync Interval||3||How often the stream's samples are adjusted to maintain the sample rate.|
Output Buffer Size
|0||See specific stream.|
Controls how many samples are buffered before passing them off to enabled outputs. Higher sample rate streams require a larger buffer and larger buffers require more RAM. In general this configuration value should never be decreased however it can be useful to increase this buffer size in order to achieve lower power configurations.
stream-config 2 0 30 // Buffer 30 heart rate samples before passing them to outputs.
File Buffer Size
|1||See specific stream.|
Specifies the number of bytes allocated for the file buffer used to write stream data files. Writes are triggered when the buffer is more than half way full to allow time to process the data. Higher sample rate streams require a larger buffer and larger buffers require more RAM. Large buffers (>= 512 bytes) should use multiples of 512 (Aurora's SD card sector size) to take advantage of the increased efficiency of multi-sector writes.
The optimal value takes in consideration the stream's sample rate, sample size, and configured output buffer size to limit the number of writes to the file, while providing enough buffer space to account for processing time and jitter in the system. Unless you are modifying a stream's sample rates or adjusting the output buffer size modifying this option is not recommended.
stream-config 1 1 1024 // Set EEG file buffer size to 1024 bytes
|2||See specific stream.|
Allows configuration of the stream's effective sample rate. The value specified is interpreted differently depending on the stream's sample rate type. Derived streams' sample rates are dependent on the sample rates of the streams they are derived from, therefore their sample rate cannot be adjusted directly using this configuration option.
Each stream supports a limited number of sample rates. In some cases sample rates are adjusted in software, i.e. samples are dropped or averaged to produce the desired sample rate. Please refer to each specific stream for details.
stream-config 2 2 60 // Sample heart rate once a minute
|3||See specific stream.|
Controls how often (in ms) the sample rate is "synced" with the configured sample rate to keep the effective sample rate constant. Some of the sensors used in Aurora utilize internal FIFO buffers which are filled/clocked by internal crystals that have inherent differences in accuracy. While this is power efficient, it means that over long periods of time these small variances in sensor sampling speeds can lead to non-constant sample rates and produce drifts in the data. To compensate for this, Aurora can "sync" the sampling rate by periodically dropping or adding averaged samples, keeping the effective sampling rate constant. The value should be chosen such that on average 1 sample is adjusted every other interval. The default values have been chosen accordingly and in general should not need to be changed.
stream-config 1 3 500 // EEG sample rate synced twice a second
Stream Data Types
The data type associated with a particular stream cannot be changed. They are nevertheless useful because the
includes this id whenever a stream is enabled while a session is in progress. Because of this, it is possible to handle parsing of
individual stream data files in a generic way, allowing future expansion of the available stream list with little to no modification
of supporting software.
|9||float||32-bit IEEE 754|
Sample Rate Types
Similar to Stream Data Types, each stream has a non-configurable associated "sample rate type" that determines how "sample rate values" are interpreted when changing the sample rate.
|Id||Sample Rate Type|
|0||Hertz (Samples per second)|
|1||Seconds per sample|
|2||Minutes per sample|
|3||Dependent / Derived|
1 All possible combinations of potential options have not been tested and it is very likely that certain combinations will lead to unexpected results or potentionally system crashes. While playing with these options can not cause any permanent damage to your device, we nevertheless must say: use at your own risk.