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

  • I am also interested in a similar configuration, so i find it beneficial to write here. From this thread i see that 4 BIS streams is the max supported by the BLE audio controller.

    My question is: to enable the 4 BIS streams (in my use case audio quality is not important) you just use the aforementioned flags in prj.conf ? (CONFIG_BT_AUDIO_BROADCAST_24_2_1=y, CONFIG_ENCODER_STACK_SIZE=16384, CONFIG_LC3_ENC_CHAN_MAX=4)

    And if this was your only change to the default source code, how do you send the 4 streams to the board?

    Can i send 4 mono streams from USB or 2 mono streams through USB and 2 through LINE IN?

  • hi   ,
    I'm glad that more people are trying to stream multiple channels, so Nordic could hear us and release a 6-8 streams BLE controller.
    I have not input more than 2 audio channels in the Gateway. I've just generated the additional 2 channels (3rd and 4th), with sine-waves. Afik, I2S and USB are each limited to 2 channels, and using both would mean redesigning the application.
    Basically, my experiment was to test how many channels can be LC3 encoded and next broadcasted on BLE Audio. In my test, I see that 6 channels is a doable (85% CPU usage, 48kbps bitrate), while 8 streams is a strech-goal.
    My next plan is to input on UART/SPI already LC3 encoded audio streams on the Gateway, and next broadcast them, maybe trying the new multi-gateway feature (available in github, not released yet).

    As for code modifications, make sure in encoder_thread() there is enough space to handle tmp_pcm_raw_data.  
    Additionally, in the LC3 wrapper (file: sw_codec_selec.c), make sure LC3 is initialized with 4 channels and in the sw_codec_encode() you design a way to split/concatenate all the 4 channels.

    br, catalinio

  • Cool, Looking forward to your progress on lc3 encoed audio streams transferred by UART/SPI.

  • Hi  ,

    uzer123 said:

    My question is: to enable the 4 BIS streams (in my use case audio quality is not important) you just use the aforementioned flags in prj.conf ? (CONFIG_BT_AUDIO_BROADCAST_24_2_1=y, CONFIG_ENCODER_STACK_SIZE=16384, CONFIG_LC3_ENC_CHAN_MAX=4)

    And if this was your only change to the default source code, how do you send the 4 streams to the board?

    Can i send 4 mono streams from USB or 2 mono streams through USB and 2 through LINE IN?


    Please find below some suggestions from our developers.
    Encoding each stream takes around 30% of the CPU time. Therefore, there might not be enough CPU time to encode 4 streams.
    Current USB implementation only has 2 (stereo) endpoints. As USB endpoint is synchronous, it is controlled by PC clock. For avoiding the packet loss. synchronization of USB to I2S is required but you would be on your own in potentially achieving this.
    With regard to config options, you would need to set CONFIG_BT_CTLR_CONN_ISO_STREAMS=4 and CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=4 in the controller's prj.conf.
    In general, in trying to achieve 4 streams, issues might arise due to CPU, USB and clock sources. One could consider trying to find ways to transfer pre-encoded LC3 to the nrf5340 using for example SPI.

    Best regards,
    Dejan

  • Thank you for the detailed and clear answer

Related