Bluetooth: ISO: Speed up BT ISO data processing

For the native posix build the sleep calls used in tasks will stall
the zephyr instance which sets an upper limit on the data processing
interval to once every 20-30 millisecond.
This change reduces the duration of the sleep calls and increases the
TICKS_PER_SECOND to allow for shorter sleeps. This is needed to
support the data rates needed for LE Audio streaming. The rate is
tuned to support up to bidirectional 5ms ISO-intervals.
This change also increases the ISO buffer count from 1 to 5 to
allow for some buffering in the controller, which is needed for
gapless playback and/or use of burst number larger than 1.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
This commit is contained in:
Casper Bonde 2021-03-29 10:19:12 +02:00 committed by Carles Cufí
commit afe469eac7
3 changed files with 11 additions and 2 deletions

View file

@ -106,7 +106,7 @@ static void rx_thread(void *p1, void *p2, void *p3)
ssize_t len;
if (!uc_ready()) {
k_sleep(K_MSEC(20));
k_sleep(K_MSEC(1));
continue;
}

View file

@ -0,0 +1,9 @@
CONFIG_NO_OPTIMIZATIONS=y
# Allows for copying larger amount of data into the shell
CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=4096
# For native posix k_sleep is used in the data path as well as for shell input
# detection, hence data processing is at least two ticks per packet. To support
# 5ms ISO interval bidirectional data the system shall never stall for more
# than 1.5 ms in average.
CONFIG_SYS_CLOCK_TICKS_PER_SEC=500

View file

@ -50,7 +50,7 @@ CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_AUDIO=y
CONFIG_BT_AUDIO_UNICAST=y
CONFIG_BT_AUDIO_BROADCAST=y
CONFIG_BT_ISO_TX_BUF_COUNT=5
CONFIG_BT_VOCS_MAX_INSTANCE_COUNT=1
CONFIG_BT_VOCS_CLIENT_MAX_INSTANCE_COUNT=1