Skip to content

Commit

Permalink
fixup! tests: Bluetooth: Audio: Remove uses of K_FOREVER in syswg for TX
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
Thalley authored and cvinayak committed Nov 4, 2024
1 parent ab519ab commit 81c48ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/bsim/bluetooth/audio/src/bap_stream_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/bsim/bluetooth/audio/src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void backchannel_sync_wait_any(void)
}
}

k_sleep(K_MSEC(100));
k_sleep(K_MSEC(1));
}
}

Expand Down

0 comments on commit 81c48ba

Please sign in to comment.