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: bsim: Bluetooth: Enable some high reliability CAP tests #80788

Merged

Conversation

cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Nov 3, 2024

Enable some high reliability CAP tests by increasing ISO Tx buffer counts in the Controller to sufficiently generate number of complete when multiple SDUs are transmitted in single ISO interval with use of pre-transmissions.

@cvinayak
Copy link
Contributor Author

cvinayak commented Nov 4, 2024

Failure log snippet in CI run that is different from local run:

d_01: @00:00:00.382414  Found broadcaster with ID 0x46653D and addr 19:CA:18:BB:FD:6D (random) and sid 0x00
d_01: @00:00:00.383271  Broadcast source found, stopping scan
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  Scan stopped, attempting to PA sync to the broadcaster with id 0x46653D
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  Broadcast source found, waiting for PA sync
d_00: @00:00:00.931075  Stream 0x84aa9a0 sent 100 SDUs
d_01: @00:00:01.584294  [00:00:01.584,289] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:01.584294  [00:00:01.584,289] <dbg> bt_bap_scan_delegator: pa_synced: Synced
d_01: @00:00:01.584294  [00:00:01.584,289] <dbg> bt_bap_scan_delegator: pa_synced: BASS receive state not found
d_01: @00:00:01.584294  PA sync 0x84dbfa0 synced for broadcast sink with broadcast ID 0x46653D

Local run PA Sync quicker:

d_01: @00:00:00.382414  Found broadcaster with ID 0x46653D and addr 19:CA:18:BB:FD:6D (random) and sid 0x00
d_01: @00:00:00.383271  Broadcast source found, stopping scan
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  Scan stopped, attempting to PA sync to the broadcaster with id 0x46653D
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  [00:00:00.383,270] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:00.383271  Broadcast source found, waiting for PA sync
d_00: @00:00:00.931075  Stream 0x84dd760 sent 100 SDUs
d_01: @00:00:01.434263  [00:00:01.434,234] <wrn> net_buf: net_buf_alloc_len: Timeout discarded. No blocking in syswq
d_01: @00:00:01.434263  [00:00:01.434,234] <dbg> bt_bap_scan_delegator: pa_synced: Synced
d_01: @00:00:01.434263  [00:00:01.434,234] <dbg> bt_bap_scan_delegator: pa_synced: BASS receive state not found
d_01: @00:00:01.434263  PA sync 0x850ed40 synced for broadcast sink with broadcast ID 0x46653D

@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch 2 times, most recently from 81c48ba to a706cf5 Compare November 4, 2024 11:04
@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch from c133cd2 to 4950663 Compare November 5, 2024 14:19
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since these test scripts are already taking a long time to finish given the many test cases in each of them, we should consider either running them in parallel in this script somehow, or split the files.

We could either split them like
AC_14_8 -> Run all 8_x_x tests
AC_14_16 -> Run all 16_x_x tests
AC_14_24 -> Run all 24_x_x tests
etc.

or split them by high and light reliability.

@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch from 4950663 to 211084d Compare November 11, 2024 09:25
@zephyrbot zephyrbot added area: Samples Samples area: Bluetooth HCI Bluetooth HCI Driver labels Nov 11, 2024
@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch from 211084d to 5522ef0 Compare November 14, 2024 07:26
@cvinayak cvinayak marked this pull request as draft November 14, 2024 15:06
@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch from 5522ef0 to 58ddb33 Compare November 15, 2024 12:48
@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch 3 times, most recently from 2f1a9f0 to 8498046 Compare November 23, 2024 05:12
@cvinayak cvinayak marked this pull request as ready for review November 23, 2024 05:13
@cvinayak cvinayak force-pushed the github_tests_bsim_audio_ctlr_conf_2 branch from 8498046 to 51b5ac5 Compare November 23, 2024 06:13
subsys/bluetooth/controller/ll_sw/ull_sync_iso.c Outdated Show resolved Hide resolved
Comment on lines +1 to +4
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest to create the GH issue and reference it here rather than having this comment all the places :) Then it's easier to find and cleanup later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still on my todo list to create a IPC test!...

Just not to loose track created this: #81866


#define BROADCAST_STREMT_CNT CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT
#define BROADCAST_ENQUEUE_COUNT 2U
#define BROADCAST_ENQUEUE_COUNT 18U
Copy link
Collaborator

Choose a reason for hiding this comment

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

This refers to the number of SDUs to enqueue - 18 seems excessive (180ms of audio data). Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

50 ms ISO interval with PTO=1 (BN=5 + 1) needs to have 12 SDUs buffered at an ISO interval and additional 6 SDUs to ensure subsequent ISO intervals have SDUs ready in the Controller. This is equivalent to how 3 Tx ACL buffers are required to ensure a peripheral ACL sends data every connection interval.

@@ -51,7 +51,7 @@ CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT=2
CONFIG_BT_ISO_PERIPHERAL=y
CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_MTU=310
CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_ISO_TX_BUF_COUNT=36
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yikes :D I assume this is 2 x BROADCAST_ENQUEUE_COUNT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, 2x due to 2 BISes support (though test only uses 1 BIS) and the build error check in the test needs this 2x.

Fix ISO Sync Receiver implementation to correctly reflect
the payload number and timestamp for the skipped SDU.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix ISO Sync Receiver time reservation calculation to use
peer broadcasted bis_spacing and sub_interval, instead of
incorrectly calculating using local implementation used
tMSS value.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix ISO Sync Receiver implementation to correctly prevent
subevent from pre-empted in the unreserve time space.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Align audio test Controller Kconfig value same as used with
nRF53bsim.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Enable some high reliability CAP tests by increasing ISO Tx
buffer counts in the Controller to sufficiently generate
number of complete when multiple SDUs are transmitted in
single ISO interval with use of pre-transmissions.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@kruithofa kruithofa removed their request for review November 27, 2024 07:01
@kartben kartben merged commit 31f37a5 into zephyrproject-rtos:main Nov 27, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Audio area: Bluetooth Controller area: Bluetooth HCI Bluetooth HCI Driver area: Bluetooth area: Samples Samples area: Tests Issues related to a particular existing or missing test platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants