Configurable LSL clock source (e.g. PTP-disciplined clock) via lsl_api.cfg
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 8/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, linux, macos
- Ambito
- distributed-systems, networking
Direzione di ricerca
The clock behind lsl_local_clock() is defined in src/common.cpp, and the offset estimation lives in the LSL:timedata probe exchange. Before any code, the maintainers need to agree on the design: how lsl_api.cfg selects a clock, how a clock-domain token is advertised, and how steps are detected. Done means an agreed design and a scoped first step, not an implementation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
lsl_local_clock() is always std::chrono::steady_clock (src/common.cpp): CLOCK_MONOTONIC on Linux, mach_continuous_time on macOS, QPC on Windows. Each host's clock has an arbitrary epoch and its own rate, so every inlet has to estimate the offset with the NTP-style LSL:timedata probes.
When every host on the network is already synchronised by PTP, that estimate is the weakest link. Measurements on a Pi 5 / Gemini HUB2 / Mac mini rig, against a PTP reference:
- liblsl's offset error comes from per-host stamping bias:
[(s_A − r_A) − (s_B − r_B)]/2. It is about ±5 µs on well-configured hosts, ±27 µs with default NIC interrupt coalescing on the Pi, and shifts by tens of µs with load. Nothing in the reported uncertainty shows it. - PTP with hardware timestamps keeps the same hosts within ~1 µs.
Proposal: an lsl_api.cfg option to select the clock behind lsl_local_clock(), plus a way for inlets to skip the offset estimate when both ends share a synchronised clock domain.
Possible clock sources:
- Linux:
CLOCK_REALTIMEorCLOCK_TAIwhen phc2sys disciplines the system clock to the PHC, or the PHC itself viaclock_gettime(FD_TO_CLOCKID(fd))on/dev/ptpN. - Windows:
GetSystemTimePreciseAsFileTime. The w32time PTP client (Windows 11 / Server 2019+) steers system time, not QPC. - macOS: the system clock is not disciplined by gPTP. The kernel's 802.1AS mapping from mach time is reachable only through a private framework (see jclark/mac-gptp), so macOS may have to stay on steady_clock.
Design points:
- Shared clock domain. Extend the clock token added for same-clock detection, so the timedata reply can advertise a domain such as
ptp:<grandmasterIdentity>:<domainNumber>. The inlet then uses offset 0 when both ends match, and falls back to probing otherwise. The grandmaster identity is readable viapmcor the linuxptp management socket. - Steps and slews. A wall-clock source can step. It must be monotonic in practice, and steps must be detected; reject the option, or warn, if the system clock is not disciplined.
- Double precision. Epoch-based seconds (~1.8e9) in a
doubleresolve only ~0.24 µs. That is acceptable but worth stating, and an argument for an epoch offset or for keepinglsl_local_clock_ns()as the primary interface. - Mixed configurations. Hosts using steady_clock and hosts using a PTP clock must interoperate. That works with today's probes, since the offset is simply large.
Not in scope now; filed to record the idea.
- Lingua principale
- C++
- Stelle
- 184
- Fork
- 93
- Merge medio
- 1g 14h
- PR unite (30g)
- 6
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sccn/liblsl
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
Inlets don't detect a silently dead (half-open) data connectionForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
sccn/liblsl#294 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
sccn/liblsl#262 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
CefRequestContext::ClearHttpCache crashes with a null callback, though the callback is optionalApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
chromiumembedded/cef#4376 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
itinance/react-native-fs#1270 ·
-
area-CodeGen-coreclr untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotnet/runtime#138181 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yuaotian/antigravity-proxy#181 ·