From 81c48ba4ab535b345775cc272bcb5f8e08d6def7 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 31 Oct 2024 15:09:02 +0100 Subject: [PATCH] fixup! tests: Bluetooth: Audio: Remove uses of K_FOREVER in syswg for TX 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 Signed-off-by: Vinayak Kariappa Chettimada --- tests/bsim/bluetooth/audio/src/bap_stream_tx.c | 2 +- tests/bsim/bluetooth/audio/src/common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bsim/bluetooth/audio/src/bap_stream_tx.c b/tests/bsim/bluetooth/audio/src/bap_stream_tx.c index dcfe5b74b5f7590..b3809ef29625d8d 100644 --- a/tests/bsim/bluetooth/audio/src/bap_stream_tx.c +++ b/tests/bsim/bluetooth/audio/src/bap_stream_tx.c @@ -104,7 +104,7 @@ static void tx_thread_func(void *arg1, void *arg2, void *arg3) if (err != 0) { /* In case of any errors, retry with a delay */ - k_sleep(K_MSEC(10)); + k_sleep(K_MSEC(1)); } } } diff --git a/tests/bsim/bluetooth/audio/src/common.c b/tests/bsim/bluetooth/audio/src/common.c index ea4f781dda4a6d7..436705e44f2e3ce 100644 --- a/tests/bsim/bluetooth/audio/src/common.c +++ b/tests/bsim/bluetooth/audio/src/common.c @@ -351,7 +351,7 @@ void backchannel_sync_wait_any(void) } } - k_sleep(K_MSEC(100)); + k_sleep(K_MSEC(1)); } }