-
Notifications
You must be signed in to change notification settings - Fork 23
detected breaks not only if diffs are positive, but use abs(diffs) #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@jamieforth can you take a look? @behinger if you fix the style errors we'll see if the tests succeed (or if they need to be adapted). |
|
that was surprisingly easy to do |
|
I don't think I can push to this branch but there's updated tests here: behinger#1. All tests pass except for one: I still tend to think this is more of a hack for a broken LSL device than a bug in pyxdf, but The failing test is one example: it fails because the following timestamps are now segmented into three segments. The duration of the middle segment is -1, which leads to the incorrect calculation of effective sample rate. We could change the test if we deem this to be the correct behaviour? |
|
I agree with @jamieforth that this change should probably not replace the current behavior if the issue is the device. I didn't follow the entire discussion, but would it not be better to write a small tool to fix the broken timestamps in the first place? |
|
No, It's not the device. This error can happen everywhere in case jitter is larger than 1/fs I explained it here: #137 (comment) I think one misunderstanding is that this is depending on ANT, but I use timestamps from lsl/laptop not the device itself when sending the chunks. |
By device I mean hardware plus LSL wrapper software. The interaction between these two parts of the "LSL device" is where I think this problem arises.
This is how LSL is designed to work in the most straightforward case - synchronisation is only possible with time-stamps relative to the LSL clock (from your laptop).
I agree, but I'd also take jitter of that order as evidence of a problem at the hardware ↔ LSL wrapper level. I haven't seen jitter anywhere near 1/fs for (the albeit small number of) other devices I've used. Being pragmatic, It's also what xdf-matlab decided to do, so perhaps that's a good enough reason to adopt it too? If so, what should we do with the
|
|
I'm OK with doing what the MATLAB lib does. It still seems like it's probably an upstream issue, but let's just be consistent with MATLAB here. Regarding the test, I'll leave it up to you, though I'd slightly prefer option 2. But it's your call! |
|
I have seen jitter > 1/fs on other computers with pylsl - maybe a function of buffersize? But in any case, keeping same as matlab is good |
|
argh super sorry - I missed this somehow. Merged now! |
- test_jitter_removal_glitch still fails because segmenting with `abs(diffs)` removes the guarantee of non-negative segment durations
e5e50a2 to
0d19ba8
Compare
|
Thanks @behinger and @jamieforth! |
Fixes #137
I did not run tests locally because I dont have the tooling installed