Configuring the nRF5340 Audio applications

See Configuring and building for information about how to permanently or temporarily change the configuration.

By default, if you have not made any changes to .conf files at applications/nrf5340_audio/, the nRF5340 build script builds the unicast server (CIS) application in the CIS unidirectional mode as a headset (with CONFIG_TRANSPORT_CIS set to y and CONFIG_AUDIO_DEV set to 1).

Selecting gateway or headset build

Given the nRF5340 Audio application architecture, the nRF5340 Audio applications can be built for either the gateway or the headset role:

  • The headset build is identified with CONFIG_AUDIO_DEV Kconfig option set to 1. This is the default configuration.

  • The gateway build can be selected by adding CONFIG_AUDIO_DEV Kconfig option set to 2 to the prj.conf file.

Selecting the CIS bidirectional communication

To switch to the bidirectional mode, set the CONFIG_STREAM_BIDIRECTIONAL Kconfig option to y in the applications/nrf5340_audio/prj.conf file (for the debug version) or in the applications/nrf5340_audio/prj_release.conf file (for the release version).

Enabling the walkie-talkie demo

The walkie-talkie demo uses one or two bidirectional streams from the gateway to one or two headsets. The PDM microphone is used as input on both the gateway and headset device. To switch to using the walkie-talkie, set the CONFIG_WALKIE_TALKIE_DEMO Kconfig option to y in the applications/nrf5340_audio/prj.conf file (for the debug version) or in the applications/nrf5340_audio/prj_release.conf file (for the release version).

Enabling the Auracast/Broadcast mode

If you want to work with Auracast/broadcast sources and sinks, set the CONFIG_TRANSPORT_BIS Kconfig option to y in the applications/nrf5340_audio/prj.conf file.

Enabling the BIS mode with two gateways

In addition to the standard BIS mode with one gateway, you can also add a second gateway device. The BIS headsets can then switch between the two gateways and receive audio stream from one of the two gateways.

To configure the second gateway, add both the CONFIG_TRANSPORT_BIS and the CONFIG_BT_AUDIO_USE_BROADCAST_NAME_ALT Kconfig options set to y to the applications/nrf5340_audio/prj.conf file for the debug version and to the applications/nrf5340_audio/prj_release.conf file for the release version. You can provide an alternative name to the second gateway using the CONFIG_BT_AUDIO_BROADCAST_NAME_ALT or use the default alternative name.

You build each BIS gateway separately using the normal procedures from Building and running nRF5340 Audio applications. After building the first gateway, configure the required Kconfig options for the second gateway and build the second gateway firmware. Remember to program the two firmware versions to two separate gateway devices.

Selecting the analog jack input using I2S

In the default configuration, the gateway application uses USB as the audio source. The Building and running nRF5340 Audio applications and the testing steps also refer to using the USB serial connection.

To switch to using the 3.5 mm jack analog input, set the CONFIG_AUDIO_SOURCE_I2S Kconfig option to y in the applications/nrf5340_audio/prj.conf file for the debug version and in the applications/nrf5340_audio/prj_release.conf file for the release version.

When testing the application, an additional audio jack cable is required to use I2S. Use this cable to connect the audio source (PC) to the analog LINE IN on the development kit.

Adding FEM support

You can add support for the nRF21540 front-end module (FEM) to the following nRF5340 Audio applications:

The broadcast sink application does not need FEM support as it only receives data.

Adding FEM support happens when Building and running nRF5340 Audio applications. You can use one of the following options, depending on how you decide to build the application:

  • If you opt for Building and programming using script, add the --nrf21540 to the script’s building command.

  • If you opt for Building and programming using command line, add the -Dnrf5340_audio_SHIELD=nrf21540ek_fwd -Dipc_radio_SHIELD=nrf21540ek to the west build command. For example:

    west build -b nrf5340_audio_dk/nrf5340/cpuapp --pristine -- -DCONFIG_AUDIO_DEV=1 -Dnrf5340_audio_SHIELD=nrf21540ek_fwd -Dipc_radio_SHIELD=nrf21540ek
    

To set the TX power output, use the CONFIG_BT_CTLR_TX_PWR_ANTENNA and CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB Kconfig options in applications/nrf5340_audio/sysbuild/ipc_radio/prj.conf.

See Developing with Front-End Modules for more information about FEM in the nRF Connect SDK.