2021-03-11 09:06 PM
So I am trying to synchronize microphones with a clap board; that works nicely as-is but when I tried to change the N_MS_PER_INTERRUPT to 10 (on both BVOPUS_PER and BVOPUS_CEN), I get clicks in my audio signal.
I've changed
N_MS_PER_INTERRUPT
AUDIO_OUT_MS
and the N_MS_PER_INTERRUPT in cca02m2_conf.h
But still clicks... is there somewhere I'm missing? Can BLE handle a 10ms buffer?
2021-03-15 07:29 AM
The code modifications are correct. The problem is related to the computational power.
Basically ,if you use an audio frame size that is half of the default one (10ms instead of 20ms), it doesn’t mean that Opus takes half of the MIPS to encode/decode it. So you always need to find a compromise between audio frame size, bitrate and MCU computational power.
Attached you can see 3 slides that show the profiling in 3 different configurations.
In each slide you can see the time used by the MCU to acquire an audio sample, encode it and decode the received audio frame. Since the streaming is done in real time, in order to obtain a correct full-duplex communication, Opus must take for encoding and decoding less time than the audio acquisition (10 or 20 ms).
Basically, lower the bitrate in order to use a smaller frame size.
Two other suggestions:
Hope this is clear!