Increased audio latency with nRF5340 LE audio application due to presentation compensation (NCS 2.6.0)

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

 

Parents Reply
  • Hi  ,

    I've tried to disable the presentation compenstation and I was able to measure lower latency by ~8-ms, but I didn't try to swap recv_frame_ts_us and sdu_ref_us positions which I expect to have the same effect on lateny like disabling the presentation compensation completely.

    I'd not consider it a fix, because I don't know what has changed in NCS 2.6.0 which resulted this unwanted behaviour besides that I'm not sure if this case will continue for long periods of streaming.

    Thanks,

    Ahmed

Children
Related