The server's monotonic audio clock, shared by all sessions and streams.
Snapcast timestamps are {sec, usec} on an arbitrary steady clock — only
differences matter (the client derives its offset from Time sync), so we use a
single process-wide epoch and express everything relative to it. Keeping values
small also keeps sec within int32.
Summary
Functions
Convert an absolute System.monotonic_time(:microsecond) value to this clock.
Fix the epoch (call once at startup). Safe to call repeatedly.
Current time as a snapcast {sec, usec} tv.
Microseconds since the server epoch (monotonic, non-negative).
{sec, usec} → microseconds.
Microseconds → {sec, usec}. Uses truncating div/rem so sec*1e6 + usec == us
exactly, including for negatives (Time-sync deltas can be negative).
Functions
Convert an absolute System.monotonic_time(:microsecond) value to this clock.
Fix the epoch (call once at startup). Safe to call repeatedly.
Current time as a snapcast {sec, usec} tv.
Microseconds since the server epoch (monotonic, non-negative).
{sec, usec} → microseconds.
Microseconds → {sec, usec}. Uses truncating div/rem so sec*1e6 + usec == us
exactly, including for negatives (Time-sync deltas can be negative).