nRF5340 Audio - 6 streams broadcasting

Dear Nordic team,

I'm evaluating nRF5340 Audio DK for the use-case of broadcasting multiple streams.
Until now I've succeeded in broadcasting 4 streams (LC4 bitrate set up to 48kbps) and I would like to to increase to 6. I've increased all the configuration parameters to support 6 streams, but I receive an error in initializing the broadcast source.
I'm attaching the whole debug log, but the main error is here:
GW [00:00:02.445,953] <wrn> bt_hci_core: opcode 0x2068 status 0x0d
GW [00:00:02.445,953] <dbg> bt_iso: bt_iso_big_create: Could not create BIG -5
 
Opcode 0x68 is BT_HCI_OP_LE_CREATE_BIG.
The status code 0x0D is BT_HCI_ERR_INSUFFICIENT_RESOURCES, and I've added warn log messages to all the C-code returning this value, but it's not printed. So I suspect this could be in the LE Audio controller from the Network Core (binary release). Most of the code is indeed in the BT Controller (C:\ncs\v2.2.0-rc1\zephyr\subsys\bluetooth\controller).
I'm attaching the prj.conf with the modified configuration values, of the nRF5340 Audio application.
I'm using the nRF Connect SDK v2.2.0-rc1.
I understand the LC3 encoding processing requirements are quite high, but as it takes 6 milisec for 4 streams (10milisec PCM slice, 32kbps), I suppose there is time for 6 streams @32kbps.
Please let me know if there's any more configuration values that needs to be tuned, in order for the 6 (or maybe 8) streams to be broadcasted, or maybe some timeouts increased.

Thank you!

6036.terminal_for_support.txt

