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

tests: Bluetooth: Audio: Remove uses of K_FOREVER in syswg for TX #80691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thalley
Copy link
Collaborator

@Thalley Thalley commented Oct 31, 2024

Several tests were using K_FOREVER when allocating the buffer for TX in the system workqueue, which is illegal behavior.

The solution chosen was to create a TX thread to handle TX, similar to the solution used in the audio shell and some sample applications.

This way we can continue to use K_FOREVER when allocting buffers and it will always be done in a round-robin fashion while TXing as much as possible, by always enqueuing all the buffers with mock data.

Since this works for all streams (both broadcast and unicast), it was obvious to use the same implementation for all tests, and thus cleaning up the tests a bit and more them more similar.

fixes #80682

*
* @retval true if it has been configured for TX, and false if not
*/
bool stream_tx_can_send(const struct bt_bap_stream *stream);
Copy link
Collaborator

@rruuaanng rruuaanng Nov 20, 2024

Choose a reason for hiding this comment

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

Why is it can_send, not is_send or is_conf_send.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To follow the stream_tx prefit it sounds weird to have stream_tx_is_send or stream_tx_is_conf_send as stream_tx refers to the module, and not the stream

Several tests were using K_FOREVER when allocating the
buffer for TX in the system workqueue, which is illegal behavior.

The solution chosen was to create a TX thread to handle TX,
similar to the solution used in the audio shell and some
sample applications.

This way we can continue to use K_FOREVER when allocting buffers
and it will always be done in a round-robin fashion while
TXing as much as possible, by always enqueuing all the buffers
with mock data.

Since this works for all streams (both broadcast and unicast),
it was obvious to use the same implementation for all tests,
and thus cleaning up the tests a bit and more them more similar.

Signed-off-by: Emil Gydesen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Bluetooth: Audio: BSIM tests use K_FOREVER when allocating TX buffers in system workqueue
3 participants