Hi nordic,
I am streaming live microphone PCM data over BLE. The microphone data is continuously captured and stored in a buffer. Whenever 12 KB of audio data is available, I send that data over BLE to the connected device.
However, I am observing that sending the data over BLE takes a large and inconsistent amount of time.
For example, I measured the time taken by the send_data_chunk() function, which sends the data over BLE.
the api i am using is :
// ptr_buffer contains the live data
and the prj configurations i am using
Below are the timing logs (internal debugging messages removed for clarity):
Total send_data_chunk time for 12288 bytes: 873 ms
Total send_data_chunk time for 12288 bytes: 887 ms
Total send_data_chunk time for 12288 bytes: 896 ms
Total send_data_chunk time for 12288 bytes: 888 ms
Total send_data_chunk time for 12288 bytes: 903 ms
From these logs, I observe:
-
Sending 12 KB of data takes around 880–900 ms
-
the timing is not constant. Sometimes the transmission completes in around 800 ms, while at other times it takes up to 1800 ms for similar amounts of data.(when flashed the same code again repeatedly whether we are achieving the same time or not )