Parents
  • Here is the prj.conf

    #
    # Copyright (c) 2022 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # nRF5340 Audio
    CONFIG_NRF5340_AUDIO=y
    
    # Custom config
    CONFIG_AUDIO_SOURCE_I2S=y
    CONFIG_TRANSPORT_BIS=y
    
    CONFIG_FIFO_FRAME_SPLIT_NUM=10
    CONFIG_FIFO_TX_FRAME_COUNT=6
    CONFIG_FIFO_RX_FRAME_COUNT=1
    
    # minimum bitrate
    CONFIG_LC3_BITRATE=32000
    CONFIG_BT_AUDIO_BROADCAST_16_2_1=y
    
    # configuration ok, for 4 streams
    #CONFIG_LC3_BITRATE=48000
    #CONFIG_BT_AUDIO_BROADCAST_24_2_1=y
    
    #doesn't work for 4 channels
    #CONFIG_LC3_BITRATE=96000
    
    CONFIG_AUDIO_SAMPLE_RATE_16000_HZ=y
    CONFIG_AUDIO_BIT_DEPTH_16=y
    
    CONFIG_BT_AUDIO_BROADCAST_SRC_STREAM_COUNT=6
    CONFIG_BT_AUDIO_BROADCAST_SNK_STREAM_COUNT=6
    
    CONFIG_BT_ISO_MAX_CHAN=6
    CONFIG_BT_ISO_TX_BUF_COUNT=6
    CONFIG_BT_ISO_TX_FRAG_COUNT=6
    
    CONFIG_BT_EXT_ADV_MAX_ADV_SET=6
    CONFIG_BT_ISO_TX_MTU=500
    CONFIG_BT_ISO_MAX_BIG=2
    
    # Bluetooth buffer configuration
    # default 27
    CONFIG_BT_BUF_ACL_TX_SIZE=83
    #default 3
    CONFIG_BT_BUF_ACL_TX_COUNT=6
    #default 68
    CONFIG_BT_BUF_EVT_RX_SIZE=255
    #default 58
    CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
    #default 3
    CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT=10
    #default 255
    CONFIG_BT_BUF_CMD_TX_SIZE=255
    #default 10
    CONFIG_BT_BUF_CMD_TX_COUNT=20
    
    CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=???
    
    #default n
    CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
    #default 1024
    CONFIG_BT_HCI_TX_STACK_SIZE=2048
    
    CONFIG_BT_AUDIO_BROADCAST_SRC_COUNT=2
    #CONFIG_BT_BUF_ACL_
    #CONFIG_BT_BUF_ACL_
    
    CONFIG_BT_LIM_ADV_TIMEOUT=120
    
    CONFIG_LC3_ENC_CHAN_MAX=6
    CONFIG_ENCODER_STACK_SIZE=16384
    CONFIG_AUDIO_DATAPATH_STACK_SIZE=16384
    
    CONFIG_MAIN_LOG_LEVEL_DBG=y
    CONFIG_AUDIO_SYSTEM_LOG_LEVEL_DBG=y
    CONFIG_SW_CODEC_SELECT_LOG_LEVEL_DBG=y
    CONFIG_BLE_LOG_LEVEL_DBG=y
    CONFIG_BT_LOG_LEVEL_DBG=y
    CONFIG_BT_AUDIO_DEBUG_STREAM=y
    CONFIG_BT_AUDIO_DEBUG_STREAM_DATA=y
    CONFIG_BT_AUDIO_DEBUG_BROADCAST_SOURCE=y
    
    CONFIG_STREAMCTRL_LOG_LEVEL_DBG=y
    CONFIG_BT_AUDIO_DEBUG_STREAM=y
    
    CONFIG_LOG_DEFAULT_LEVEL=4
    CONFIG_THREAD_ANALYZER=y
    
    # General
    CONFIG_DEBUG=y
    CONFIG_DEBUG_INFO=y
    CONFIG_ASSERT=y
    CONFIG_STACK_USAGE=y
    CONFIG_THREAD_RUNTIME_STATS=y
    CONFIG_STACK_SENTINEL=y
    CONFIG_INIT_STACKS=y
    
    # Uart driver
    CONFIG_SERIAL=y
    
    # Logging
    CONFIG_LOG=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_LOG_TAG_MAX_LEN=2
    CONFIG_LOG_TAG_DEFAULT="--"
    CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=500
    CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=8192
    CONFIG_LOG_BUFFER_SIZE=65536
    CONFIG_LOG_SPEED=y
    
    ## Avoid redundant warnings for endpoint setting in USB stack
    CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
    CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
    
    # Console related defines
    CONFIG_CONSOLE=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    # Shell related defines
    CONFIG_SHELL=y
    CONFIG_KERNEL_SHELL=y
    CONFIG_USE_SEGGER_RTT=y
    ## Disable logs on RTT
    CONFIG_SHELL_RTT_INIT_LOG_LEVEL_NONE=y
    CONFIG_SHELL_BACKEND_RTT=y
    CONFIG_SHELL_BACKEND_SERIAL=n
    CONFIG_SHELL_VT100_COLORS=y
    CONFIG_SHELL_STACK_SIZE=1024
    CONFIG_SHELL_CMD_BUFF_SIZE=128
    ## Reduce shell memory usage
    CONFIG_SHELL_WILDCARD=n
    CONFIG_SHELL_HELP_ON_WRONG_ARGUMENT_COUNT=n
    CONFIG_SHELL_STATS=n
    CONFIG_SHELL_CMDS=n
    CONFIG_SHELL_HISTORY=y
    
    # Turn off default shell commands
    CONFIG_I2C_SHELL=n
    CONFIG_HWINFO_SHELL=n
    CONFIG_CLOCK_CONTROL_NRF_SHELL=n
    CONFIG_FLASH_SHELL=n
    CONFIG_DEVICE_SHELL=n
    
    # Suppress err msg from sd_check_card_type. Because SPI_SDHC has no card presence method,
    # assume card is in slot. Thus error message is always shown if card is not inserted
    CONFIG_SD_LOG_LEVEL_OFF=y
    CONFIG_NVS_LOG_LEVEL_WRN=y
    
    CONFIG_CPU_LOAD=y
    CONFIG_CPU_LOAD_LOG_PERIODIC=y
    CONFIG_CPU_LOAD_LOG_INTERVAL=2000
    

  • Hi,

    There is a limitation on the controller side to maximum 4 BIS streams.

    Best regards,
    Dejan

  • Thanks,  

    Is there any chance that the max BIS to be increased to 6 or 8, and a new binary of the controller to be released?

  • Hi,

    We are investigating the effects of having more BIS'es. Could you please perform a CPU load check with your settings (see below some of them)? What are the results?

    CONFIG_LC3_BITRATE=32000 (and 48000)
    CONFIG_LC3_ENC_CHAN_MAX=4 (and 6)
    CONFIG_ENCODER_STACK_SIZE=16384

    Best regards,
    Dejan

  • Hi  

    The first observation is that for either bitrate 32 or 48 kbps there doesn't seem to be a meaningful difference in CPU load (just around 1%).
    Also for 32kbps CONFIG_BT_AUDIO_BROADCAST_16_2_1=y was used, while for 48kbps I've enabled CONFIG_BT_AUDIO_BROADCAST_24_2_1=y.

    I've always kept CONFIG_ENCODER_STACK_SIZE=16384.
    Also DEBUG and LOG was always active, with INFO level.

    1. CONFIG_LC3_ENC_CHAN_MAX=4 and streaming 4 channel (2 from I2S stereo and 2 sine-tones 1kHz generated): CPU load is 72%. Streaming is stable for hours.

    2. CONFIG_LC3_ENC_CHAN_MAX=6, forcing LC3 encoder to process 6 streams (random data for 2 extra streams), CPU load varies between 77% to 85%.
    Trying to compute the time required for a single 10milisec frame to be encoded, I obtain 8milisec (using k_uptime_get_32() before and after).

    I see spurious errors from I2S audio_datapath.c module:  
    GW [00:01:16.567,901] <wrn> audio_datapath: I2S RX overrun. Single msg
    GW [00:01:16.568,908] <wrn> audio_datapath: I2S RX continuing stream
    Of course, in the second scenario, on BLE only 4 streams are being broadcasted.

    I realize the 6 streams broadcasting is a stretched goal, but I'm willing to give it a try on my setup, if a new LE Controller with #6 BIS is released.

    Best regards,
    Catalin
