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

libiio 1.0: cannot create new buffer after cancel operation #985

Closed
catkira opened this issue Jun 14, 2023 · 7 comments
Closed

libiio 1.0: cannot create new buffer after cancel operation #985

catkira opened this issue Jun 14, 2023 · 7 comments

Comments

@catkira
Copy link
Contributor

catkira commented Jun 14, 2023

When I abort a dequeue operation with iio_buffer_cancel and then try to create a new buffer with iio_device_create_buffer I get

ERROR: Unable to create buffer: Device or resource busy (16)

for about 3 seconds. After that iio_device_create_buffer works again without doing anything else. Is this a bug? It would be nice if I could create a new buffer immediately after cancel for my application.
I am using a network context. Latest libiio dev branch is running on host and device.

@catkira
Copy link
Contributor Author

catkira commented Jun 14, 2023

This is the output of iiod when I run it on the device in a terminal

New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
New client connected from 192.168.137.1
Client exited
Client exited
Client exited
Client exited
Client exited
Client exited
Client exited
Client exited
Client exited
Client exited
New client connected from 192.168.137.1
Client exited
Client exited

for every unsuccessful iio_device_create_buffer I get a New client connected from 192.168.137.1 on the terminal. Then suddenly I get a lot of Client exited all at once.

@catkira
Copy link
Contributor Author

catkira commented Jun 14, 2023

Ah I figured out that the Device or resource busy (16) errors comes after a cancel operation for the duration of the timeout I set with iio_context_set_timeout. So I guess that there is probably an active timeout timer running that is not properly reset when iio_buffer_cancel happens.

@catkira
Copy link
Contributor Author

catkira commented Jun 14, 2023

Even if I don't do iio_buffer_cancel and just let the iio_block_dequeue timeout, I have to wait another timeout duration before I can create a new buffer.

@catkira
Copy link
Contributor Author

catkira commented Jun 15, 2023

The problem seems to appear only when I run libiio 1.0 on the network client side. local libiio 1.0 and client libiio 0.24 does not show this problem.

@pcercuei
Copy link
Contributor

Noted, thanks for testing Libiio v1.0 btw.

@pcercuei
Copy link
Contributor

@catkira It should be fixed in the PR #1000

@pcercuei
Copy link
Contributor

Closing as this issue was fixed.

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

No branches or pull requests

2 participants