Annotations and time synchronization#

Event markers on the recording and how they are timed. See Streaming data.

annotation.h#

Annotation.

Author

Neurotechnology (brainaccess@neurotechnology.com)

Copyright

Copyright (c) 2022 Neurotechnology

struct ba_annotation#
#include <annotation.h>

Struct containing annotation information.

Public Members

size_t timestamp#

Sample number corresponding to the time the annotation was recorded

char *annotation#

Annotation text.

time_sync_info.h#

State of the time synchronization annotations are placed with, as read by ba_eeg_manager_get_time_sync_info.

Author

Neurotechnology (brainaccess@neurotechnology.com)

Copyright

Copyright (c) 2026 Neurotechnology

struct ba_time_sync_info#
#include <time_sync_info.h>

How the manager maps host time to sample numbers for annotations.

While a stream runs on firmware 3.8.0 or later, the library pings the device several times a second; each reply carries the device’s clock and the sample it numbered last. From them it fits the device’s clock against the host’s and the sample counter against the device’s clock, and ba_eeg_manager_annotate places an annotation with that fit instead of extrapolating from the newest packet, which lands early - on a sample from before the call - by that packet’s trip over the radio, and jitters with it.

Public Members

uint8_t supported#

1 if the device answered the time-sync probe at the start of the running stream, or of the last one; 0 for firmware before 3.8.0, or before the first stream.

uint32_t pings#

Replies taken into the clock fit on this connection.

double min_rtt_ms#

Shortest ping round trip of the last two minutes, in ms. 0 without pings.

How far above the clock fit’s lower envelope the median ping of the last two minutes arrives at the device, in ms: the wait for a connection event, and stack jitter, that the fit takes out of annotations. 0 without pings.

double sample_rate_hz#

The device’s sample rate as the fit measures it, per second of the device’s own clock. The nominal rate until a second of samples is in; 0 with no fit.

uint8_t valid#

1 if ba_eeg_manager_annotate places annotations with the fit right now; 0 if it falls back to the packet timing (no stream, impedance mode, older firmware, or too few or too old pings).