nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches

◆ bt_le_audio_tx_send()

int bt_le_audio_tx_send ( struct bt_le_audio_tx_ctx * ctx,
struct net_buf const *const audio_frame,
struct le_audio_tx_info * tx,
uint8_t num_tx )

#include <applications/nrf_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.h>

Sends N channels of synchronized audio data to the controller.

This function is the main LE Audio TX scheduling point. One call corresponds to one frame interval for the configured streams. All streams which shall be sent together (synchronized) are sent at the same time. This implies calling once for every subgroup when doing broadcast and once for each CIG in unicast. If 0 is returned, it publishes a reference message on sdu_ref_chan. This ZBUS message contains the current time, and when the SDU(s) are expected on air. Calling too late/slow will cause empty data on air, whilst calling too early/fast will trigger this module to flush reduce latency and avoid buffer overruns.

Summary:

  • Supply data which shall be sent synchronized in a CIS/subgroup. (E.g, 2 streams every 10 ms).
  • Call bt_le_audio_tx_stream_sent for each stream after TX completion to keep pool accounting correct.
Note
Not tested for ISO interval not equal to frame length.
Parameters
[in]ctxPointer to an initialized TX context pr CIG for unicast and pr subgroup for broadcast.
[in]audio_framePointer to encoded audio data and metadata.
[in]txPointer to an array of le_audio_tx_info elements.
[in]num_txNumber of elements in tx.
Return values
0Success (including controlled pacing cases where no SDU is sent, but finalize/publish succeeds).
-EINVALInvalid arguments, invalid stream index tuple, invalid frame metadata, or inconsistent stream/audio configuration.
-EIONo stream was sent successfully.
Returns
Other negative error codes may be propagated from lower layers (for example timestamp synchronization/HCI readback or SDU reference publish failures).