Reply
  • Hi  

    The first observation is that for either bitrate 32 or 48 kbps there doesn't seem to be a meaningful difference in CPU load (just around 1%).
    Also for 32kbps CONFIG_BT_AUDIO_BROADCAST_16_2_1=y was used, while for 48kbps I've enabled CONFIG_BT_AUDIO_BROADCAST_24_2_1=y.

    I've always kept CONFIG_ENCODER_STACK_SIZE=16384.
    Also DEBUG and LOG was always active, with INFO level.

    1. CONFIG_LC3_ENC_CHAN_MAX=4 and streaming 4 channel (2 from I2S stereo and 2 sine-tones 1kHz generated): CPU load is 72%. Streaming is stable for hours.

    2. CONFIG_LC3_ENC_CHAN_MAX=6, forcing LC3 encoder to process 6 streams (random data for 2 extra streams), CPU load varies between 77% to 85%.
    Trying to compute the time required for a single 10milisec frame to be encoded, I obtain 8milisec (using k_uptime_get_32() before and after).

    I see spurious errors from I2S audio_datapath.c module:  
    GW [00:01:16.567,901] <wrn> audio_datapath: I2S RX overrun. Single msg
    GW [00:01:16.568,908] <wrn> audio_datapath: I2S RX continuing stream
    Of course, in the second scenario, on BLE only 4 streams are being broadcasted.

    I realize the 6 streams broadcasting is a stretched goal, but I'm willing to give it a try on my setup, if a new LE Controller with #6 BIS is released.

    Best regards,
    Catalin
Children
Related