nrf5340 audio dk firmware - I2S audio block datatype

Hello, I am working on implementing sound filtering system using BLE Audio (with nrf5340 audio dk). This question is regarding the latest nRF5340 Audio application.

In the audio_datapath_i2s_blk_complete() function of the audio_datapath.c module, what is the datatype of the values inside the tx_buf and rx_buf_released buffer? From what I understand, they should be 16-bit int PCM data collected from BLE Host and I2S_audio modules, respectively. However, when I print them out as 16-bit int, I got one array of data mixed with zeros and another without. See the image attached below for printed data. Are these buffers in different data format?

We are trying to put processing code inside the function since it is when both I2S tx and rx blocks are ready, and this is where the sample application does the tone_mix processing.

Frey

Parents Reply Children
  • Hello Maria, the attached is our configuration file.

    Yes, that makes sense. So the samples in two channels are stored alternatively. I see that the rx_buf have the same size as the tx_buf but without zeros. Does it means it has mic input duplicated to both channels?

    Also to double check, these are 16 bits signed data as defined in AUDIO_BIT_DEPTH config?

    Thanks for your reply.

    1351.prj.conf

  • Hello Frey,

    I have asked our LE Audio experts if they have notes on the data formats and application specific details.


    I want to make sure that you are aware of how the Low Complexity Communications Codec (LC3) is meant to work. You can read more on it in this technical overview from Bluetooth.

    One important thing to know about LE Audio and specifically LC3 is that the quality of the output audio is a perceived quality. This means that evaluating the signal itself is not a good method to judge the quality. Any data that has been through the LC3 codec is subject to the changes the codec has done to make the perceived quality of the audio higher.

    BR,

    Maria

  • Frey said:
    Does it means it has mic input duplicated to both channels?

    Yes, this is correct. The PDM mic routes to the hardware codec (CS47L63) which only supports one channel. It duplicates the output to both channels. So both rx_buf and tx_buf has two channels but only the left channel of tx_buf contains data for the CS47L63.

    About signal processing

    I got confirmed that you do signal processing on the data before encoding or after decoding it.

    About the data types

    The data types are all found in the variable declarations in the code. I.e. tx_buf's type is uint8_t* while rx_buf_released is uint32_t*

    Setting CONFIG_AUDIO_BIT_DEPTH_16=y will choose the audio sample size to be 16 bits. The data format for one sample of decoded audio will be int16_t.

    BR,

    Maria

Related