-
Notifications
You must be signed in to change notification settings - Fork 59
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
Ping-pong first read sample is always empty #85
Comments
See what happens when you get rid of you 5 second delay after the first push out of ping. I think what is happening is that during the sleep ping misses the marker sent back from pong and this is what causes the [] as the first sample after the wait. If you drop the wait you will still get a [] as the first sample in ping (it pulls before ping receives and pushes back), but then you will get a [[1],[2]] the next time around in pong (and ping) before it then settles into the expected regime. I am not sure how long the lifespan of a marker on the network is, but it looks like less than 5 seconds. Here is my output of ping.py (5 second sleep removed):
And pong (unchanged):
|
Thank you very much @dmedine. This, combined with your other advice on adding a length check resolved the issue. We are now getting the expected result. I'm closing the Issue, but for completeness would like to know what the actual lifespan of a marker is. Our expectation was that it remains buffered indefinitely, until read. Should anyone know, please comment, since it is not clear from the docs. |
Now that I have some more time to think about it, it doesn't make sense to me that a marker can disappear. It should be just like any other sample. The sample rate is only used for meta data and shouldn't affect behavior otherwise. That means that an inlet with a sampling rate of 0 should also buffer until a call to pull grabs it. The marker will be quite delayed, but its timestamp should reflect when it was originally sent (on the outlet host). I honestly don't know why this is happening. |
Please see the minimal reproducible example here
https://github.com/aleksandrskoselevs/pylsl_ping_pong
I have 2 small scripts,
ping.py
andpong.py
This is managed through 2 streams.
Expected output
ping.py
pong.py
Actual output
ping.py
pong.py
As you can see, the first sample read by Ping, after being returned by Pong, is always empty. This is not as expected. Why is that?
Any insight is greatly appreciated. Thank you.
The text was updated successfully, but these errors were encountered: