Skip to content

135 playback lsl - Fix for errors when not looping or when sleep time is shorter than sample interval #136

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

Merged
merged 11 commits into from
May 27, 2025

Conversation

cboulay
Copy link
Contributor

@cboulay cboulay commented May 8, 2025

This PR fixes the issues described in #135

@cboulay cboulay linked an issue May 8, 2025 that may be closed by this pull request
@cbrnr
Copy link
Contributor

cbrnr commented May 9, 2025

LGTM! I assume you have tested this and the changes fix the issues. Would it be possible to add test cases which fail on main but pass here?

@cboulay
Copy link
Contributor Author

cboulay commented May 9, 2025

Do we want to add pylsl as a test dev dependency?

@cbrnr
Copy link
Contributor

cbrnr commented May 9, 2025

I would prefer to add it as an extra, because users would also need pylsl in order to use the playback CLI.

@cboulay cboulay force-pushed the 135-playback_lsl-errors branch from 373c01b to beab455 Compare May 10, 2025 16:38
@cboulay cboulay force-pushed the 135-playback_lsl-errors branch from beab455 to a9dec9e Compare May 10, 2025 16:43
@cbrnr
Copy link
Contributor

cbrnr commented May 10, 2025

Why can you not just use pylsl?

@cboulay
Copy link
Contributor Author

cboulay commented May 10, 2025

I added a test that simply attempts to playback one of the files already in the example-files folder. This test fails without the change to the loop argument in this PR.

(FYI: Adding this test also prompted me to add a noble release to liblsl -- glad to have that done.)

However, I do not wish to test the other problem this PR fixes which was the early termination when the time between samples was larger than the sleep time. This is rather difficult to test because it requires a new contrived test xdf file with long time intervals and a separate thread to read the stream and verify the entire contents were passed through.

@cboulay
Copy link
Contributor Author

cboulay commented May 10, 2025

Why can you not just use pylsl?

pylsl does not come with the liblsl binaries on Linux and Mac because it assumes you'll have liblsl installed at the system level.

@cbrnr
Copy link
Contributor

cbrnr commented May 12, 2025

Is there a reason why these packages do not bundle the binary libs?

@cboulay
Copy link
Contributor Author

cboulay commented May 13, 2025

Yes.
Previously we were shipping binaries inside the wheels for all platforms. However, the MacOS binaries were annoying to maintain because of security issues. The linux binaries were causing more problems than they were worth because the docker containers that were available to produce manylinux binaries were not producing binaries that were meeting the needs of all users and it was actually worse to provide non-working binaries than it was to provide no binaries with a helpful error message. Packaging tools were not able to produce bespoke limited-scope wheels that pypi would accept and would only be provided to platforms on which they worked without also feeding them to platforms on which they didn't work.

Is this going to be a problem for this PR?

@cbrnr
Copy link
Contributor

cbrnr commented May 13, 2025

Thanks for clarifying. I think this is problematic, because I am hesitant to add a dependency (even if optional) which requires manual tinkering. Therefore, I'd rather not include the test and the pylsl dependency (and return to the status quo).

I'm happy to discuss pylsl packaging in a separate issue. I do have some limited experience with cibuildwheel, which I use to create binary wheels for SleepECG (which contains a C extension). Ideally, pylsl should provide self-contained binary wheels for all three platforms, since this has been the standard way to ship such things for quite some time (and this is also what users will expect). Maybe this is worth another look (tools might have matured since you last tried)?

@cboulay
Copy link
Contributor Author

cboulay commented May 13, 2025

There’s non-Debian, arch Linux, Android, all the different flavours of arm (pi), etc. These are all platforms where users complained that pylsl wasn’t working for them.
The thing about these users is they are typically able to follow the instructions in an error message to install missing liblsl, but they get stuck when they have an incompatible liblsl.so.

Anyway, I’ll edit the PR to remove the tests when I have a moment.

@cbrnr
Copy link
Contributor

cbrnr commented May 13, 2025

There’s non-Debian, arch Linux, Android, all the different flavours of arm (pi), etc. These are all platforms where users complained that pylsl wasn’t working for them.
The thing about these users is they are typically able to follow the instructions in an error message to install missing liblsl, but they get stuck when they have an incompatible liblsl.so.

Yeah, but this should not be a problem nowadays. Even ARM64 builds work out of the box for me.

Copy link
Contributor

@cbrnr cbrnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to remove these two things, otherwise LGTM!

@cboulay cboulay force-pushed the 135-playback_lsl-errors branch from 090d867 to a8c58f1 Compare May 21, 2025 15:13
@cbrnr cbrnr merged commit fc32bc2 into main May 27, 2025
5 checks passed
@cbrnr cbrnr deleted the 135-playback_lsl-errors branch May 27, 2025 05:04
@cbrnr
Copy link
Contributor

cbrnr commented May 27, 2025

Thanks @cboulay!

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.

playback_lsl errors
2 participants