nrf5340 Audio - 4 streams broadcasting ncs v2.6.0

Dear Nordic team,

I'm evaluating nRF5340 Audio DK for the use-case of broadcasting multiple streams; NCS v2.6.0-rc1.

Until now I've succeeded broadcasted 4 streams (LC4 bitrate set up to 48kbps) in NCS v2.2.0, now I've migrated the nrf5340_audio application (to ncs 2.6.0-RC1) and I obtain the error:

GW [00:00:00.457,550] <inf> bt_mgmt_ctlr_cfg: Controller: SoftDevice: Version 5.4 (0x0d), Revision 8584
GW [00:00:00.457,763] <inf> bt_mgmt: Local identity addr: F9:1F:05:AB:3A:5C (random)
GW [00:00:00.458,038] <inf> broadcast_source: Enabling broadcast_source NRF5340_BROADCASTER
GW [00:00:00.461,853] <inf> bt_mgmt_adv: Local addr: 04:E2:D2:83:D1:D1 (random)
GW [00:00:00.463,958] <inf> main: Ext adv ready
GW [00:00:00.463,958] <inf> broadcast_source: Starting broadcast source
GW [00:00:00.464,385] <wrn> bt_hci_core: opcode 0x2068 status 0x0d
GW [00:00:00.464,416] <wrn> broadcast_source: Failed to start broadcast, ret: -12
GW [00:00:00.464,416] <err> main: Failed to start broadcaster: -12
GW [00:00:00.464,416] <inf> bt_mgmt_adv: Advertising successfully started

As far as I understand, this is produced by the binary from the network core (flashed from the corresponding path: C:\ncs\v2.6.0-rc1\nrf\lib\bin\bt_ll_acs_nrf53\bin\).

So, is my assumption right? Were the 2 broadcasted streams limited somewhere between ncs v2.2 and v2.6? Am I missing some configuration or code change?

I'm attaching the prj.conf (modified)

# nRF5340 Audio
CONFIG_NRF5340_AUDIO=y

CONFIG_SAMPLE_RATE_CONVERTER=y
CONFIG_SAMPLE_RATE_CONVERTER_FILTER_SIMPLE=y

# Custom config
CONFIG_AUDIO_SOURCE_I2S=y
CONFIG_TRANSPORT_BIS=y

CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=4
CONFIG_BT_AUDIO_RETRANSMITS=1

CONFIG_BT_AUDIO_BROADCAST_CONFIGURABLE=y
CONFIG_BT_BAP_BROADCAST_16_2_1=y

CONFIG_BT_AUDIO_PREF_SAMPLE_RATE_16KHZ=y

CONFIG_AUDIO_SAMPLE_RATE_16000_HZ=y
CONFIG_AUDIO_BIT_DEPTH_16=y

CONFIG_LC3_ENC_CHAN_MAX=4

Thank you?

  • Hello,

    GW [00:00:00.464,416] <wrn> broadcast_source: Failed to start broadcast, ret: -12
    GW [00:00:00.464,416] <err> main: Failed to start broadcaster: -12

    The return code 12 means ENOMEM, and so it seems that it is not configured enough memory to accommodate all the streams.

    Could you share your .conf file, which is located in the build/zephyr/ directory for this build?

    Do I understand it correctly that this is the same application you had working with v2.2, which you now have upgraded? Or have you made a new one based on v2.6, and followed the same approach as previous?

    this is produced by the binary from the network core (flashed from the corresponding path: C:\ncs\v2.6.0-rc1\nrf\lib\bin\bt_ll_acs_nrf53\bin\).

    Not quite - the binary in this location is the older LE Audio Controller which was deprecated upon the nRF Connect SDK v2.6 release - now the default and recommended controller for LE Audio Development is the SoftDevice Controller, which the application will use by default.
    It seems from your logs that you are already using the SoftDevice Controller, so no worries there.

    By the way, how are you programming your application?

    So, is my assumption right? Were the 2 broadcasted streams limited somewhere between ncs v2.2 and v2.6? Am I missing some configuration or code change?

    No, there is no such hard limitation when working with the SoftDevice Controller.

    Best regards,
    Karl

  • Attached it's the build/zephyr/.config file.

    The return code 12 means ENOMEM, and so it seems that it is not configured enough memory to accommodate all the streams.

    I'll recheck the streams structures to see if memory is allocated for 4 streams (though in broadcast_source.c the structures are based on the size of CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT, which is 4).

    Do I understand it correctly that this is the same application you had working with v2.2, which you now have upgraded? Or have you made a new one based on v2.6, and followed the same approach as previous?

    I have duplicated the application from ncs v2.6 (verified it and it works fine on my boards, 2 gateway scenario also fine) and added manually my code modifications from the old project based on v2.2

    By the way, how are you programming your application?

    The application is programmed using the buildprog.py script; eg: python buildprog.py -c both -b debug -d gateway -p

    zephyr_config.txt

  • Hi Karl,

    Now, I've just modified the .\child_image\hci_ipc.conf; I've attached the modified content, but the ENOMEM error is still there.

    I've increased the CONFIG_BT_CTLR_CONN_ISO_STREAMS to 4, and the CONFIG_BT_MAX_CONN to 5.

    hci_ipc.conf

    Thanks,

    Catalin

  • Hello Catalin,

    catalinio said:
    I have duplicated the application from ncs v2.6 (verified it and it works fine on my boards, 2 gateway scenario also fine) and added manually my code modifications from the old project based on v2.2

    Are you certain that you are using the same iso channel and audio quality configuration now as previously? The rule of thumb for encoding of a 96 kbps audio stream is that it will take roughly ~31% CPU to encode, and ~15% CPU to decode, so you will be nearing that if you intend to encode 4 channels concurrently.

    catalinio said:

    Now, I've just modified the .\child_image\hci_ipc.conf; I've attached the modified content, but the ENOMEM error is still there.

    I've increased the CONFIG_BT_CTLR_CONN_ISO_STREAMS to 4, and the CONFIG_BT_MAX_CONN to 5.

    In your hci_ipc.conf you are also enabling 

    CONFIG_BT_CTLR_CONN_ISO_GROUPS
    and
    CONFIG_BT_CTLR_CONN_ISO_STREAMS

    Which will both are for CIS's, but in your description you explicitly mentions broadcasting 4 streams (BIS).
    Is your intentions to have concurrent BIS and CISs, and if so, how many of each?
    Please keep in mind that each CIS will require 1 ISO channel and 1 ACL channel.

    Best regards,
    Karl

  • Hi Karl,

    Are you certain that you are using the same iso channel and audio quality configuration now as previously? The rule of thumb for encoding of a 96 kbps audio stream is that it will take roughly ~31% CPU to encode, and ~15% CPU to decode, so you will be nearing that if you intend to encode 4 channels concurrently.

    I'm encoding 32kbps streams, in ncs 2.2, the CPU was used ~85% for encoding 6 streams; I think for 4 low bitrate streams the CPU should be fine.

    Is your intentions to have concurrent BIS and CISs, and if so, how many of each?

    I'm just using the default hci_ipc.conf from here.I want to stream just 4 broadcast streams, no CIS. Which CONF_BT_CTLR_xxx should be set for BIS?

    thanks,

    catalin

Related