Stream Configuration

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.

Config Option Id Description
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

Id Default
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.

Example Usage:

stream-config 2 0 30   // Buffer 30 heart rate samples before passing them to outputs.

File Buffer Size

Id Default
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.

Example Usage:

stream-config 1 1 1024   // Set EEG file buffer size to 1024 bytes

Sample Rate

Id Default
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.

Example Usage:

stream-config 2 2 60  // Sample heart rate once a minute

Sync Interval

Id Default
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.

Example Usage:

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 session.txt file 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.

Id Data Type Values
0 unknown N/A
1 boolean {0,1}
2 char ASCII UTF8
3 uint8 [0, 255]
4 int8 [-128, 127]
5 uint16 [0, 65536]
6 int16 [-32768, 32767]
7 uint32 [0, 4294967296]
8 int32 [-2147483648, 2147483647]
9 float 32-bit IEEE 754
10 string ASCII UTF8
11 pointer [0x00000000, 0xFFFFFFFF]

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.

results matching ""

    No results matching ""