Need improvment in Zephyr LC3 encoding execution time for NRF53 MCU

Hi NRF team,

I am working on a patient monitoring system where we have used a stereo microphone. I am using the LC3 compression method and the Zephyr PDM microphone driver.

As of now, the block duration is 20ms.

So, every 20 ms, we are getting 1280 bytes from the microphone. Now I am compressing the microphone output by using the LC3 lib and encoding those 1280 bytes. The output of the LC3 lib is 160 bytes. And I stream that 160 bytes in BLE custom characteristics.

The issue is that the LC3 library consumes 13- 14ms of time for computation. Even though I am using the work queue, but CPU still needs this much time for the computation. And I need to add other peripherals like accelerometer, barometer, RGB LEDs, NAND flash, haptic and many more with nrf53.

Can we optimise the LC3 lib computation time?

Please find the microphone configuration:

CONFIG_MICROPHONE=y
CONFIG_AUDIO=y
CONFIG_NRFX_PDM=y
# CONFIG_AUDIO_DMIC=y
# CONFIG_AUDIO_DMIC_LOG_LEVEL_DBG=n
CONFIG_NRFX_PDM_LOG=n
CONFIG_DMA=y
CONFIG_MAX_PCM_SAMPLE_RATE=16000
CONFIG_SAMPLE_BIT_WIDTH=16
CONFIG_CHANNEL_COUNT=1
CONFIG_PRIMARY_CHANNEL=0
CONFIG_SH_LC3_CODEC=y
CONFIG_FPU=y
CONFIG_LIBLC3=y
CONFIG_PSCM=y
CONFIG_SW_CODEC_LC3_T2_SH_SOFTWARE=y
CONFIG_CMSIS_DSP=n
# CONFIG_CMSIS_DSP_FASTMATH=n
# CONFIG_CMSIS_DSP_TABLES=n
CONFIG_LC3_ENC_CHAN_MAX=2
CONFIG_LC3_DEC_CHAN_MAX=2
CONFIG_MICROPHONE_L_GAIN=80
CONFIG_MICROPHONE_R_GAIN=80

Related