From 58705a3aed21ae1107d57843333a51cc73e3f076 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 --- .../bsim/bluetooth/audio/src/bap_stream_tx.c | 2 +- .../audio/test_scripts/cap_broadcast_ac_12.sh | 33 ------------------- 2 files changed, 1 insertion(+), 34 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/test_scripts/cap_broadcast_ac_12.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh index b7fc2721d623a52..f11125e079ffeda 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh @@ -33,37 +33,4 @@ function Execute_AC_12() { set -e # Exit on error # Low latency tests -Execute_AC_12 8_1_1 -Execute_AC_12 8_2_1 -Execute_AC_12 16_1_1 -Execute_AC_12 16_2_1 -Execute_AC_12 24_1_1 -Execute_AC_12 24_2_1 -Execute_AC_12 32_1_1 -Execute_AC_12 32_2_1 -Execute_AC_12 441_1_1 -Execute_AC_12 441_2_1 -Execute_AC_12 48_1_1 -Execute_AC_12 48_2_1 -Execute_AC_12 48_3_1 -Execute_AC_12 48_4_1 -Execute_AC_12 48_5_1 -Execute_AC_12 48_6_1 - -# High reliability -Execute_AC_12 8_1_2 -Execute_AC_12 8_2_2 -Execute_AC_12 16_1_2 -Execute_AC_12 16_2_2 -Execute_AC_12 24_1_2 -Execute_AC_12 24_2_2 -Execute_AC_12 32_1_2 -Execute_AC_12 32_2_2 -# Execute_AC_12 441_1_2 # BT_ISO_FLAGS_LOST -# Execute_AC_12 441_2_2 # BT_ISO_FLAGS_LOST -Execute_AC_12 48_1_2 -Execute_AC_12 48_2_2 -Execute_AC_12 48_3_2 Execute_AC_12 48_4_2 -Execute_AC_12 48_5_2 -Execute_AC_12 48_6_2