Hello,
With the nRF5340 LE audio application comming with nRF Connect SDK 2.6.0, I found an increase in the audio latency compared to previous versions.
I was able to measure audio latency of ~46-ms with CIS use case compared to the expected latency of ~31-ms for previous versions.
I've found some threads here reporting this issue and there were some helpful replies to tune some parameters in order to reduce the audio latency like setting the transport latency to 10 instead of the default value of 20 (CONFIG_BT_AUDIO_MAX_TRANSPORT_LATENCY_MS).
Although that helps in reducing the latecny, but I did some investigation and I found that the presentation compenstation is adding extra latency due to a mathematical error.
The presentation compenstation module uses the following formula to adjust the presentation delay
int32_t wanted_pres_dly_us = ctrl_blk.pres_comp.pres_delay_us - (recv_frame_ts_us - sdu_ref_us);
I found that with SDK version 2.6.0, sdu_ref_us is always larger than recv_frame_ts_us and (recv_frame_ts_us - sdu_ref_us) results in a negative value which is negated by the external (-) outside the parentheses, so the net result calculated will be like
int32_t wanted_pres_dly_us =
ctrl_blk.pres_comp.pres_delay_us + (sdu_ref_us - recv_frame_ts_us);
Thanks