nRF5340 Audio: Unicast client
The nRF5340 Audio unicast client application implements the CIS gateway mode.
In this mode, one Connected Isochronous Group (CIG) can be used with two Connected Isochronous Streams (CIS). Transmitting unidirectional or transceiving bidirectional audio happens using CIG and CIS.
The following limitations apply to this application:
One CIG with two CIS.
Audio input: USB or I2S (Line in or using Pulse Density Modulation).
Audio output: USB or I2S/Analog headset output.
Configuration: 16 bit, several bit rates ranging from 32 kbps to 124 kbps.
Requirements
The application shares the requirements common to all nRF5340 Audio application.
User interface
Most of the user interface mappings are common across all nRF5340 Audio applications. See the User interface page for detailed overview.
This application uses specific mapping for the following user interface elements:
Long-pressed on the unicast client device during startup:
BTN5 - Clears the previously stored bonding information.
Pressed on the unicast client device during playback:
PLAY/PAUSE - Starts or pauses the playback of the stream.
VOL- - Turns the playback volume down (and unmutes).
VOL+ - Turns the playback volume up (and unmutes).
BTN 4 - Sends a test tone generated on the device. Use this tone to check the synchronization of headsets.
BTN5 - Mutes the playback volume (and unmutes).
LED1 - Blinking blue - Kit is streaming audio to a headset.
RGB - Solid green - The device is programmed as the gateway.
Configuration
By default, if you have not made any changes to .conf
files at applications/nrf5340_audio/
, the nRF5340 build script tries to build the CIS applications in the CIS unidirectional mode.
To switch to the bidirectional mode, see Selecting the CIS bidirectional communication.
For other configuration options, see Configuring the nRF5340 Audio applications and Configuring and testing FOTA upgrades for nRF5340 Audio applications.
For information about how to configure applications in the nRF Connect SDK, see Configuring and building an application.
Building and running
This application can be found under applications/nrf5340_audio/unicast_client
in the nRF Connect SDK folder structure, but it uses .conf
files at applications/nrf5340_audio/
.
The nRF5340 Audio DK comes preprogrammed with basic firmware that indicates if the kit is functional. See Testing out of the box for more information.
To build the application, see Building and running nRF5340 Audio applications.
Testing
After building and programming the application, you can test the default CIS gateway mode using one unicast client device and at least one CIS headset device. The recommended approach is to use another nRF5340 Audio DK programmed with the unicast server application, but you can also use an external CIS headset device.
Note
Nordic Semiconductor seeks to provide seamless interoperability with as many LE Audio devices as possible. However, vendors have reached different levels of maturity in their implementation. Also, different platforms have different methods of connecting, pairing, and streaming. For these reasons, providing a general guide on how to test with external devices is challenging. The suggested approach is to test with Nordic Semiconductor devices on both sides first to verify basic functionalities and get familiar with the solution before using custom devices. Contact Technical Support team if you need assistance.
The following testing scenario assumes you are using USB as the audio source on the gateway. This is the default setting.
Complete the following steps to test the unidirectional CIS mode for one gateway and at least one headset device:
Make sure that the development kits are still plugged into the USB ports and are turned on.
Note
Make sure to check the nRF5340 Audio application known issues related to serial connection with the USB.
LED3 starts blinking green on every device to indicate the ongoing CPU activity on the application core.
Wait for the LED1 on the gateway to start blinking blue. This happens shortly after programming the development kit and indicates that the gateway device is connected to at least one headset and ready to send data.
Search the list of audio devices listed in the sound settings of your operating system for nRF5340 USB Audio (gateway) and select it as the output device.
Connect headphones to the HEADPHONE audio jack on the headset device.
Start audio playback on your PC from any source.
Wait for LED1 to blink blue on the headset. When they do, the audio stream has started on the headset.
Note
The audio outputs only to the left channel of the audio jack, even if the given headset is configured as the right headset. This is because of the mono hardware codec chip used on the development kits. If you want to play stereo sound using one development kit, you must connect an external hardware codec chip that supports stereo.
Wait for LED2 to light up solid green on the headsets to indicate that the audio synchronization is achieved.
Press the VOL- button on the gateway. The playback volume decreases for the headset.
Press the PLAY/PAUSE button on any one of the devices. The playback stops for the headset and the streaming state for all devices is set to paused.
Press the BTN 4 button on the gateway multiple times. For each button press, the audio stream playback is stopped and the gateway sends a test tone to the headset. These tones can be used as audio cues to check the synchronization between two headsets.
For other testing options, refer to User interface.
After the kits have paired for the first time, they are now bonded. This means the Long-Term Key (LTK) is stored on each side, and that the kits will only connect to each other unless the bonding information is cleared. To clear the bonding information, press and hold BTN 5 during boot or reprogram all the development kits.
When you finish testing, power off the nRF5340 Audio development kits by switching the power switch from On to Off.
Testing the walkie-talkie demo
Testing the walkie-talkie demo is identical to the default testing procedure, except for the following differences:
You must enable the Kconfig option mentioned in Enabling the walkie-talkie demo before building the application.
Instead of controlling the playback, you can speak through the PDM microphones. The line is open all the time, no need to press any buttons to talk, but the volume control works as in the default testing procedure.
Dependencies
For the list of dependencies, check the application’s source files.