Skip to content

Use ezmsg.baseproc.SteadyClockSync for LSL clock conversion - #57

Merged
cboulay merged 1 commit into
mainfrom
feat/steady-clock-sync
Nov 30, 2026
Merged

cboulay merged 1 commit into
mainfrom
feat/steady-clock-sync

Conversation

@cboulay

@cboulay cboulay commented Nov 30, 2026

Copy link
Copy Markdown
Member

Replaces ezmsg.lsl.util.ClockSync's blocking EMA/background-thread estimator with ezmsg.baseproc.SteadyClockSync (introduced in ezmsg-baseproc>=1.18.0).

Changes

  • src/ezmsg/lsl/util.py: Back ClockSync with ezmsg.baseproc.util.clocksync.get_steady_clock_sync(), preserving the public singleton API and offset = monotonic - lsl sign convention while removing the 100 ms blocking startup sleep, EMA jitter (which was re-injecting noise after StreamTiming dejittering), background polling thread, and lock races.
  • src/ezmsg/lsl/inlet.py: When use_arrival_time=True and use_lsl_clock=True, anchor directly to pylsl.local_clock() instead of round-tripping time.monotonic() through system2lsl(); fix stale time.time docstrings.
  • src/ezmsg/lsl/outlet.py: When use_message_timestamp=False, stamp directly with pylsl.local_clock() instead of round-tripping time.monotonic(); fix stale time.time docstring.
  • pyproject.toml: Bump ezmsg-baseproc>=1.18.0.
  • tests/test_segments.py: Parametrize test_arrival_time_stamps_the_newest_sample_now over use_lsl_clock=[False, True].

@cboulay
cboulay merged commit 4dc0504 into main Nov 30, 2026
14 checks passed
@cboulay
cboulay deleted the feat/steady-clock-sync branch November 30, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant