Skip to content
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

Fix cyclic mode to IIOD v0.x #1099

Merged
merged 4 commits into from
Dec 15, 2023
Merged

Fix cyclic mode to IIOD v0.x #1099

merged 4 commits into from
Dec 15, 2023

Conversation

pcercuei
Copy link
Contributor

Some misc. fixes, alongside a rework of the interface to v0.x IIOD, which did not support cyclic buffers properly.

Fixes #1097.

The CLOCK_REALTIME clock may jump in time, which can be a huge problem
when computing timeouts. Use the CLOCK_MONOTONIC one instead, which does
not have this problem.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
When the buffer creation failed, entry->buf was left to whatever error
pointer it had previously, instead of being reset to NULL; cleanup code
would subsequently try to destroy the buffer once again with an invalid
pointer.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
IIOD v0.x supports enqueueing cyclic blocks, but it needs to know about
it when the iio_buffer is opened through the "OPEN" command. As
iiod-client calls this command when the buffer is to be enabled, pass an
extra "cyclic" parameter to .buffer_enable(), always set to "false" for
now.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Instead of continuously sending the same block again and again, set the
"cyclic" parameter of the .enable_buffer() backend callback to the value
of the "cyclic" parameter of the last call to iio_buffer_enqueue().

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Copy link
Contributor

@tfcollins tfcollins left a comment

Choose a reason for hiding this comment

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

Yes this fixes the TX side

@pcercuei pcercuei merged commit de9fd5e into main Dec 15, 2023
22 of 24 checks passed
@pcercuei pcercuei deleted the pcercuei/fix-cyclic branch December 15, 2023 11:13
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.

TX data generation on V1 invalid
3 participants